Update a monitor
curl --request PATCH \
--url https://api.hebeat.com/monitors/{monitor_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"config_version": 1073741823,
"name": "<string>",
"description": "<string>",
"interval_seconds": 123,
"timeout_ms": 15050,
"degraded_after_ms": 15000,
"max_attempts": 2,
"regions": [],
"config": {
"type": "http",
"url": "<string>",
"request_headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"request_body": "<string>",
"expected_status": [
349
],
"follow_redirects": true,
"max_redirects": 5,
"header_assertions": [
{
"name": "<string>",
"value": "<string>"
}
],
"body_assertions": [
{
"value": "<string>"
}
]
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
config_version: 1073741823,
name: '<string>',
description: '<string>',
interval_seconds: 123,
timeout_ms: 15050,
degraded_after_ms: 15000,
max_attempts: 2,
regions: [],
config: {
type: 'http',
url: '<string>',
request_headers: [{name: '<string>', value: '<string>'}],
request_body: '<string>',
expected_status: [349],
follow_redirects: true,
max_redirects: 5,
header_assertions: [{name: '<string>', value: '<string>'}],
body_assertions: [{value: '<string>'}]
}
})
};
fetch('https://api.hebeat.com/monitors/{monitor_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hebeat.com/monitors/{monitor_id}"
payload = {
"config_version": 1073741823,
"name": "<string>",
"description": "<string>",
"interval_seconds": 123,
"timeout_ms": 15050,
"degraded_after_ms": 15000,
"max_attempts": 2,
"regions": [],
"config": {
"type": "http",
"url": "<string>",
"request_headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"request_body": "<string>",
"expected_status": [349],
"follow_redirects": True,
"max_redirects": 5,
"header_assertions": [
{
"name": "<string>",
"value": "<string>"
}
],
"body_assertions": [{ "value": "<string>" }]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"monitor": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"type": "http",
"target": "<string>",
"enabled": true,
"status": "paused",
"interval_seconds": 123,
"selected_regions": [
"us-east"
],
"last_transition_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"timeout_ms": 123,
"degraded_after_ms": 123,
"max_attempts": 123,
"config_version": 123,
"config": {
"type": "http",
"url": "<string>",
"method": "GET",
"request_headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"request_body": "<string>",
"expected_status": [
349
],
"follow_redirects": true,
"max_redirects": 5,
"header_assertions": [
{
"comparison": "equals",
"name": "<string>",
"value": "<string>"
}
],
"body_assertions": [
{
"comparison": "contains",
"value": "<string>"
}
]
},
"regions": [
{
"region_code": "us-east",
"status": "unknown",
"last_checked_at": "2023-11-07T05:31:56Z"
}
],
"in_maintenance": true,
"heartbeat": {
"schedule": {
"kind": "period",
"period_seconds": 1296030
},
"grace_seconds": 123,
"keep_messages": true,
"token_hint": "<string>",
"last_ping_at": "2023-11-07T05:31:56Z",
"last_start_at": "2023-11-07T05:31:56Z",
"next_due_at": "2023-11-07T05:31:56Z"
}
}
}{
"error": {
"code": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>",
"params": {}
}
],
"workspaces": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"member_count": 123,
"kind": "shared"
}
]
}
}{
"error": {
"code": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>",
"params": {}
}
],
"workspaces": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"member_count": 123,
"kind": "shared"
}
]
}
}{
"error": {
"code": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>",
"params": {}
}
],
"workspaces": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"member_count": 123,
"kind": "shared"
}
]
}
}{
"error": {
"code": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>",
"params": {}
}
],
"workspaces": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"member_count": 123,
"kind": "shared"
}
]
}
}{
"error": {
"code": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>",
"params": {}
}
],
"workspaces": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"member_count": 123,
"kind": "shared"
}
]
}
}{
"error": {
"code": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>",
"params": {}
}
],
"workspaces": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"member_count": 123,
"kind": "shared"
}
]
}
}Monitors
Update a monitor
PATCH
/
monitors
/
{monitor_id}
Update a monitor
curl --request PATCH \
--url https://api.hebeat.com/monitors/{monitor_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"config_version": 1073741823,
"name": "<string>",
"description": "<string>",
"interval_seconds": 123,
"timeout_ms": 15050,
"degraded_after_ms": 15000,
"max_attempts": 2,
"regions": [],
"config": {
"type": "http",
"url": "<string>",
"request_headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"request_body": "<string>",
"expected_status": [
349
],
"follow_redirects": true,
"max_redirects": 5,
"header_assertions": [
{
"name": "<string>",
"value": "<string>"
}
],
"body_assertions": [
{
"value": "<string>"
}
]
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
config_version: 1073741823,
name: '<string>',
description: '<string>',
interval_seconds: 123,
timeout_ms: 15050,
degraded_after_ms: 15000,
max_attempts: 2,
regions: [],
config: {
type: 'http',
url: '<string>',
request_headers: [{name: '<string>', value: '<string>'}],
request_body: '<string>',
expected_status: [349],
follow_redirects: true,
max_redirects: 5,
header_assertions: [{name: '<string>', value: '<string>'}],
body_assertions: [{value: '<string>'}]
}
})
};
fetch('https://api.hebeat.com/monitors/{monitor_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hebeat.com/monitors/{monitor_id}"
payload = {
"config_version": 1073741823,
"name": "<string>",
"description": "<string>",
"interval_seconds": 123,
"timeout_ms": 15050,
"degraded_after_ms": 15000,
"max_attempts": 2,
"regions": [],
"config": {
"type": "http",
"url": "<string>",
"request_headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"request_body": "<string>",
"expected_status": [349],
"follow_redirects": True,
"max_redirects": 5,
"header_assertions": [
{
"name": "<string>",
"value": "<string>"
}
],
"body_assertions": [{ "value": "<string>" }]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"monitor": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"type": "http",
"target": "<string>",
"enabled": true,
"status": "paused",
"interval_seconds": 123,
"selected_regions": [
"us-east"
],
"last_transition_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"timeout_ms": 123,
"degraded_after_ms": 123,
"max_attempts": 123,
"config_version": 123,
"config": {
"type": "http",
"url": "<string>",
"method": "GET",
"request_headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"request_body": "<string>",
"expected_status": [
349
],
"follow_redirects": true,
"max_redirects": 5,
"header_assertions": [
{
"comparison": "equals",
"name": "<string>",
"value": "<string>"
}
],
"body_assertions": [
{
"comparison": "contains",
"value": "<string>"
}
]
},
"regions": [
{
"region_code": "us-east",
"status": "unknown",
"last_checked_at": "2023-11-07T05:31:56Z"
}
],
"in_maintenance": true,
"heartbeat": {
"schedule": {
"kind": "period",
"period_seconds": 1296030
},
"grace_seconds": 123,
"keep_messages": true,
"token_hint": "<string>",
"last_ping_at": "2023-11-07T05:31:56Z",
"last_start_at": "2023-11-07T05:31:56Z",
"next_due_at": "2023-11-07T05:31:56Z"
}
}
}{
"error": {
"code": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>",
"params": {}
}
],
"workspaces": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"member_count": 123,
"kind": "shared"
}
]
}
}{
"error": {
"code": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>",
"params": {}
}
],
"workspaces": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"member_count": 123,
"kind": "shared"
}
]
}
}{
"error": {
"code": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>",
"params": {}
}
],
"workspaces": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"member_count": 123,
"kind": "shared"
}
]
}
}{
"error": {
"code": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>",
"params": {}
}
],
"workspaces": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"member_count": 123,
"kind": "shared"
}
]
}
}{
"error": {
"code": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>",
"params": {}
}
],
"workspaces": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"member_count": 123,
"kind": "shared"
}
]
}
}{
"error": {
"code": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>",
"params": {}
}
],
"workspaces": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"member_count": 123,
"kind": "shared"
}
]
}
}Headers
Body
application/json
- Option 1
- Option 2
Was this page helpful?