Declare an Incident
title is optional, and Rootly generates one if you omit it. That is convenient for a quick call and a poor idea for an integration: the title is the first thing everyone reads in the incident list.
The example sends kind: "test" on purpose. Run it as written and you get a test incident, not a production one. Test incidents are left out of the default dashboards. Workflows still run when their incident kind condition includes Test, and the default workflow that creates an incident Slack channel includes it. Remove that line when you go live, or your real integration will only ever declare test incidents.
Useful attributes beyond the basics: private for a sensitive incident, parent_incident_id to declare a sub-incident, and alert_ids to attach the alerts that prompted it.
Page Someone
Paging happens by creating an alert with a notification target. The alert is the record; the target is who gets woken.notification_target_type can be User, Group, EscalationPolicy, Service, or Functionality.
Prefer an EscalationPolicy or a Service over a named User. A user ID in a script is a person who will eventually leave, be on holiday, or move teams, and the script will keep paging them regardless. An escalation policy is the same call with a rota behind it.
Notification targets require Rootly On-Call.
notification_targets with any combination of the types above.
Post an Alert Without Paging
The same endpoint records an alert without paging anyone if you omit the notification target.summary is the only required attribute.
Wire a Webhook
name and url are required, and name must be unique in your organization. Subscribe only to the events you handle: a receiver that ignores most of what it gets has logs that are hard to use when something breaks. Event types are on Webhooks.
Set secret and verify the signature. Every delivery carries X-Rootly-Signature; an endpoint that does not check it will accept anything anyone sends to that URL. See Verifying Webhook Signatures.
custom_headers takes up to 10 name/value pairs if your receiver needs its own auth header.
Finding the IDs
Every recipe above takes IDs rather than names. List the collection and read theid:
IDs are stable, so look them up once and keep them in configuration rather than resolving names on every call.
Related Pages
API Overview
Authentication, pagination, rate limits, and key management.
Webhooks
Event types, delivery contract, and signature verification.
SDKs
Client libraries, if you would rather not hand-roll requests.