Rotate the ping token for a heartbeat monitor
curl --request POST \
--url https://api.devhelm.io/api/v1/monitors/{id}/rotate-token \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.devhelm.io/api/v1/monitors/{id}/rotate-token"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.devhelm.io/api/v1/monitors/{id}/rotate-token', 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.devhelm.io/api/v1/monitors/{id}/rotate-token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.devhelm.io/api/v1/monitors/{id}/rotate-token"
req, _ := http.NewRequest("POST", 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.post("https://api.devhelm.io/api/v1/monitors/{id}/rotate-token")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devhelm.io/api/v1/monitors/{id}/rotate-token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": 123,
"name": "<string>",
"config": {
"hostname": "<string>",
"recordTypes": [],
"nameservers": [
"<string>"
],
"timeoutMs": 123,
"totalTimeoutMs": 123
},
"frequencySeconds": 123,
"enabled": true,
"regions": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"assertions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"monitorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config": {
"type": "body_contains",
"substring": "<string>"
}
}
],
"tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": 123,
"name": "<string>",
"color": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"pingUrl": "<string>",
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>"
},
"auth": {
"type": "bearer",
"vaultSecretId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"incidentPolicy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"monitorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"triggerRules": [
{
"count": 123,
"windowMinutes": 123,
"thresholdMs": 123
}
],
"confirmation": {
"type": "multi_region",
"minRegionsFailing": 123,
"maxWaitSeconds": 123
},
"recovery": {
"consecutiveSuccesses": 123,
"minRegionsPassing": 123,
"cooldownMinutes": 123
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"monitorRegionCount": 123,
"checkFrequencySeconds": 123
},
"alertChannelIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}Monitors
Rotate the ping token for a heartbeat monitor
Generates a new ping token. The old token remains valid for 24 hours to allow cron jobs to be updated without downtime. Only supported for HEARTBEAT monitors.
POST
/
api
/
v1
/
monitors
/
{id}
/
rotate-token
Rotate the ping token for a heartbeat monitor
curl --request POST \
--url https://api.devhelm.io/api/v1/monitors/{id}/rotate-token \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.devhelm.io/api/v1/monitors/{id}/rotate-token"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.devhelm.io/api/v1/monitors/{id}/rotate-token', 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.devhelm.io/api/v1/monitors/{id}/rotate-token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.devhelm.io/api/v1/monitors/{id}/rotate-token"
req, _ := http.NewRequest("POST", 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.post("https://api.devhelm.io/api/v1/monitors/{id}/rotate-token")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devhelm.io/api/v1/monitors/{id}/rotate-token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": 123,
"name": "<string>",
"config": {
"hostname": "<string>",
"recordTypes": [],
"nameservers": [
"<string>"
],
"timeoutMs": 123,
"totalTimeoutMs": 123
},
"frequencySeconds": 123,
"enabled": true,
"regions": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"assertions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"monitorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config": {
"type": "body_contains",
"substring": "<string>"
}
}
],
"tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": 123,
"name": "<string>",
"color": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"pingUrl": "<string>",
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>"
},
"auth": {
"type": "bearer",
"vaultSecretId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"incidentPolicy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"monitorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"triggerRules": [
{
"count": 123,
"windowMinutes": 123,
"thresholdMs": 123
}
],
"confirmation": {
"type": "multi_region",
"minRegionsFailing": 123,
"maxWaitSeconds": 123
},
"recovery": {
"consecutiveSuccesses": 123,
"minRegionsPassing": 123,
"cooldownMinutes": 123
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"monitorRegionCount": 123,
"checkFrequencySeconds": 123
},
"alertChannelIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}{
"status": 404,
"code": "NOT_FOUND",
"message": "Monitor not found",
"timestamp": 1737302400000,
"requestId": "5b6f7a8c-1234-4d5e-9f0a-1b2c3d4e5f6a"
}Resume a monitor (set enabled=true)
Previous
List status pages that contain this monitor as a component
Next
⌘I