Monitoring as Code: Learn more about the Webhook Alert Channel Construct.
Basic Webhook Setup
1
Create Webhook Channel
Navigate to Alert Settings and choose Webhook as your channel type
2
Configure Endpoint
Set your webhook URL, HTTP method, and authentication headers
3
Customize Payload
Design your request body using Checkly’s templating system
4
Test Integration
Send test alerts to verify your webhook integration works correctly
Template Variables
Use dynamic variables to create contextual alerts:Variable | Description | Example Value |
---|---|---|
CHECK_NAME | Full check name | ”Payment API Health Check” |
CHECK_ID | UUID of the check | ”abc123-def456-ghi789” |
CHECK_TYPE | Type of check | ”API”, “BROWSER”, “HEARTBEAT” |
ALERT_TITLE | Human-readable alert title | ”Check ‘Payment API’ has failed” |
ALERT_TYPE | Alert event type | ”ALERT_FAILURE”, “ALERT_RECOVERY” |
CHECK_RESULT_ID | UUID of the result | ”result-123-456” |
CHECK_ERROR_MESSAGE | Error details | ”Connection timeout after 5000ms” |
RESPONSE_TIME | Response time in milliseconds | 1234 |
RUN_LOCATION | Location where check ran | ”N. Virginia” |
RESULT_LINK | Direct link to results | ”https://app.checklyhq.com/…” |
STARTED_AT | ISO timestamp | ”2024-01-15T14:30:22.000Z” |
TAGS | Array of check tags | [“critical”, “payment”, “api”] |
GROUP_NAME | Group name if applicable | ”Payment Services” |
Handlebars Helpers
Helper | Description |
---|---|
{{REGION}} | Resolves to the AWS region name (e.g., us-east-1 ) |
{{$UUID}} | Generates a random UUID/v4 (e.g., 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d ) |
{{$RANDOM_NUMBER}} | Generates a random decimal number between 0 and 1000 (e.g., 345 ) |
{{moment}} | Generates dates/times using moment.js with formatting: |
{{moment "YYYY-MM-DD"}}
→2020-08-26
{{moment "2 days ago" "YYYY-MM-DD"}}
→2020-08-24
{{moment "last week" "X"}}
→1597924480
{{moment}}
helper would be setting the pagination options on a typical API endpoint:
api-request
You can find the full list of helpers in the README.md file of the underlying library we are using. For a full overview of date formatting option, check the moment.js docs.Create dynamic webhook content with conditional formatting:
webhook-payload.json
Webhook Secrets
You can validate each webhook we deliver to your endpoint(s). Using the optional webhook secret, you can:- Check if the webhook was sent by Checkly.
- Check if the payload was not altered in any way during transmission.
x-checkly-signature
on each webhook.
On the receiving end, you can then use the value of the x-checkly-signature
header to assert the validity and authenticity
of the webhook and its payload.
Have a look at the code examples below on how to use the header and your favourite web framework.
- Node.js
- Ruby
- Python
webhook-server.js
Webhook Retries
Checkly will retry your webhook up to 5 times if we get an HTTP response higher than 399, e.g. a 404 or 503. Each retry is backed off 20 seconds for a total retry period of5 * 20 = 100 seconds
.
This means that for checks on a 1 minute schedule, there is a potential overlap between a failure alert and recovery alert. For this
reason every webhook we send has a timestamp in the x-checkly-timestamp
header. You can use this timestamp on the receiving
end to ignore any webhooks that come in “late”.
Webhook Examples
The following examples give an idea how to integrate Checkly with 3rd party alerting and issue tracking systems.OpsGenie
You can create an OpsGenie alert by POST-ing the following bodyopsgenie-webhook.json
alerts
API endpoint
endpoint-url
opsgenie-full-webhook.json
CHECK_GROUP_TEAM
variable with a different value for each Group, then modify the above snippet with the following:
team-responders.json
PagerDuty
Given an existing service on your PagerDuty account, create an incident for it by posting the following bodypagerduty-webhook.json
https://api.pagerduty.com/incidents
. You will need to set the following headers:

Pushover
Send a message using Pushover by posting this body:pushover-webhook.json
Trello
You can create a Trello card using just the URL and no payload:SSL alert
You can send your SSL alerts using webhooks. Using the following body:ssl-alert-webhook.json
ALERT_TITLE
to include the domain and the days remaining till your
certificate expires.
ssl-alert-response.json
Twilio
You can configure a webhook to POST to a JavaScript snippet running in a Twilio Function. This code receives the Checkly webhook JSON, then triggers a Twilio “Flow execution”:twilio-function.js
Jira
A webhook can be used to create a new issue on Jira via the Jira API, for example in the case of a previously passing check that switches to failing state. We will be creating a POST request to{{JIRA_INSTANCE_URL}}/rest/api/3/issue
, where the content of your JIRA_INSTANCE_URL
environment variable would look something like https://your-jira-instance-name.atlassian.net
.
The required headers will be:
jira-headers
jira-webhook.json
{{JIRA_INSTANCE_URL}}/rest/api/2/issue
). The only difference is that version 2 does not support Atlassian Document Format (ADF).
Webhook Best Practices
- Authentication: Always use proper authentication (API keys, signatures, OAuth)
- Idempotency: Design endpoints to handle duplicate webhook deliveries gracefully
- Error Handling: Return appropriate HTTP status codes (200-299 for success, 4xx/5xx for errors)
- Timeout: Respond to webhooks quickly (within 30 seconds) to avoid retries
- Logging: Log webhook events for debugging and monitoring
- Security: Validate webhook signatures and implement replay attack protection