Skip to content
  • There are no suggestions because the search field is empty.

Working with Alerts in the AlertOps SDKs

List, raise, assign, close and report on AlertOps alerts from code, and act on notification links from chat bots and tools, with the AlertOps SDKs.

Overview

Relevant for Developers automating alert triage and response

An alert is opened by an inbound integration or by a person, and AlertOps notifies responders according to its escalation policy. The AlertOps SDKs give your tools, scripts and chat bots the full alert lifecycle: list and export alerts, raise new ones, assign, snooze, hold and close them, and add notes, attachments and postmortems.

Key benefits:

  • Easy reporting — alerts.list_recent returns the last few days of alerts across every page, ready to filter by priority or status.
  • Lifecycle helpers — assign, hold, snooze, reopen, close and resolve with one call each.
  • Chat-ops ready — auth.act_on_link acknowledges, assigns, escalates or closes an alert from the link in its notification.

List and export alerts

Relevant for Teams building reports and triage views

TaskOperation
List the last N days of alertsalerts.list_recent(days)
List alerts for a date range and filtersalerts.list
Export alerts as CSValerts.export
Read one alertalerts.get
See its timeline and status changesalerts.timeline, alerts.status_changes
See who was notifiedalerts.recipients, alerts.messages.summary

Filter by status, priority, owner, integration, escalation policy, subject or source. Paginated variants (…All and …Iter) read every page for you.

Alert ingested through the SDK

Figure 1. An alert ingested through the SDK's API integration. The summary shows the owner, the escalation policy and the technical service; the stats show the inbound event and the users notified.

Raise a manual alert

Relevant for Developers raising alerts from scripts and tools

alerts.create opens an alert with a subject, description, priority and recipients, using a quick-launch escalation policy or a response play. It returns the new alert with its alert_id. To keep a draft for later, use alerts.drafts.create and send it with alerts.drafts.send.

Manage the lifecycle

Relevant for Responders and automation assigning, closing and parking alerts

OperationEffect
alerts.assignTakes ownership and stops further escalation
alerts.holdPuts the alert on hold
alerts.snoozeSnoozes the alert for 1 to 168 hours
alerts.reopenReopens the alert
alerts.closeCloses the alert with a resolution
alerts.resolveBrings the alert to a final state in one call
alerts.bulk_assign, alerts.bulk_closeAssigns or closes many alerts at once

You can also merge related alerts, promote an alert to an incident, reply on an alert, resend or escalate a message, and add recipients to an open alert.

Act on a notification link

Relevant for Developers building acknowledge buttons, bots and responders

Every alert notification carries Acknowledge, Assign, Escalate and Close links. Pass one of those links to auth.act_on_link and the SDK performs that action and returns the alert's latest state. This is a simple way to let a chat bot or internal tool respond to an alert on a user's behalf.

Python

action, summary = ao.auth.act_on_link(link)
print(action, summary["message_status"], summary["alert_status"]) # acknowledge ACK Open

TypeScript

const [action, summary] = await ao.auth.actOnLink(link);
console.log(action, summary.message_status, summary.alert_status); // acknowledge ACK Open

Go

action, summary, err := ao.Auth.ActOnLink(ctx, link, nil)
if err != nil {
return err
}
fmt.Println(action, alertops.Get(summary, "message_status"), alertops.Get(summary, "alert_status")) // acknowledge ACK Open

Java

PlatformHelpers.LinkResult result = ao.auth().actOnLink(link);
System.out.println(result.action() + " " + result.alert().path("message_status").asText()
+ " " + result.alert().path("alert_status").asText()); // acknowledge ACK Open

.NET

var (action, summary) = await ao.Auth.ActOnLinkAsync(link);
Console.WriteLine($"{action} {summary?["message_status"]} {summary?["alert_status"]}"); // acknowledge ACK Open

Acknowledging tells the team "I've seen it"; assign or close the alert when someone takes ownership. Treat notification links like passwords, because each link acts on its alert.

Notes, attachments, fields and postmortems

Relevant for Responders enriching alerts and closing the loop

TaskOperation
Add or edit a notealerts.notes.create, alerts.notes.update
Upload or download a filealerts.attachments.add, alerts.attachments.download
Set custom field valuesalerts.update_fields
Save a postmortem on a closed alertalerts.postmortem.save

Best Practices

Relevant for Teams automating alert handling

  • Assign as soon as someone owns it — assignment stops the escalation ladder, so only the people who need to know are paged.
  • Close with a resolution — a clear resolution note makes reports and postmortems more useful.
  • Use bulk operations for large clean-ups after an outage.

Related Articles

Need help?

Email support@alertops.com or contact your AlertOps representative.