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_warningis true). - all_channelsboolean
Whether every alarm channel of the organisation is notified for a warning incident (and a critical one while
critical_uses_warningis true). - all_groupsboolean
Whether every contact group of the organisation is notified for a warning incident (and a critical one while
critical_uses_warningis true). - all_users_channelsarray of strings
The ways every user is reached when
all_usersis on for a warning incident (and a critical one whilecritical_uses_warningis true). - all_groups_channelsarray of strings
The ways every group member is reached when
all_groupsis on for a warning incident (and a critical one whilecritical_uses_warningis true). - notifiesarray of objects
Who the policy notifies for a warning incident, and for a critical one while
critical_uses_warningis true.- target_typestring
What the target is:
user,destination(an alarm channel) orcontact_group. - target_uuidstring or null
The target’s uuid; null if the record is gone.
- labelstring or null
The target’s name; null if the record is gone.
- channelsarray of strings
For a user, the ways the user is reached; for a destination, its type; empty for a group.
- critical_uses_warningboolean
Whether critical incidents use the same routing as warning ones. While true,
criticalis null. - criticalobject or null
The routing for critical incidents, while
critical_uses_warningis false.- all_usersboolean
Whether every user of the organisation is notified for a critical incident.
- all_channelsboolean
Whether every alarm channel of the organisation is notified for a critical incident.
- all_groupsboolean
Whether every contact group of the organisation is notified for a critical incident.
- all_users_channelsarray of strings
The ways every user is reached for a critical incident when
critical.all_usersis on. - all_groups_channelsarray of strings
The ways every group member is reached for a critical incident when
critical.all_groupsis on. - notifiesarray of objects
Who the policy notifies for a critical incident besides its
critical.all_…switches.- target_typestring
What the target is:
user,destination(an alarm channel) orcontact_group. - target_uuidstring or null
The target’s uuid; null if the record is gone.
- labelstring or null
The target’s name; null if the record is gone.
- channelsarray of strings
For a user, the ways the user is reached; for a destination, its type; empty for a group.
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 422invalid_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 whilecritical_uses_warningis 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_warningis 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_warningis true). - all_users_channelsarray of strings or nullOptional
The ways every user is reached when
all_usersis on for a warning incident (and a critical one whilecritical_uses_warningis 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_groupsis on for a warning incident (and a critical one whilecritical_uses_warningis 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_warningis true) besides itsall_…switches, a full replacement of the saved ones: each a user, an alarm channel (destination) or a contact group. A kind whoseall_…switch is on needs none.- target_typestringOptional
What the target is:
user,destination(an alarm channel) orcontact_group.Values:userdestinationcontact_group(an open set: new values may be added) - target_uuidstring (uuid)Optional
The target’s uuid, in this organisation.
- channelsarray of strings or nullOptional
For a user target, the ways the user is reached:
email,sms,whatsapp; email when none is given.Values:emailsmswhatsapp(an open set: new values may be added)
- critical_uses_warningboolean or nullOptional
Whether critical incidents use the same routing as warning ones. While true,
criticalis null. - criticalobjectOptional
The routing for critical incidents, while
critical_uses_warningis false.- all_usersboolean or nullOptional
Whether every user of the organisation is notified for a critical incident, by the channels of
critical.all_users_channels. - all_channelsboolean or nullOptional
Whether every alarm channel of the organisation is notified for a critical incident.
- all_groupsboolean or nullOptional
Whether every contact group of the organisation is notified for a critical incident.
- all_users_channelsarray of strings or nullOptional
The ways every user is reached for a critical incident when
critical.all_usersis on: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 for a critical incident when
critical.all_groupsis on:email,sms,whatsapp.Values:emailsmswhatsapp(an open set: new values may be added) - notifiesarray of objects or nullOptional
Who the policy notifies for a critical incident besides its
critical.all_…switches, a full replacement of the saved ones: each a user, an alarm channel (destination) or a contact group.- target_typestringOptional
What the target is:
user,destination(an alarm channel) orcontact_group.Values:userdestinationcontact_group(an open set: new values may be added) - target_uuidstring (uuid)Optional
The target’s uuid, in this organisation.
- channelsarray of strings or nullOptional
For a user target, the ways the user is reached:
email,sms,whatsapp; email when none is given.Values:emailsmswhatsapp(an open set: new values may be added)
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 422invalid_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 whilecritical_uses_warningis 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_warningis 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_warningis true). - all_users_channelsarray of strings or nullOptional
The ways every user is reached when
all_usersis on for a warning incident (and a critical one whilecritical_uses_warningis 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_groupsis on for a warning incident (and a critical one whilecritical_uses_warningis 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_warningis true) besides itsall_…switches, a full replacement of the saved ones: each a user, an alarm channel (destination) or a contact group. A kind whoseall_…switch is on needs none.- target_typestringOptional
What the target is:
user,destination(an alarm channel) orcontact_group.Values:userdestinationcontact_group(an open set: new values may be added) - target_uuidstring (uuid)Optional
The target’s uuid, in this organisation.
- channelsarray of strings or nullOptional
For a user target, the ways the user is reached:
email,sms,whatsapp; email when none is given.Values:emailsmswhatsapp(an open set: new values may be added)
- critical_uses_warningboolean or nullOptional
Whether critical incidents use the same routing as warning ones. While true,
criticalis null. - criticalobjectOptional
The routing for critical incidents, while
critical_uses_warningis false.- all_usersboolean or nullOptional
Whether every user of the organisation is notified for a critical incident, by the channels of
critical.all_users_channels. - all_channelsboolean or nullOptional
Whether every alarm channel of the organisation is notified for a critical incident.
- all_groupsboolean or nullOptional
Whether every contact group of the organisation is notified for a critical incident.
- all_users_channelsarray of strings or nullOptional
The ways every user is reached for a critical incident when
critical.all_usersis on: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 for a critical incident when
critical.all_groupsis on:email,sms,whatsapp.Values:emailsmswhatsapp(an open set: new values may be added) - notifiesarray of objects or nullOptional
Who the policy notifies for a critical incident besides its
critical.all_…switches, a full replacement of the saved ones: each a user, an alarm channel (destination) or a contact group.- target_typestringOptional
What the target is:
user,destination(an alarm channel) orcontact_group.Values:userdestinationcontact_group(an open set: new values may be added) - target_uuidstring (uuid)Optional
The target’s uuid, in this organisation.
- channelsarray of strings or nullOptional
For a user target, the ways the user is reached:
email,sms,whatsapp; email when none is given.Values:emailsmswhatsapp(an open set: new values may be added)
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:
totalis 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_warningis true). - all_channelsboolean
Whether every alarm channel of the organisation is notified for a warning incident (and a critical one while
critical_uses_warningis true). - all_groupsboolean
Whether every contact group of the organisation is notified for a warning incident (and a critical one while
critical_uses_warningis 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_warningis true). - critical_uses_warningboolean
Whether critical incidents use the same routing as warning ones. While true,
criticalis null. - criticalobject or null
The routing for critical incidents, while
critical_uses_warningis false: the three switches and how many users, alarm channels and contact groups it notifies by name for a critical incident.- all_usersboolean
Whether every user of the organisation is notified for a critical incident.
- all_channelsboolean
Whether every alarm channel of the organisation is notified for a critical incident.
- all_groupsboolean
Whether every contact group of the organisation is notified for a critical incident.
- notifies_countinteger
How many users, alarm channels and contact groups the policy 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 422invalid_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.