Snippets

Update a snippet

Updates a snippet.

put/v1/snippets/{id}

Path parameters

idinteger required

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

Successful

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'"
}

Changes

Changed in 1 of the 4 revisions of this API.221

  • 87d29dc7b4fe221See the full diff
    • the name request property's minLength was increased from 0 to 1

      request-property-min-length-increased

    • the script request property's minLength was increased from 0 to 1

      request-property-min-length-increased

    • for the path request parameter id, the exclusiveMinimum was set to true

      request-parameter-exclusive-min-set

    • for the path request parameter id, the min was set to 0.00

      request-parameter-min-set

    • added the non-success response with the status 400

      response-non-success-status-added

    This revision also has 566 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog