For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/api/latest/pagerduty-integration/create-a-new-service-object.md. A documentation index is available at /llms.txt.
Language
Datadog site

Create a new service object

POSThttps://api.datadoghq.com/api/v1/integration/pagerduty/configuration/serviceshttps://api.us3.datadoghq.com/api/v1/integration/pagerduty/configuration/serviceshttps://api.us5.datadoghq.com/api/v1/integration/pagerduty/configuration/serviceshttps://api.datadoghq.eu/api/v1/integration/pagerduty/configuration/serviceshttps://api.ap1.datadoghq.com/api/v1/integration/pagerduty/configuration/serviceshttps://api.ap2.datadoghq.com/api/v1/integration/pagerduty/configuration/serviceshttps://api.uk1.datadoghq.com/api/v1/integration/pagerduty/configuration/serviceshttps://api.ddog-gov.com/api/v1/integration/pagerduty/configuration/serviceshttps://api.us2.ddog-gov.com/api/v1/integration/pagerduty/configuration/services

Overview

Create a new service object in the PagerDuty integration.

This endpoint requires the manage_integrations permission.

Request

Body Data (required)

Create a new service object request body.

Field
Type
Description
service_key [required]
string

Your service key in PagerDuty.

service_name [required]
string

Your service name associated with a service key in PagerDuty.

Response

OK

PagerDuty service object name.

Field
Type
Description
service_name [required]
string

Your service name associated service key in PagerDuty.

Code Example

Create a new service object
# 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/v1/integration/pagerduty/configuration/services" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "service_key": "your-pagerduty-service-key",
  "service_name": "my-pagerduty-service"
}
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/v1/integration/pagerduty/configuration/services" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "service_key": "your-pagerduty-service-key",
  "service_name": "my-pagerduty-service"
}
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/v1/integration/pagerduty/configuration/services" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "service_key": "your-pagerduty-service-key",
  "service_name": "my-pagerduty-service"
}
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/v1/integration/pagerduty/configuration/services" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "service_key": "your-pagerduty-service-key",
  "service_name": "my-pagerduty-service"
}
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/v1/integration/pagerduty/configuration/services" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "service_key": "your-pagerduty-service-key",
  "service_name": "my-pagerduty-service"
}
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/v1/integration/pagerduty/configuration/services" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "service_key": "your-pagerduty-service-key",
  "service_name": "my-pagerduty-service"
}
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/v1/integration/pagerduty/configuration/services" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "service_key": "your-pagerduty-service-key",
  "service_name": "my-pagerduty-service"
}
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/v1/integration/pagerduty/configuration/services" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "service_key": "your-pagerduty-service-key",
  "service_name": "my-pagerduty-service"
}
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/v1/integration/pagerduty/configuration/services" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "service_key": "your-pagerduty-service-key",
  "service_name": "my-pagerduty-service"
}
EOF