Skip to content
v1
Docs

API reference

Alarm policies

Alarm policies: who and which channels an alarm notifies.

Its operations need the scopes policies.edit, policies.view or policies.delete.

The Alarm policy object

Attributes

  • uuidstring

    The policy’s uuid.

  • namestring

    The policy’s name.

  • defaultboolean

    Whether this is the organisation’s default policy, which cannot be deleted.

  • all_usersboolean

    Whether every user of the organisation is notified for a warning incident (and a critical one while critical_uses_warning is true).

  • all_channelsboolean

    Whether every alarm channel of the organisation is notified for a warning incident (and a critical one while critical_uses_warning is true).

  • all_groupsboolean

    Whether every contact group of the organisation is notified for a warning incident (and a critical one while critical_uses_warning is true).

  • all_users_channelsarray of strings

    The ways every user is reached when all_users is on for a warning incident (and a critical one while critical_uses_warning is true).

  • all_groups_channelsarray of strings

    The ways every group member is reached when all_groups is on for a warning incident (and a critical one while critical_uses_warning is true).

  • notifiesarray of objects

    Who the policy notifies for a warning incident, and for a critical one while critical_uses_warning is true.

  • critical_uses_warningboolean

    Whether critical incidents use the same routing as warning ones. While true, critical is null.

  • criticalobject or null

    The routing for critical incidents, while critical_uses_warning is false.

Create an alarm policy

POST/v1/alarm-policies

Creates an alarm policy from a name and who it notifies: every user, every channel or every contact group by a switch, and individual users, alarm channels and contact groups in notifies. That is who a warning incident notifies, and a critical one too unless a critical object gives the critical incidents their own route (or critical_uses_warning is false, which starts it as a copy of the warning route).

Needs the scope policies.edit.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Body parameters

  • namestringRequired

    The policy’s name, up to 255 characters.

  • all_usersboolean or nullOptional

    Whether every user of the organisation is notified, by the channels of all_users_channels, for a warning incident (and a critical one while critical_uses_warning is true).

  • all_channelsboolean or nullOptional

    Whether every alarm channel of the organisation is notified for a warning incident (and a critical one while critical_uses_warning is true).

  • all_groupsboolean or nullOptional

    Whether every contact group of the organisation is notified for a warning incident (and a critical one while critical_uses_warning is true).

  • all_users_channelsarray of strings or nullOptional

    The ways every user is reached when all_users is on for a warning incident (and a critical one while critical_uses_warning is true): email, sms, whatsapp.

    Values:emailsmswhatsapp(an open set: new values may be added)
  • all_groups_channelsarray of strings or nullOptional

    The ways every group member is reached when all_groups is on for a warning incident (and a critical one while critical_uses_warning is true): email, sms, whatsapp.

    Values:emailsmswhatsapp(an open set: new values may be added)
  • notifiesarray of objects or nullOptional

    Who the policy notifies for a warning incident (and a critical one while critical_uses_warning is true) besides its all_… switches, a full replacement of the saved ones: each a user, an alarm channel (destination) or a contact group. A kind whose all_… switch is on needs none.

  • critical_uses_warningboolean or nullOptional

    Whether critical incidents use the same routing as warning ones. While true, critical is null.

  • criticalobjectOptional

    The routing for critical incidents, while critical_uses_warning is false.

Returns

201 Created:

The created alarm policy.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Update an alarm policy

PUT/v1/alarm-policies/{policy_uuid}

Changes the fields sent. What is not sent keeps its value. notifies, when sent, replaces the list of who the policy notifies: send the whole list, including the ones to keep. A critical object, when sent, replaces the whole Critical route; critical_uses_warning: true clears it.

Needs the scope policies.edit.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Path parameters

  • policy_uuidstring (uuid)Required

    The uuid of the alarm policy in the path.

Body parameters

  • namestring or nullOptional

    The policy’s name, up to 255 characters.

  • all_usersboolean or nullOptional

    Whether every user of the organisation is notified, by the channels of all_users_channels, for a warning incident (and a critical one while critical_uses_warning is true).

  • all_channelsboolean or nullOptional

    Whether every alarm channel of the organisation is notified for a warning incident (and a critical one while critical_uses_warning is true).

  • all_groupsboolean or nullOptional

    Whether every contact group of the organisation is notified for a warning incident (and a critical one while critical_uses_warning is true).

  • all_users_channelsarray of strings or nullOptional

    The ways every user is reached when all_users is on for a warning incident (and a critical one while critical_uses_warning is true): email, sms, whatsapp.

    Values:emailsmswhatsapp(an open set: new values may be added)
  • all_groups_channelsarray of strings or nullOptional

    The ways every group member is reached when all_groups is on for a warning incident (and a critical one while critical_uses_warning is true): email, sms, whatsapp.

    Values:emailsmswhatsapp(an open set: new values may be added)
  • notifiesarray of objects or nullOptional

    Who the policy notifies for a warning incident (and a critical one while critical_uses_warning is true) besides its all_… switches, a full replacement of the saved ones: each a user, an alarm channel (destination) or a contact group. A kind whose all_… switch is on needs none.

  • critical_uses_warningboolean or nullOptional

    Whether critical incidents use the same routing as warning ones. While true, critical is null.

  • criticalobjectOptional

    The routing for critical incidents, while critical_uses_warning is false.

Returns

200 OK:

The alarm policy after the update.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Get an alarm policy

GET/v1/alarm-policies/{policy_uuid}

Returns one alarm policy: who and which channels an alarm that uses it notifies, with its targets.

Needs the scope policies.view.

Path parameters

  • policy_uuidstring (uuid)Required

    The uuid of the alarm policy in the path.

Returns

200 OK:

The alarm policy.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

List alarm policies

GET/v1/alarm-policies

Returns the organisation’s alarm policies, with how many it notifies by name; read one policy for the list. Pages by page and per_page (limit is the same as per_page); every page carries current_page, per_page, last_page and total.

Needs the scope policies.view.

Query parameters

  • limitinteger or nullOptional

    The same as per_page, kept for existing clients.

  • include_totalstring or nullOptional

    Ignored: total is always present.

    Values:truefalse10(an open set: new values may be added)
  • per_pageinteger or nullOptional

    The page size, from 1 to 100.

  • pageinteger or nullOptional

    The page to read, from 1; 1 when omitted. A page past the last answers no rows.

Returns

200 OK:

One page of the organisation’s alarm policies.

Each item of the page:

  • uuidstring

    The policy’s uuid.

  • namestring

    The policy’s name.

  • defaultboolean

    Whether this is the organisation’s default policy, which cannot be deleted.

  • all_usersboolean

    Whether every user of the organisation is notified for a warning incident (and a critical one while critical_uses_warning is true).

  • all_channelsboolean

    Whether every alarm channel of the organisation is notified for a warning incident (and a critical one while critical_uses_warning is true).

  • all_groupsboolean

    Whether every contact group of the organisation is notified for a warning incident (and a critical one while critical_uses_warning is true).

  • notifies_countinteger

    How many users, alarm channels and contact groups the policy notifies by name for a warning incident (and for a critical one while critical_uses_warning is true).

  • critical_uses_warningboolean

    Whether critical incidents use the same routing as warning ones. While true, critical is null.

  • criticalobject or null

    The routing for critical incidents, while critical_uses_warning is false: the three switches and how many users, alarm channels and contact groups it notifies by name for a critical incident.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Delete an alarm policy

DELETE/v1/alarm-policies/{policy_uuid}

Deletes the policy. The default policy, and a policy an alarm rule or a report still uses, are refused. The answer has no body.

Needs the scope policies.delete.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Path parameters

  • policy_uuidstring (uuid)Required

    The uuid of the alarm policy in the path.

Returns

204 No Content:

The alarm policy was deleted; there is no body.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.