const url = 'https://app.monitorly.cloud/api/v1/workspaces/WORKSPACE_ID/escalation-policies';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"levels":[{"delayMins":0,"targets":[{"id":"CHANNEL_ID","kind":"channel"}]},{"delayMins":15,"targets":[{"id":"USER_ID","kind":"member"}]}],"name":"payments on-call","repeatAfterMins":30,"repeatCount":1}'};
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://app.monitorly.cloud/api/v1/workspaces/WORKSPACE_ID/escalation-policies \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "levels": [ { "delayMins": 0, "targets": [ { "id": "CHANNEL_ID", "kind": "channel" } ] }, { "delayMins": 15, "targets": [ { "id": "USER_ID", "kind": "member" } ] } ], "name": "payments on-call", "repeatAfterMins": 30, "repeatCount": 1 }'Creates a policy: levels of channels to alert, each after a delay from the start of the incident (the first at 0), repeated until someone acknowledges. Workspace owner or admin.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The workspace’s id.
Example
WORKSPACE_IDHeader Parameters
Section titled “Header Parameters”Any 1–255 characters, for example a UUID per intended action. A retry with the same key and the same request answers the stored response and creates nothing again; the same key with another request answers 422 request.idempotency_key_reused. Keys are kept for 24 hours.
Request Bodyrequired
Section titled “Request Bodyrequired”A policy as created or replaced.
object
1–10 levels in order.
object
Minutes after the level before; 0 for level 1, 1–1440 for the others.
At most 20, each once.
object
What a target is.
1–100 characters; names need not be unique.
Minutes from the last level to the repeat, 1–10080.
How many times the whole policy runs again after its last level, 0–9.
Example
{ "levels": [ { "delayMins": 0, "targets": [ { "id": "CHANNEL_ID", "kind": "channel" } ] }, { "delayMins": 15, "targets": [ { "id": "USER_ID", "kind": "member" } ] } ], "name": "payments on-call", "repeatAfterMins": 30, "repeatCount": 1}Responses
Section titled “Responses”The policy.
object
Checks that use it instead of their project’s policy.
object
Targets that still exist: a removed channel, an unlinked chat or a member who left drops out.
object
What a target is.
The channel’s name, the chat’s title or the member’s display name.
Projects that use the policy by default (those the caller sees).
object
Example
{ "checkCount": 0, "createdAt": "2026-11-27T15:50:00Z", "id": "POLICY_ID", "levels": [ { "delayMins": 0, "targets": [ { "id": "CHANNEL_ID", "kind": "channel", "name": "#payments-oncall" } ] }, { "delayMins": 15, "targets": [ { "id": "USER_ID", "kind": "member", "name": "Dana Ortiz" } ] } ], "name": "payments on-call", "projects": [], "repeatAfterMins": 30, "repeatCount": 1, "updatedAt": "2026-11-27T15:50:00Z", "workspaceId": "WORKSPACE_ID"}Bad Request.
request.malformed: the body or a parameter is not of the expected shaperequest.idempotency_key_invalid: the key is empty or longer than 255 charactersauth.credentials_conflict: the request carries both a session cookie and a token
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Unauthorized.
auth.unauthenticated,auth.session_expired: no session, or it endedtoken.invalid: the token is malformed, unknown, revoked or expired, or its creator left the workspace
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Forbidden.
auth.forbidden: your role is too low for thistoken.scope_missing: the token lacks the scope this needs;detailnames itrequest.origin_mismatch,request.header_required: a changing request with a session comes from another site or lacksX-Monitorly-Request: 1
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Not Found.
request.not_found: it does not exist, or you cannot see it
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Payload Too Large.
request.too_large: the body is larger than 256 KiB
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Unprocessable Entity.
field.required,field.too_long,field.invalid: a field breaks a rule;errorspoints at itescalation_policy.no_levels: a policy has at least one levelescalation_policy.too_many_levels: more than 10 levels;params.maxescalation_policy.first_delay_not_zero: level 1 goes out when the incident opens: itsdelayMinsis 0escalation_policy.delay_out_of_range: a later level waits 1 to 1440 minutes after the one before;params.min,params.maxescalation_policy.too_many_targets: more than 20 targets on a level;params.maxescalation_policy.duplicate_target: the same target twice on one levelescalation_policy.target_unknown: the target is not an alert channel, a linked Telegram chat or a member of this workspaceescalation_policy.repeat_count_out_of_range:repeatCountis more than 9escalation_policy.repeat_after_out_of_range:repeatAfterMinsis not 1 to 10080;params.min,params.max
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Too Many Requests.
token.rate_limited: more than 10 requests a second with this tokensession.rate_limited: more than 5 changes a second from your sessionstoken.create_limited: more than 30 resources created within an hour from one token;Retry-Afterin seconds
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Headers
Section titled “Headers”Seconds to wait before trying again.