Setup Progress and Test Page
Read and store the progress of the Incident Management setup, and send yourself a test page through a team.
GET /api/im/setup/state · PATCH /api/im/setup/state · POST /api/im/setup/test-page
The organization keeps one free-form setup object, so a setup flow (team, schedule, alert source, test page) can be resumed on another device or by another admin. These endpoints read and write that object, and send a test page to check that paging reaches you.
Authentication
All three need an IM-eligible role (admin, editor, responder) or an organization-wide API token.
- The setup state is reachable before Incident Management is activated. Writing it requires the
adminrole of the organization. - The test page requires Incident Management to be enabled and write access to the team: the
adminrole, or team-admin membership. It pages you, so it needs a user session; an organization-wide API token receives403(imAccessDenied).
Get the setup state
GET /api/im/setup/state
Example (cURL)
curl -X GET "$BASE_URL/api/im/setup/state" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json"Response
{
"organizationId": 42,
"setupState": {
"teamId": 7,
"sourceCreated": true
}
}setupState is whatever was last stored (the keys above are only an example). It is {} until something was stored.
Store the setup state
PATCH /api/im/setup/state
Replaces the stored object as a whole.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
setupState | object | Yes | A plain JSON object, at most 8 KB serialized. |
Example (cURL)
curl -X PATCH "$BASE_URL/api/im/setup/state" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"setupState":{"teamId":7,"sourceCreated":true}}'Response
The stored state, in the same shape as the GET.
Send a test page
POST /api/im/setup/test-page
Creates a test incident (isTest: true, severity sev4, title "Setup wizard test page") in the given team and pages the caller on every channel that can reach them:
email, alwayssms, when a verified phone number is set in the notification settingsvoice, additionally whenincludeVoiceistrueand the phone number is verified
Test incidents are not counted by Count Open Incidents. Test pages and test notifications share one limit of 5 per hour per user.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
teamId | number | Yes | A team of your organization. |
includeVoice | boolean | No | Also place a voice call. Default false. |
Example (cURL)
curl -X POST "$BASE_URL/api/im/setup/test-page" \
-H "Content-Type: application/json" \
-b "$SESSION_COOKIE" \
-d '{"teamId":7}'Response
{
"incidentId": 1834,
"channels": ["email", "sms"],
"enqueueErrors": []
}enqueueErrors lists the channels whose page could not be queued. Empty on success.
Common errors
400 Bad Request(invalidRequestBody) whensetupStateis missing, not an object or larger than 8 KB, or whenteamIdis missing401 Unauthorizedwhen not authenticated403 Forbidden(customerScopedTokenForbidden) when using a customer-scoped token403 Forbidden(imAccessDenied) when the caller has no IM-eligible role, or when the test page is requested with an API token403 Forbidden(forbidden) when a non-admin writes the setup state403 Forbidden(imNotEnabled) when sending a test page before Incident Management is enabled403 Forbidden(imTeamWriteDenied) when the caller may not write the team422 Unprocessable Entity(invalidTeamId) when the team does not exist in your organization429 Too Many Requests(imTestNotificationRateLimited) after 5 test pages or test notifications in an hour;retryAfterSecondssays when to retry
Activate Incident Management
Switches Incident Management on for your organization. Idempotent: calling it again on an enabled organization changes nothing.
Events Ingest
Public alert-ingest endpoint for Incident Management. Post any JSON alert payload from your own monitoring or alerting system; it is queued and processed asynchronously into an incident.