Skip to content

Create an escalation policy

POST
/api/v1/workspaces/{workspaceId}/escalation-policies
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.

workspaceId
required
string format: uuid

The workspace’s id.

Example

WORKSPACE_ID
Idempotency-Key
string
>= 1 characters <= 255 characters

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.

Media typeapplication/json

A policy as created or replaced.

object
levels
required

1–10 levels in order.

Array<object>
object
delayMins
required

Minutes after the level before; 0 for level 1, 1–1440 for the others.

integer format: int32
targets
required

At most 20, each once.

Array<object>
object
id
required
string format: uuid
kind
required

What a target is.

string
Allowed values: channel telegram_chat member
name
required

1–100 characters; names need not be unique.

string
repeatAfterMins

Minutes from the last level to the repeat, 1–10080.

integer format: int32
repeatCount

How many times the whole policy runs again after its last level, 0–9.

integer format: int32

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
}

The policy.

Media typeapplication/json
object
checkCount
required

Checks that use it instead of their project’s policy.

integer format: int64
createdAt
required
string
id
required
string format: uuid
levels
required
Array<object>
object
delayMins
required
integer format: int32
targets
required

Targets that still exist: a removed channel, an unlinked chat or a member who left drops out.

Array<object>
object
id
required
string format: uuid
kind
required

What a target is.

string
Allowed values: channel telegram_chat member
name
required

The channel’s name, the chat’s title or the member’s display name.

string
name
required
string
projects
required

Projects that use the policy by default (those the caller sees).

Array<object>
object
id
required
string format: uuid
name
required
string
repeatAfterMins
required
integer format: int32
repeatCount
required
integer format: int32
updatedAt
required
string
workspaceId
required
string format: uuid

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 shape
  • request.idempotency_key_invalid: the key is empty or longer than 255 characters
  • auth.credentials_conflict: the request carries both a session cookie and a token
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

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 ended
  • token.invalid: the token is malformed, unknown, revoked or expired, or its creator left the workspace
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

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 this
  • token.scope_missing: the token lacks the scope this needs; detail names it
  • request.origin_mismatch, request.header_required: a changing request with a session comes from another site or lacks X-Monitorly-Request: 1
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

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
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

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
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

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; errors points at it
  • escalation_policy.no_levels: a policy has at least one level
  • escalation_policy.too_many_levels: more than 10 levels; params.max
  • escalation_policy.first_delay_not_zero: level 1 goes out when the incident opens: its delayMins is 0
  • escalation_policy.delay_out_of_range: a later level waits 1 to 1440 minutes after the one before; params.min, params.max
  • escalation_policy.too_many_targets: more than 20 targets on a level; params.max
  • escalation_policy.duplicate_target: the same target twice on one level
  • escalation_policy.target_unknown: the target is not an alert channel, a linked Telegram chat or a member of this workspace
  • escalation_policy.repeat_count_out_of_range: repeatCount is more than 9
  • escalation_policy.repeat_after_out_of_range: repeatAfterMins is not 1 to 10080; params.min, params.max
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

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 token
  • session.rate_limited: more than 5 changes a second from your sessions
  • token.create_limited: more than 30 resources created within an hour from one token; Retry-After in seconds
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

Example generated

{
"detail": "example",
"errors": [
{
"code": "example",
"params": {
"additionalProperty": "example"
},
"pointer": "example"
}
],
"status": 1,
"title": "example",
"type": "example"
}
Retry-After
integer
>= 1

Seconds to wait before trying again.