POST
/
v1
/
checks
/
heartbeat
Create a heartbeat check
curl --request POST \
  --url https://api.checklyhq.com/v1/checks/heartbeat \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Check",
  "activated": true,
  "muted": false,
  "doubleCheck": true,
  "shouldFail": false,
  "locations": [
    "us-east-1",
    "eu-central-1"
  ],
  "tags": [
    "production"
  ],
  "alertSettings": {
    "escalationType": "RUN_BASED",
    "runBasedEscalation": {
      "failedRunThreshold": 1
    },
    "reminders": {
      "amount": 0,
      "interval": 5
    },
    "parallelRunFailureThreshold": {
      "enabled": false,
      "percentage": 10
    }
  },
  "useGlobalAlertSettings": true,
  "groupId": "null",
  "groupOrder": "null",
  "runtimeId": null,
  "alertChannelSubscriptions": [],
  "runParallel": false,
  "frequency": 10,
  "frequencyOffset": 2,
  "request": {},
  "heartbeat": {
    "period": 123,
    "periodUnit": "seconds",
    "grace": 123,
    "graceUnit": "seconds",
    "pingToken": "<string>"
  },
  "script": "<string>",
  "scriptPath": "<string>",
  "sslCheckDomain": "<string>",
  "environmentVariables": [
    {
      "key": "API_KEY",
      "value": "<string>",
      "locked": false,
      "secret": false
    }
  ],
  "setupSnippetId": null,
  "tearDownSnippetId": null,
  "localSetupScript": null,
  "localTearDownScript": null,
  "degradedResponseTime": 10000,
  "maxResponseTime": 20000
}'
{
  "id": "d432cf89-010b-4b12-8150-958c8eb1d5ca",
  "name": "Check",
  "activated": true,
  "muted": false,
  "tags": [
    "production"
  ],
  "alertSettings": {
    "escalationType": "RUN_BASED",
    "runBasedEscalation": {
      "failedRunThreshold": 1
    },
    "reminders": {
      "amount": 0,
      "interval": 5
    },
    "parallelRunFailureThreshold": {
      "enabled": false,
      "percentage": 10
    }
  },
  "useGlobalAlertSettings": true,
  "alertChannelSubscriptions": [
    {
      "alertChannelId": 123,
      "activated": true
    }
  ],
  "runParallel": false,
  "checkType": "HEARTBEAT",
  "heartbeat": {
    "period": 123,
    "periodUnit": "seconds",
    "grace": 123,
    "graceUnit": "seconds",
    "pingToken": "<string>",
    "pingUrl": "https://ping.checklyhq.com/22868839-8450-4010-9241-1ea83a2e425f"
  },
  "alertChannels": {
    "email": [
      {
        "address": ""
      }
    ],
    "webhook": [
      {
        "name": "",
        "url": "",
        "method": "POST",
        "headers": [
          {
            "key": "<string>",
            "value": "<string>",
            "locked": true
          }
        ],
        "queryParameters": [
          {
            "key": "<string>",
            "value": "<string>",
            "locked": true
          }
        ]
      }
    ],
    "slack": [
      {
        "url": ""
      }
    ],
    "sms": [
      {
        "number": "+549110000000",
        "name": "SMS Alert"
      }
    ]
  },
  "created_at": "2023-12-25",
  "updated_at": "2023-11-07T05:31:56Z"
}

Overview

The Create Heartbeat Check endpoint allows you to create new heartbeat monitoring checks to verify that scheduled processes, cron jobs, and background services are running correctly. Common Use Cases:
  • Cron Job Monitoring
  • Background Process Verification
  • Scheduled Task Tracking
  • Service Liveness Checks
Heartbeat checks monitor inbound signals from your applications. Configure appropriate grace periods and expected intervals for reliable process monitoring.

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

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

Query Parameters

autoAssignAlerts
boolean
default:true

Determines whether a new check will automatically be added as a subscriber to all existing alert channels when it gets created.

Body

application/json
name
string
required

The name of the check.

Example:

"Check"

heartbeat
object
required
script
string
required
activated
boolean
default:true

Determines if the check is running or not.

muted
boolean
default:false

Determines if any notifications will be send out when a check fails and/or recovers.

doubleCheck
boolean
default:true

[Deprecated] Retry failed check runs. This property is deprecated, and retryStrategy can be used instead.

shouldFail
boolean
default:false

Allows to invert the behaviour of when a check is considered to fail. Allows for validating error status like 404.

locations
enum<string>[]

An array of one or more data center locations where to run this check.

Example:
["us-east-1", "eu-central-1"]
tags
string[]

Tags for organizing and filtering checks.

Example:
["production"]
alertSettings
object

Alert settings.

useGlobalAlertSettings
boolean
default:true

When true, the account level alert setting will be used, not the alert setting defined on this check.

groupId
number

The id of the check group this check is part of.

Example:

null

groupOrder
number

The position of this check in a check group. It determines in what order checks are run when a group is triggered from the API or from CI/CD.

Required range: x >= 0
Example:

null

runtimeId
enum<string>

The runtime version, i.e. fixed set of runtime dependencies, used to execute this check.

Available options:
2025.04,
2024.09,
2024.02,
2023.09,
2023.02,
2022.10
alertChannelSubscriptions
object[]

List of alert channel subscriptions.

Example:
[]
runParallel
boolean
default:false

When true, the check will run in parallel in all selected locations.

frequency
integer
default:10

How often the check should run in minutes.

frequencyOffset
integer
Required range: x >= 1
request
object
scriptPath
string

Path of the script in the runtime.

sslCheckDomain
string
environmentVariables
object[]

Key/value pairs for setting environment variables during check execution. These are only relevant for Browser checks. Use global environment variables whenever possible.

Maximum length: 50
setupSnippetId
number

An ID reference to a snippet to use in the setup phase of an API check.

tearDownSnippetId
number

An ID reference to a snippet to use in the teardown phase of an API check.

localSetupScript
string

A valid piece of Node.js code to run in the setup phase.

localTearDownScript
string

A valid piece of Node.js code to run in the teardown phase.

degradedResponseTime
number
default:10000

The response time in milliseconds where a check should be considered degraded.

Required range: 0 <= x <= 300000
maxResponseTime
number
default:20000

The response time in milliseconds where a check should be considered failing.

Required range: 0 <= x <= 300000

Response

Created

name
string
required

The name of the check.

Example:

"Check"

id
string
Example:

"d432cf89-010b-4b12-8150-958c8eb1d5ca"

activated
boolean
default:true

Determines if the check is running or not.

muted
boolean
default:false

Determines if any notifications will be send out when a check fails and/or recovers.

tags
string[]

Tags for organizing and filtering checks.

Example:
["production"]
alertSettings
object

Alert settings.

useGlobalAlertSettings
boolean
default:true

When true, the account level alert setting will be used, not the alert setting defined on this check.

alertChannelSubscriptions
object[]
runParallel
boolean
default:false

When true, the check will run in parallel in all selected locations.

checkType
enum<string>
Available options:
HEARTBEAT
heartbeat
object
alertChannels
object
created_at
string<date>
updated_at
string<date-time>