Add monitors of any type to a service. Monitors already on it stay; nothing else on the service changes.
POST
/service/{service_id}/monitors
const url = 'https://api.siteqwality.com/service/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/monitors';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"monitors":[{"monitor_type":"example","monitor_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}],"move":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siteqwality.com/service/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/monitors \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "monitors": [ { "monitor_type": "example", "monitor_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ], "move": true }'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” service_id
required
string format: uuid
Service identifier
Request Body required
Section titled “Request Body required ” Media type application/json
object
monitors
required
The monitors to add; ones already on this service are left as they are.
Array<object>
object
monitor_type
required
http, cron, browser, tls, dns, dns_record or page_speed; any other is a 400.
string
monitor_id
required
string format: uuid
move
Move monitors that belong to another service instead of answering 409.
boolean
Example generated
{ "monitors": [ { "monitor_type": "example", "monitor_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ], "move": true}Responses
Section titled “ Responses ”Every monitor now on the service
Media type application/json
Array<object>
object
id
required
string format: uuid
name
required
string
monitor_type
required
http, cron, browser, tls, dns, dns_record or page_speed.
string
status
The monitor’s own status label, such as success, failed, bad or expired.
string
healthy
Whether the monitor counts as healthy for auto-resolve.
boolean
paused
boolean
Example generated
[ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "monitor_type": "example", "status": "example", "healthy": true, "paused": true }]No monitors, or a type that cannot join a service
Missing or invalid authentication
Service or monitor not found
A monitor belongs to another service (monitor_in_other_service); send move: true to move it
Internal server error