Skip to content

Get test

GET
/test/{id}
curl --request GET \
--url https://testomato.com/api/test/5e9602e7a39e5a46428b457f \
--header 'Authorization: Bearer <token>'

Retrieve Checks (referred to as tests in API endpoints) by unique test ID

id
required
string

A unique test ID

Example
5e9602e7a39e5a46428b457f

Test response

Media typeapplication/json

A group of individual checks

object
id

Check id

string
enabled
boolean
default: true
areaId

Area ID

name

Name of check

string
url

URL of check

string
notice

Check notice

string
type
string
Allowed values: homepage simple favicon robots
run
string
Allowed values: completed running
flags

Test flags e.g. configured

Array<string>
status
object
status
string
failures
Array<string>
rules
Array<object>
object
type

Type of check. Accepted values:

  • Plain content: text, html, status, header, location, title, meta-description
  • Open Graph: meta-og:title, meta-og:description, meta-og:image, meta-og:type, meta-og:url, meta-og:site_name, meta-og:locale, meta-og:updated_time, meta-og:logo
  • Article: meta-article:modified_time, meta-article:published_time, meta-article:publisher, meta-article:section, meta-article:tag
  • Twitter: meta-twitter:title, meta-twitter:image, meta-twitter:description, meta-twitter:card, meta-twitter:site, meta-twitter:creator
  • Item prop: meta-itemprop:name, meta-itemprop:author, meta-itemprop:description, meta-itemprop:image
string
default: text
Allowed values: text html status header location title meta-description meta-og:title meta-og:description meta-og:image meta-og:type meta-og:url meta-og:site_name meta-og:locale meta-og:updated_time meta-og:logo meta-article:modified_time meta-article:published_time meta-article:publisher meta-article:section meta-article:tag meta-twitter:title meta-twitter:image meta-twitter:description meta-twitter:card meta-twitter:site meta-twitter:creator meta-itemprop:name meta-itemprop:author meta-itemprop:description meta-itemprop:image
op

Operators can be:

  • eq — equal to
  • sub — contains
  • !sub — does not contain
  • match — exact match
  • !match — does not match
  • xpath — XPath checks.
string
Allowed values: eq sub !sub match !match xpath
val

Value that will be used for the check.

string
origin

Origin of the check.

string
templateId

Optional parameter if the check uses a template.

string
order

Order of the check

integer
response
object
status
string
httpStatus
string
baseUrl
string
contentType
string
httpHeader
string
processTime
number
size

Size of the response (may be false in case of an error)

number
redirects

List of redirections

Array<string>
timing
Array
object
metrics
string
value
integer
templateId

Template ID if any

string
templateVars

Template variables if any

Array<string>
options
object
2

Allow HTTP/1 requests only

boolean
6

Allow only IPv6 request

boolean
g

Do not accept gzip encoding

boolean
l

Do not follow redirects

boolean
w

Extra HTTP headers separated

string
""
Example
{
"id": "50a9f73014db3ae812000234",
"enabled": true,
"areaId": "55ae166c25b395537a8b6030",
"name": "Homepage",
"url": "https://testomato.com",
"notice": "",
"type": "homepage",
"run": "completed",
"flags": [
"configured"
],
"status": {
"status": "ok",
"rules": [
{
"type": "text",
"op": "eq",
"val": 123456,
"origin": "check"
}
],
"response": {
"status": 200,
"httpStatus": 200,
"baseUrl": "https://testomato.com",
"contentType": "text/html",
"httpHeader": ":status: 200\r\nserver: nginx\r\ndate: Mon, 10 Oct 2022 15:04:05 GMT\r\ncontent-type: text/html;",
"processTime": 0.037,
"size": false,
"timing": [
{
"metrics": "DNS Lookup",
"value": 1
}
]
}
},
"templateId": "",
"templateVars": [],
"options": {
"2": false,
"6": false,
"g": false,
"l": false,
"w": ""
}
}

The API token is missing, malformed or expired. Request a new one from POST /api/authenticate.

Media typeapplication/json
object
message

Error message text

string
default: Access denied! Please log in to access this resource.
code

Error code number

integer
default: 401
ok
boolean
error
boolean
default: true
Example
{
"message": "Access denied! Please log in to access this resource.",
"code": 401,
"ok": false,
"error": true
}

The token is valid but the operation is not allowed. Two distinct causes:

  • the subscription plan does not include API access — every endpoint returns this, regardless of the resource
  • the account lacks the required role on the project — reading needs read, changing checks needs editTests, and so on. See Project permissions.
Media typeapplication/json
object
message

Error message text

string
default: Sorry! Your current plan does not support access to Testomato API.
code

Error code number

integer
default: 403
ok
boolean
error
boolean
default: true
Example
{
"message": "Sorry! Your current plan does not support access to Testomato API.",
"code": 403,
"ok": false,
"error": true
}