v2

latestOpenAPI 3.0.02026-07-261859071.2 MB
Snippets

Create a snippet

Creates a new snippet.

post/v1/snippets

Headers

x-checkly-accountstring

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

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

Request body

namestring required

The snippet name.

scriptstring required

Your Node.js code that interacts with the API check lifecycle, or functions as a partial for browser checks.

Example request

{
  "name": "Snippet",
  "script": "request.url = request.url + '/extra'"
}

Response

Created

idnumber
namestring

The snippet name.

scriptstring

Your Node.js code that interacts with the API check lifecycle, or functions as a partial for browser checks.

created_atstring date-time
updated_atstring date-time nullable

Example response

{
  "id": 1,
  "name": "Snippet",
  "script": "request.url = request.url + '/extra'"
}