Escalation Policies and Response Plays with the AlertOps SDKs
Create AlertOps escalation policies with Primary, Secondary and Manager roles, or response plays with timed steps, from code with the AlertOps SDKs.
Overview
Relevant for Teams automating how alerts escalate
Escalation decides who hears about an alert, and when. The AlertOps SDKs let you define it as code:
- An escalation policy is a reusable template over roles. It notifies a group's Primary members first, then escalates to Secondary and Manager after the waits you set, and it carries workflows and outbound actions with it.
- A response play is an explicit sequence of users and groups, each step with its own wait, with an optional repeat of the whole play.
Key benefits:
- Consistent escalation — apply the same ladder to every team from one script.
- Safe updates — escalation_policies.update keeps every setting you didn't change.
- Repeatable — escalation_policies.ensure and member_roles.upsert create or update, so scripts can run again.
Create an escalation policy
Relevant for Admins creating and maintaining policies
Create a policy with a name, a description and a priority, choose how people are notified, then set the timing for each role. This example builds a three-tier ladder: Primary immediately, Secondary after 2 minutes, and Manager 2 minutes later.
Python
email = [{"contact_method_name": "Email-Official", "wait_time_in_mins": 0, "sequence": 1, "to_bcc_or_cc": "To"}]
ep = ao.escalation_policies.create(escalation_policy_name="NOC Escalation", description="NOC ladder", priority="High")
epid = ep["escalation_policy_id"]
ao.escalation_policies.set_notify_mode(epid, notify_using_centralized_settings=True)
for role, wait in [("Primary", 0), ("Secondary", 2), ("Manager", 2)]:
ao.escalation_policies.member_roles.upsert(epid, role, role_wait_time_in_mins=wait,
wait_time_between_members_in_mins=0, contact_methods=email)
TypeScript
const email = [{ contact_method_name: "Email-Official", wait_time_in_mins: 0, sequence: 1, to_bcc_or_cc: "To" }];
const ep = await ao.escalationPolicies.create({ escalation_policy_name: "NOC Escalation", description: "NOC ladder", priority: "High" });
const epId = ep.escalation_policy_id;
await ao.escalationPolicies.setNotifyMode(epId, { notify_using_centralized_settings: true });
for (const [role, wait] of [["Primary", 0], ["Secondary", 2], ["Manager", 2]] as const) {
await ao.escalationPolicies.memberRoles.upsert(epId, role, {
role_wait_time_in_mins: wait, wait_time_between_members_in_mins: 0, contact_methods: email,
});
}
Go
email := []any{alertops.M{"contact_method_name": "Email-Official", "wait_time_in_mins": 0, "sequence": 1, "to_bcc_or_cc": "To"}}
ep, err := ao.EscalationPolicies.Create(ctx, &alertops.Request{Fields: alertops.M{
"escalation_policy_name": "NOC Escalation", "description": "NOC ladder", "priority": "High",
}})
if err != nil {
return err
}
epID := alertops.Get(ep, "escalation_policy_id")
if _, err = ao.EscalationPolicies.SetNotifyMode(ctx, epID,
&alertops.Request{Fields: alertops.M{"notify_using_centralized_settings": true}}); err != nil {
return err
}
for _, r := range []struct {
role string
wait int
} {
if _, err = ao.EscalationPolicies.MemberRoles.Upsert(ctx, epID, r.role, alertops.M{
"role_wait_time_in_mins": r.wait, "wait_time_between_members_in_mins": 0, "contact_methods": email,
}); err != nil {
return err
}
}
Java
var email = List.of(Map.of("contact_method_name", "Email-Official", "wait_time_in_mins", 0, "sequence", 1, "to_bcc_or_cc", "To"));
JsonNode ep = ao.escalationPolicies().create(Request.of(
"escalation_policy_name", "NOC Escalation", "description", "NOC ladder", "priority", "High"));
JsonNode epId = ep.get("escalation_policy_id");
ao.escalationPolicies().setNotifyMode(epId, Request.of("notify_using_centralized_settings", true));
for (var r : List.of(Map.entry("Primary", 0), Map.entry("Secondary", 2), Map.entry("Manager", 2))) {
ao.escalationPolicies().memberRoles().upsert(epId, r.getKey(), Map.of(
"role_wait_time_in_mins", r.getValue(), "wait_time_between_members_in_mins", 0, "contact_methods", email));
}
.NET
var email = new JsonArray(new JsonObject { ["contact_method_name"] = "Email-Official", ["wait_time_in_mins"] = 0, ["sequence"] = 1, ["to_bcc_or_cc"] = "To" });
var ep = await ao.EscalationPolicies.CreateAsync(new Kwargs
{
["escalation_policy_name"] = "NOC Escalation", ["description"] = "NOC ladder", ["priority"] = "High",
});
var epId = ep!["escalation_policy_id"]!;
await ao.EscalationPolicies.SetNotifyModeAsync(epId, new Kwargs { ["notify_using_centralized_settings"] = true });
foreach (var (role, wait) in new[] { ("Primary", 0), ("Secondary", 2), ("Manager", 2) })
{
await ao.EscalationPolicies.MemberRoles.UpsertAsync(epId, role, new Kwargs
{
["role_wait_time_in_mins"] = wait, ["wait_time_between_members_in_mins"] = 0, ["contact_methods"] = email.DeepClone(),
});
}
Set quick_launch to true on policies that people pick by hand when they raise an alert manually.
Centralized or user notification
Relevant for On-call admins choosing how people are contacted
| Mode | How people are contacted |
| Centralized (recommended) | The policy defines the contact methods and retries for each role, so everyone on the ladder is reached the same way. |
| User | Each person's own notification profile is used. |
Switch modes with escalation_policies.set_notify_mode.

Figure 1. An escalation policy created through the SDK, in the editor. Centralized is selected, Primary is notified immediately, and Email-Official is the role's contact method.
Roles and timing
Relevant for On-call admins shaping escalation timing
| Setting | What it controls |
| role_wait_time_in_mins | The wait before escalating to a role |
| wait_time_between_members_in_mins | The wait between members of the same role |
| wait_time_before_notifying_next_group_in_min | The wait before the next group, for policies with several groups |
| Retries and retry interval | How often the ladder runs again, and how far apart |
From the same resource you can attach workflows and outbound integrations, set recipients and access, and preview the escalation timeline.

Figure 2. The policy's timeline preview: Alice (Primary) at 0 m, Bob (Secondary) at 2 m and Mona (Manager) at 4 m.
Response plays
Relevant for Teams building a fixed notification sequence
A response play lists people and groups in order, each with its own wait, which suits major-incident call trees.
| Task | Operation |
| Create a play | response_plays.create |
| Set the steps | response_plays.members.set_sequence |
| Add a step | response_plays.members.append |
| Repeat the play | response_plays.set_repeat |
| Preview the timeline | response_plays.preview |

Figure 3. A response play created from a six-step timeline. Alice is notified immediately, then Bob after 1 minute and the next step after 2 minutes.
Choose a policy or a play
Relevant for On-call designers turning a timeline into configuration
| Use an escalation policy for | Use a response play for |
| A reusable ladder over roles and shifts | Named people or groups in a fixed order |
| Evenly spaced escalation | A custom wait on every step |
| Workflows and outbound actions that travel with the policy | Interleaving users and groups |
The semantic layer's escalation planner makes this choice for you from a list of timed steps.
Related Articles
- AlertOps SDKs for Python, TypeScript, Go, Java and .NET
- Users, Groups and On-Call Schedules with the AlertOps SDKs
- Planning On-Call Setups with the AlertOps Semantic Layer
- Workflows, Outbound Integrations and Maintenance Windows with the AlertOps SDKs
Need help?
Email support@alertops.com or contact your AlertOps representative.