For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/es/api/latest/on-call/create-on-call-escalation-policy.md. A documentation index is available at /llms.txt.
Language
Datadog site
PRECAUCIÓNEste producto no es compatible con el sitio Datadog seleccionado. (US2-FED).

Crear política de escalación de On-Call

POSThttps://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-policies

Descripción general

Crear una nueva política de escalación de On-Call

This endpoint requires the on_call_write permission.

Argumentos

Cadenas de consulta

Nombre
Type
Descripción
include
string

Comma-separated list of included relationships to be returned. Allowed values: teams, steps, steps.targets.

Solicitud

Body Data (required)

Campo
Type
Descripción
data [required]
object

Representa una solicitud para crear una nueva política de escalación, incluidos los datos de política.

Respuesta

Created

Represents a complete escalation policy response, including policy data and optionally included related resources.

Campo
Type
Descripción
data
object

Represents the data for a single escalation policy, including its attributes, ID, relationships, and resource type.

included
[<oneOf>]

Provides any included related resources, such as steps or targets, returned with the policy.

Ejemplo de código

Create On-Call escalation policy returns "Created" response
# 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 POST "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "Example-On-Call",
      "resolve_page_on_policy_end": true,
      "retries": 2,
      "steps": [
        {
          "assignment": "default",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "string",
              "type": "users"
            },
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "config": {
                "schedule": {
                  "position": "previous"
                }
              },
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        },
        {
          "assignment": "round-robin",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        }
      ]
    },
    "relationships": {
      "teams": {
        "data": [
          {
            "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
            "type": "teams"
          }
        ]
      }
    },
    "type": "policies"
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "Example-On-Call",
      "resolve_page_on_policy_end": true,
      "retries": 2,
      "steps": [
        {
          "assignment": "default",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "string",
              "type": "users"
            },
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "config": {
                "schedule": {
                  "position": "previous"
                }
              },
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        },
        {
          "assignment": "round-robin",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        }
      ]
    },
    "relationships": {
      "teams": {
        "data": [
          {
            "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
            "type": "teams"
          }
        ]
      }
    },
    "type": "policies"
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "Example-On-Call",
      "resolve_page_on_policy_end": true,
      "retries": 2,
      "steps": [
        {
          "assignment": "default",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "string",
              "type": "users"
            },
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "config": {
                "schedule": {
                  "position": "previous"
                }
              },
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        },
        {
          "assignment": "round-robin",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        }
      ]
    },
    "relationships": {
      "teams": {
        "data": [
          {
            "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
            "type": "teams"
          }
        ]
      }
    },
    "type": "policies"
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "Example-On-Call",
      "resolve_page_on_policy_end": true,
      "retries": 2,
      "steps": [
        {
          "assignment": "default",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "string",
              "type": "users"
            },
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "config": {
                "schedule": {
                  "position": "previous"
                }
              },
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        },
        {
          "assignment": "round-robin",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        }
      ]
    },
    "relationships": {
      "teams": {
        "data": [
          {
            "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
            "type": "teams"
          }
        ]
      }
    },
    "type": "policies"
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "Example-On-Call",
      "resolve_page_on_policy_end": true,
      "retries": 2,
      "steps": [
        {
          "assignment": "default",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "string",
              "type": "users"
            },
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "config": {
                "schedule": {
                  "position": "previous"
                }
              },
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        },
        {
          "assignment": "round-robin",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        }
      ]
    },
    "relationships": {
      "teams": {
        "data": [
          {
            "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
            "type": "teams"
          }
        ]
      }
    },
    "type": "policies"
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "Example-On-Call",
      "resolve_page_on_policy_end": true,
      "retries": 2,
      "steps": [
        {
          "assignment": "default",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "string",
              "type": "users"
            },
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "config": {
                "schedule": {
                  "position": "previous"
                }
              },
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        },
        {
          "assignment": "round-robin",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        }
      ]
    },
    "relationships": {
      "teams": {
        "data": [
          {
            "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
            "type": "teams"
          }
        ]
      }
    },
    "type": "policies"
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "Example-On-Call",
      "resolve_page_on_policy_end": true,
      "retries": 2,
      "steps": [
        {
          "assignment": "default",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "string",
              "type": "users"
            },
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "config": {
                "schedule": {
                  "position": "previous"
                }
              },
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        },
        {
          "assignment": "round-robin",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        }
      ]
    },
    "relationships": {
      "teams": {
        "data": [
          {
            "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
            "type": "teams"
          }
        ]
      }
    },
    "type": "policies"
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "Example-On-Call",
      "resolve_page_on_policy_end": true,
      "retries": 2,
      "steps": [
        {
          "assignment": "default",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "string",
              "type": "users"
            },
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "config": {
                "schedule": {
                  "position": "previous"
                }
              },
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        },
        {
          "assignment": "round-robin",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        }
      ]
    },
    "relationships": {
      "teams": {
        "data": [
          {
            "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
            "type": "teams"
          }
        ]
      }
    },
    "type": "policies"
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/on-call/escalation-policies" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "Example-On-Call",
      "resolve_page_on_policy_end": true,
      "retries": 2,
      "steps": [
        {
          "assignment": "default",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "string",
              "type": "users"
            },
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "config": {
                "schedule": {
                  "position": "previous"
                }
              },
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "schedules"
            },
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        },
        {
          "assignment": "round-robin",
          "escalate_after_seconds": 3600,
          "targets": [
            {
              "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
              "type": "teams"
            }
          ]
        }
      ]
    },
    "relationships": {
      "teams": {
        "data": [
          {
            "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
            "type": "teams"
          }
        ]
      }
    },
    "type": "policies"
  }
}
EOF