Get a list of events for a heartbeat
curl --request GET \
--url https://api.checklyhq.com/v1/checks/heartbeats/{checkId}/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.checklyhq.com/v1/checks/heartbeats/{checkId}/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.checklyhq.com/v1/checks/heartbeats/{checkId}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.checklyhq.com/v1/checks/heartbeats/{checkId}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.checklyhq.com/v1/checks/heartbeats/{checkId}/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.checklyhq.com/v1/checks/heartbeats/{checkId}/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.checklyhq.com/v1/checks/heartbeats/{checkId}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"events": [
{
"id": "<string>",
"state": "FAILING",
"timestamp": "2023-07-24T10:01:01.098Z",
"source": "HTTPS GET from Curl",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36"
}
],
"stats": {
"last24Hours": {
"successRatio": {
"previousPeriod": 123,
"currentPeriod": 123
},
"totalEntitiesCurrentPeriod": 123
},
"last7Days": {
"successRatio": {
"previousPeriod": 123,
"currentPeriod": 123
},
"totalEntitiesCurrentPeriod": 123
}
}
}
]{
"statusCode": 401,
"error": "Unauthorized",
"message": "Bad Token",
"attributes": {}
}{
"statusCode": 403,
"error": "Forbidden",
"message": "Forbidden"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Not Found"
}{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Too Many Requests",
"attributes": {}
}Heartbeat Monitor
List all events for a heartbeat monitor
Get all events from a heartbeat.
GET
/
v1
/
checks
/
heartbeats
/
{checkId}
/
events
Get a list of events for a heartbeat
curl --request GET \
--url https://api.checklyhq.com/v1/checks/heartbeats/{checkId}/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.checklyhq.com/v1/checks/heartbeats/{checkId}/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.checklyhq.com/v1/checks/heartbeats/{checkId}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.checklyhq.com/v1/checks/heartbeats/{checkId}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.checklyhq.com/v1/checks/heartbeats/{checkId}/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.checklyhq.com/v1/checks/heartbeats/{checkId}/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.checklyhq.com/v1/checks/heartbeats/{checkId}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"events": [
{
"id": "<string>",
"state": "FAILING",
"timestamp": "2023-07-24T10:01:01.098Z",
"source": "HTTPS GET from Curl",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36"
}
],
"stats": {
"last24Hours": {
"successRatio": {
"previousPeriod": 123,
"currentPeriod": 123
},
"totalEntitiesCurrentPeriod": 123
},
"last7Days": {
"successRatio": {
"previousPeriod": 123,
"currentPeriod": 123
},
"totalEntitiesCurrentPeriod": 123
}
}
}
]{
"statusCode": 401,
"error": "Unauthorized",
"message": "Bad Token",
"attributes": {}
}{
"statusCode": 403,
"error": "Forbidden",
"message": "Forbidden"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Not Found"
}{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Too Many Requests",
"attributes": {}
}Authorizations
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
Your Checkly account ID, you can find it at https://app.checklyhq.com/settings/account/general
Path Parameters
Query Parameters
Required range:
x <= 10Was this page helpful?
⌘I