List On-Call escalation policies
https://api.datadoghq.com/api/v2/on-call/escalation-policieshttps://api.us3.datadoghq.com/api/v2/on-call/escalation-policieshttps://api.us5.datadoghq.com/api/v2/on-call/escalation-policieshttps://api.datadoghq.eu/api/v2/on-call/escalation-policieshttps://api.ap1.datadoghq.com/api/v2/on-call/escalation-policieshttps://api.ap2.datadoghq.com/api/v2/on-call/escalation-policieshttps://api.uk1.datadoghq.com/api/v2/on-call/escalation-policieshttps://api.ddog-gov.com/api/v2/on-call/escalation-policieshttps://api.us2.ddog-gov.com/api/v2/on-call/escalation-policiesDescripción general
Retrieve a paginated list of On-Call escalation policies, sorted by name.
Argumentos
Cadenas de consulta
page[size]Number of escalation policies to return per page. The maximum allowed value is 50.
20page[number]Specific page number to return.
0filter[query]Search query to filter escalation policies. Supports free-text search on the policy name (case-insensitive) and structured filters on team.id and tags. When set, filter[team_id], filter[user_id], and filter[schedule_id] are ignored. Can't be combined with filter[tags] or filter[tags_any].
filter[team_id]Comma-separated list of team IDs. Returns escalation policies that belong to any of these teams or have a step targeting any of them.
filter[user_id]Comma-separated list of user IDs. Returns escalation policies with a step targeting any of these users.
filter[schedule_id]Comma-separated list of schedule IDs. Returns escalation policies with a step targeting any of these schedules.
filter[tags]Comma-separated list of key:value tags. Returns escalation policies that have all of these tags.
filter[tags_any]Comma-separated list of key:value tags. Returns escalation policies that have at least one of these tags.
includeComma-separated list of included relationships to be returned. Allowed values: teams, steps, steps.targets, steps.targets.schedule, user.color. user.color populates the color attribute of users included through steps.targets.
Respuesta
OK
A paginated list of escalation policies, with any related resources requested through include.
data [required]A list of escalation policies.
attributesDefines the main attributes of an escalation policy, such as its name and behavior on policy end.
name [required]Specifies the name of the escalation policy.
resolve_page_on_policy_endIndicates whether the page is automatically resolved when the policy ends.
retriesSpecifies how many times the escalation sequence is retried if there is no response.
tagsA list of tags attached to the escalation policy, in key:value format.
id [required]Specifies the unique identifier of the escalation policy.
relationshipsRepresents the relationships for an escalation policy, including references to steps and teams.
steps [required]Defines the relationship to a collection of steps within an escalation policy. Contains an array of step data references.
dataAn array of references to the steps defined in this escalation policy.
id [required]Specifies the unique identifier for the step resource.
type [required]Indicates that the resource is of type steps.
stepsstepsteamsAssociates teams with this schedule in a data structure.
dataAn array of team references for this schedule.
id [required]The unique identifier of the team in this relationship.
type [required]Teams resource type.
teamsteamstype [required]Indicates that the resource is of type policies.
policiespoliciesincludedProvides any included related resources, such as teams, steps, or targets, returned with the policies.
<type=steps>Represents a single step in an escalation policy, including its attributes, relationships, and resource type.
attributesDefines attributes for an escalation policy step, such as assignment strategy and escalation timeout.
assignmentSpecifies how this escalation step will assign targets (example default or round-robin).
default, round-robinescalate_after_secondsSpecifies how many seconds to wait before escalating to the next step.
idSpecifies the unique identifier of this escalation policy step.
relationshipsRepresents the relationship of an escalation policy step to its targets.
targetsA list of escalation targets for a step
dataThe EscalationTargets data.
<type=teams>Represents a team target for an escalation policy step, including the team's ID and resource type.
id [required]Specifies the unique identifier of the team resource.
type [required]Indicates that the resource is of type teams.
teamsteams<type=users>Represents a user target for an escalation policy step, including the user's ID and resource type.
id [required]Specifies the unique identifier of the user resource.
type [required]Indicates that the resource is of type users.
usersusers<type=schedules>Represents a schedule target for an escalation policy step, including its ID and resource type. This is a shortcut for a configured schedule target with position set to 'current'.
id [required]Specifies the unique identifier of the schedule resource.
type [required]Indicates that the resource is of type schedules.
schedulesschedules<type=schedule_target>Relationship reference to a configured schedule target.
id [required]Specifies the unique identifier of the configured schedule target.
type [required]Indicates that the resource is of type schedule_target.
schedule_targetschedule_targettype [required]Indicates that the resource is of type steps.
stepssteps<type=users>Represents a user object in the context of an escalation policy, including their id, type, and basic attributes.
attributesProvides basic user information for an escalation policy, including a name and email address.
colorThe user's on-call color, as a hex code (for example, #FF0000). Included only when user.color is requested in the include parameter.
emailThe user's email address.
nameThe user's name.
statusThe user's status.
active, deactivated, pendingidThe unique user identifier.
type [required]Users resource type.
usersusers<type=schedules>Represents the primary data object for a schedule, linking attributes and relationships.
attributesProvides core properties of a schedule object such as its name and time zone.
max_respondersMaximum number of users who can be on call at the same time. The value is between 1 and the number of layers, and no greater than 10.
nameA short name for the schedule.
tagsA list of tags associated with the schedule.
time_zoneThe time zone in which this schedule operates.
idThe schedule's unique identifier.
relationshipsGroups the relationships for a schedule object, referencing layers and teams.
layersAssociates layers with this schedule in a data structure.
dataAn array of layer references for this schedule.
id [required]The unique identifier of the layer in this relationship.
type [required]Layers resource type.
layerslayersteamsAssociates teams with this schedule in a data structure.
dataAn array of team references for this schedule.
id [required]The unique identifier of the team in this relationship.
type [required]Teams resource type.
teamsteamstype [required]Schedules resource type.
schedulesschedules<type=schedule_target>Full resource representation of a configured schedule target with position (previous, current, or next).
attributes [required]Attributes for a configured schedule target, including position.
position [required]Specifies the position of a schedule target (example previous, current, or next).
previous, current, nextid [required]Specifies the unique identifier of the configured schedule target.
relationships [required]Represents the relationships of a configured schedule target.
schedule [required]Holds the schedule reference for a configured schedule target.
data [required]Represents a schedule target for an escalation policy step, including its ID and resource type. This is a shortcut for a configured schedule target with position set to 'current'.
id [required]Specifies the unique identifier of the schedule resource.
type [required]Indicates that the resource is of type schedules.
schedulesschedulestype [required]Indicates that the resource is of type schedule_target.
schedule_targetschedule_target<type=teams>Provides a reference to a team, including ID, type, and basic attributes/relationships.
attributesEncapsulates the basic attributes of a Team reference, such as name, handle, and an optional avatar or description.
avatarURL or reference for the team's avatar (if available).
descriptionA short text describing the team.
handleA unique handle/slug for the team.
nameThe full, human-readable name of the team.
idThe team's unique identifier.
type [required]Teams resource type.
teamsteamsmetaMetadata included in the response when listing escalation policies.
pagePagination metadata included in the response when listing escalation policies.
first_numberFirst page number.
last_numberLast page number.
next_numberNext page number.
numberPage number.
prev_numberPrevious page number.
sizePage size.
totalTotal number of results.
typePagination type.
{
"data": [
{
"attributes": {
"name": "On-Call Escalation Policy",
"resolve_page_on_policy_end": false,
"retries": "integer",
"tags": [
"env:prod"
]
},
"id": "ab000000-0000-0000-0000-000000000000",
"relationships": {
"steps": {
"data": [
{
"id": "00000000-aba1-0000-0000-000000000000",
"type": "steps"
}
]
},
"teams": {
"data": [
{
"id": "00000000-da3a-0000-0000-000000000000",
"type": "teams"
}
]
}
},
"type": "policies"
}
],
"included": [
{
"attributes": {
"assignment": "string",
"escalate_after_seconds": "integer"
},
"id": "string",
"relationships": {
"targets": {
"data": [
{
"id": "00000000-aba1-0000-0000-000000000000",
"type": "teams"
}
]
}
},
"type": "steps"
}
],
"meta": {
"page": {
"first_number": "integer",
"last_number": "integer",
"next_number": "integer",
"number": "integer",
"prev_number": "integer",
"size": "integer",
"total": "integer",
"type": "number_size"
}
}
}Bad Request
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Unauthorized
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Forbidden
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Ejemplo de código
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"