On-Call API › Escalation policies
Create an escalation policy
Creates a policy: who is notified about an alert, in what order, and how often
it repeats. team_id defaults to the caller's first team and must be a team
the caller is in.
Rules for the policy and its steps (the whole list is replaced):
- At least one step.
target_typeisuser,schedule,webhookorslack. Auserstep needstarget_user_id, aschedulesteptarget_schedule_id; aslackstep (legacy) needstarget_slack_channel_id. delay_minutes(the wait before the step) is one of 1, 2, 3, 5, 10, 15, 30 or 60; only the first step may be 0, meaning at once.attemptsis 1–10 (0 or omitted means 1). With more than one attempt,attempt_delay_minutesis one of the same intervals.notify_methodis empty (each person's own notification preferences),push,calloremail. SMS is not available for new steps; existing SMS steps can be kept when a policy is updated.- A user named by a step must be a member who can respond to alerts. A
target_chat_channel_idmust be one of the organization's Microsoft Teams channels. - With
repeat_enabled,repeat_countis 1–5 andrepeat_delay_minutesone of the intervals above. ack_timeout_minutesis 0 (off) or 1–1440; when set,ack_timeout_repeatis 1–5 andack_timeout_reachisothers(default) oracker_first.
Permission (API-key scope): oncall:escalation:write.
Authorization
bearerAuth(oncall:escalation:write)apiKeyHeader(oncall:escalation:write)
Request body required
namestringdescriptionstringteam_idstringrepeat_enabledbooleanrepeat_countintegerrepeat_delay_minutesintegerack_timeout_minutesintegerack_timeout_repeatintegerack_timeout_reachstringstepsarray of EscalationStepWrite requiredShow EscalationStepWrite properties
step_numberintegerdelay_minutesinteger0 (first step only), 1, 2, 3, 5, 10, 15, 30 or 60.target_typeEscalationTargetType requiredtarget_user_idstringtarget_schedule_idstringtarget_schedule_layer_idstringtarget_webhook_urlstringtarget_slack_channel_idstringtarget_slack_channel_namestringOnly together withtarget_slack_channel_id.target_chat_channel_idstringnotify_methodNotifyMethodattemptsinteger1–10; 0 or omitted means 1.attempt_delay_minutesintegerNeeded whenattemptsis more than 1.
Responses
201
The policy.
dataEscalationPolicy requiredShow EscalationPolicy properties
idstringorg_idstringteam_idstringnamestringdescriptionstringrepeat_countintegerrepeat_delay_minutesintegerrepeat_enabledbooleanack_timeout_minutesintegerEscalate again when an acknowledged alert stays unresolved this long; 0 is off.ack_timeout_repeatintegerHow many times that may happen per alert.ack_timeout_reachstringothersgoes past whoever acknowledged;acker_firstreminds them once first. Empty meansothers.stepsarray of EscalationStepShow EscalationStep properties
idstringpolicy_idstringstep_numberintegerdelay_minutesintegerWait before this step.target_typeEscalationTargetTypetarget_user_idstringtarget_schedule_idstringtarget_schedule_layer_idstringPage only this layer of the schedule.target_webhook_urlstringtarget_slack_channel_idstringA Slack channel this step also posts to.target_slack_channel_namestringtarget_chat_channel_idstringA Microsoft Teams channel this step also posts to.notify_methodNotifyMethodattemptsintegerHow many times the step notifies before the policy moves on.attempt_delay_minutesintegercreated_atstring (date-time)updated_atstring (date-time)
external_sourcestringexternal_idstringcreated_atstring (date-time)updated_atstring (date-time)
successboolean required
400
The body is not JSON (INVALID_BODY), or a rule below is broken (VALIDATION_FAILED, the field is named in details).
errorobject requiredcodestring requiredmessagestring requireddetailsarray of object requiredfieldstringmessagestring
401
No API key was sent, or it is unknown, revoked or expired (UNAUTHORIZED).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
403
The key lacks the scope (FORBIDDEN), or team_id names a team the caller is not in (NOT_IN_TEAM).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
404
A step names someone who is not a member of the organization (NOT_A_MEMBER).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
422
A step names a person who cannot respond to alerts (CANNOT_RESPOND), or asks for SMS (NOTIFY_METHOD_UNAVAILABLE).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
429
Too many requests (RATE_LIMITED). Wait Retry-After seconds.
Retry-AfterintegerSeconds to wait.
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
500
Something went wrong on EvoHub's side (INTERNAL_ERROR). Retry later.
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
503
Whether the person may be paged could not be checked right now; nothing was changed (MEMBER_CHECK_UNAVAILABLE). Retry shortly.
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
Example request
curl -X POST 'https://evohub.io/api/v1/escalation-policies' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"name": "Platform critical",
"steps": [
{
"attempts": 2,
"step_number": 1,
"target_type": "schedule",
"delay_minutes": 0,
"target_schedule_id": "5b1c7d2e-8f3a-4b9c-a0d1-e2f3a4b5c6d7",
"attempt_delay_minutes": 5
},
{
"step_number": 2,
"target_type": "user",
"delay_minutes": 10,
"notify_method": "call",
"target_user_id": "4c2a9e7b-1d3f-4a8c-b6e5-9f0a1b2c3d4e"
}
],
"team_id": "a3f9c2e1-7b4d-4c8a-9e6f-2d1b0c9a8f7e",
"description": "Page the rota, then the lead",
"repeat_count": 2,
"repeat_enabled": true,
"ack_timeout_reach": "others",
"ack_timeout_repeat": 1,
"ack_timeout_minutes": 30,
"repeat_delay_minutes": 15
}'