Skip to content

Teams

Teams own alerts and define how those alerts are routed: who is a member, how alerts escalate, and who is on call through rotations and overrides. Every account has a Default team whose id equals your account ID.

Keys with the Read Only role can call the GET endpoints. Keys with the Admin role can call all of them. The list endpoint is paginated, see Pagination.

NameTypeDescription
accountIdnumberThe account ID.
idnumberThe team ID.
namestringThe team name.
createdBystringWho created the team. Teams created with an API key show apikey:<keyId>.
timezonestringAn IANA time zone name, for example America/Chicago.
membersarray of stringsUsernames of the team’s members.
mutenumberMute expiry in epoch seconds, when the team is muted.
muteUserstringWho muted the team.
escalationsarrayEscalation steps. See below.
overridesarrayOn-call overrides. See below.
rotationsarrayOn-call rotations. See below.

escalations items:

NameTypeDescription
timenumberMinutes after the alert fires before this step runs. 1 to 1440.
typestringall, next, previous, random, team, or user.
valuestringA username when type is user, or a team ID when type is team. Not used for other types.

overrides items:

NameTypeDescription
usernamestringThe user who takes over on call.
startnumberStart of the override, in epoch seconds.
endnumberEnd of the override, in epoch seconds.

rotations items:

NameTypeDescription
namestringRotation name, 2 to 100 characters.
startnumberWhen the rotation starts, in epoch seconds.
typestringhourly, daily, or weekly.
lengthnumberLength of each shift in units of type. 1 to 23.
orderarray of stringsUsernames, in rotation order.
activePeriodarrayWhen the rotation is active. Each item has a start and end, given as half-hour offsets within the week, from 0 to 168.

GET /account/{accountId}/team

Required role
Admin or Read Only

Path parameters

NameTypeRequiredDescription
accountIdnumberYesYour account ID.

Query parameters

NameTypeRequiredDescription
limitnumberNoPage size. Defaults to 20. Any whole number from 1 to 100. Any other value is treated as 20.
idnumberNoPagination cursor. Pass the pk.id value from the previous response.

Response

Status 200.

NameTypeDescription
itemsarrayTeam objects, as described in The Team Object.
pkobjectPresent only when more results exist. Contains id, the cursor for the next page.

Errors

StatusWhen
400id is not numeric.

Notes

  • Teams are sorted by ID, lowest first. There is no order parameter.
  • A page can contain fewer than limit items while pk is still present. Keep requesting pages until pk is absent.

POST /account/{accountId}/team

Required role
Admin

Path parameters

NameTypeRequiredDescription
accountIdnumberYesYour account ID.

Request body

Send Content-Type: application/json.

NameTypeRequiredDescription
namestringYesTeam name, 1 to 100 characters. Default is not allowed.
timezonestringYesAn IANA time zone name.

Response

Status 200. Returns the new team, as described in The Team Object.

Errors

StatusWhen
400The time zone is invalid.
409The account has reached its maximum number of teams.

Notes

  • createdBy is set to apikey:<keyId>.
  • An audit log entry of type team-create is written with your API key as the actor.

GET /account/{accountId}/team/{teamId}

Required role
Admin or Read Only

Path parameters

NameTypeRequiredDescription
accountIdnumberYesYour account ID.
teamIdnumberYesThe team ID.

Response

Status 200. Returns the team, as described in The Team Object.

PATCH /account/{accountId}/team/{teamId}

Required role
Admin

Path parameters

NameTypeRequiredDescription
accountIdnumberYesYour account ID.
teamIdnumberYesThe team ID.

Request body

Send Content-Type: application/json. Include at least one field. Fields use the same shapes as in The Team Object.

NameTypeRequiredDescription
namestringNoNew team name.
timezonestringNoNew IANA time zone.
escalationsarrayNoReplaces all escalation steps.
overridesarrayNoReplaces all overrides.
rotationsarrayNoReplaces all rotations.

Response

Status 200 with an empty object.

Errors

StatusWhen
400You rename the Default team.
400The time zone is invalid.
400You set rotations, escalations, or overrides on a team with no members.
400A referenced user is not a member of the team.
400A rotation, escalation, or override breaks the rules listed in the notes.
404The team does not exist.
409An escalation refers to a team that does not exist.

Notes

  • Arrays replace the existing value. To add a single rotation, send the full list including the existing ones.
  • Escalation time values must not decrease from one step to the next. A user step needs a username and a team step needs a team ID.
  • Rotation active periods need start less than end and must not overlap.
  • Overrides need start less than end, must be sequential, and start must not be in the past.
  • The Default team cannot be renamed.

DELETE /account/{accountId}/team/{teamId}

Required role
Admin

Path parameters

NameTypeRequiredDescription
accountIdnumberYesYour account ID.
teamIdnumberYesThe team ID.

Response

Status 200 with an empty object.

Errors

StatusWhen
403The team is the Default team.
404The team does not exist.

Notes

  • The team is also removed from every user who belonged to it.
  • The Default team cannot be deleted.

POST /account/{accountId}/team/{teamId}/member

Required role
Admin

Path parameters

NameTypeRequiredDescription
accountIdnumberYesYour account ID.
teamIdnumberYesThe team ID.

Request body

Send Content-Type: application/json.

NameTypeRequiredDescription
usernamestringYesUsername of the user to add, 1 to 128 characters.

Response

Status 200 with an empty object.

Errors

StatusWhen
404The team or user does not exist.
409The user is already a member.

DELETE /account/{accountId}/team/{teamId}/member/{username}

Required role
Admin

Path parameters

NameTypeRequiredDescription
accountIdnumberYesYour account ID.
teamIdnumberYesThe team ID.
usernamestringYesUsername of the member, URL-encoded.

Response

Status 200 with an empty object.

Errors

StatusWhen
404The team or user does not exist.
409The user is not a member, or is still assigned to a rotation, escalation, or override on the team.

Notes

  • Remove the user from the team’s rotations, escalations, and overrides first by updating the team.