Skip to main content
POST
/
v1
/
test-sessions
/
trigger
Trigger a new test session
curl --request POST \
  --url https://api.checklyhq.com/v1/test-sessions/trigger \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "runLocation": "<string>",
  "target": {
    "matchTags": [
      [
        "<string>"
      ]
    ],
    "checkId": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "allowDeactivated": false
  },
  "environmentVariables": [
    {
      "key": "<string>",
      "value": null,
      "locked": false
    }
  ],
  "retryStrategy": {
    "baseBackoffSeconds": 60,
    "sameRegion": true,
    "onlyOn": [],
    "maxRetries": 2,
    "maxDurationSeconds": 600
  },
  "refreshCache": false,
  "metadata": {
    "environment": "<string>",
    "repoUrl": "<string>",
    "commitId": "<string>",
    "commitOwner": "<string>",
    "commitMessage": "<string>",
    "branchName": "<string>"
  }
}
'
{
  "testSessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "testSessionLink": "<string>",
  "name": "<string>",
  "errorGroupIds": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "startedAt": "2023-11-07T05:31:56Z",
  "timeElapsed": 123,
  "stoppedAt": "2023-11-07T05:31:56Z",
  "metadata": {
    "environment": "<string>",
    "repoUrl": "<string>",
    "commitId": "<string>",
    "commitOwner": "<string>",
    "commitMessage": "<string>",
    "branchName": "<string>"
  },
  "results": [
    {
      "testSessionResultId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "testSessionResultLink": "<string>",
      "errorGroupIds": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "hasErrors": true,
      "hasFailures": true,
      "isDegraded": true,
      "aborted": true,
      "checkId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "runLocation": "<string>"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://checkly-422f444a-michelle-document-missing-api-endpoints.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

The Checkly Public API uses API keys to authenticate requests. You can get the API Key here. Your API key is like a password: keep it secure! Authentication to the API is performed using the Bearer auth method in the Authorization header and using the account ID. For example, set Authorization header while using cURL: curl -H "Authorization: Bearer [apiKey]" "X-Checkly-Account: [accountId]"

Headers

x-checkly-account
string<uuid>

Your Checkly account ID, you can find it at https://app.checklyhq.com/settings/account/general

Body

application/json
name
string
required

The name of the test session.

Minimum string length: 1
runLocation
string
required

A public region code or private location slug name.

Minimum string length: 1
target
object
environmentVariables
object[]
Maximum array length: 50
retryStrategy
object
refreshCache
boolean
default:false

Skip existing caches and install dependencies from scratch.

metadata
object

Response

Created

testSessionId
string<uuid>
required
name
string
required
status
enum<string>
required
Available options:
RUNNING,
FAILED,
PASSED,
CANCELLED
errorGroupIds
string<uuid>[]
required

IDs of the test-session error groups observed in this test session.

startedAt
string<date-time>
required
timeElapsed
number
required
stoppedAt
string<date-time> | null
metadata
object
results
object[]