Create an outgoing PagerDuty integration

Create a PagerDuty integration. Incidents are forwarded to the PagerDuty service the integration key belongs to.

POST https://incidents.betterstack.com/api/v3/outgoing-pagerduty-integrations
team_id string

Team to use, such as t123. Get the ID via List teams. Required when you can access more than one team.

Authorization string required

Bearer $TOKEN

Content-Type string

application/json

name string required

Integration name.

key string required

PagerDuty integration key, also called the routing key.

severity string required

PagerDuty severity sent with the event. Possible values: info, warning, error, critical.

notify_alongside_primary_responder boolean default: true

Whether to notify this PagerDuty integration alongside the primary responder for incidents with no escalation policy. For an incident with an escalation policy, it's notified only when a step of that policy notifies it.

201

Returns the newly created outgoing PagerDuty integration.

201 Created
{
  "data": {
    "id": "123456789",
    "type": "pagerduty_integration",
    "attributes": {
      "name": "Production on-call",
      "key": "e93facc04764012d7bfb002500d5d1a6",
      "severity": "critical",
      "notify_alongside_primary_responder": true,
      "team_id": "t123",
      "team_name": "Production"
    }
  }
}
401

The API token is missing or invalid.

401 Unauthorized
{
  "errors": "Invalid Team API token. How to find your Team API token: https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#get-an-incidents-api-token"
}
403

The token is read-only, your role doesn't include Manage on Monitors, heartbeats, integrations, or the token can't be used for this API. The plan doesn't include PagerDuty integrations.

403 Forbidden
{
  "errors": "This API token is read-only and cannot be used for write operations."
}
422

Validation failed, such as a missing or invalid name, key or severity, or an attribute is unknown.

id string

The ID of the outgoing PagerDuty integration.

type string

Always pagerduty_integration.

name string

Integration name.

key string

PagerDuty integration key, also called the routing key.

severity string

PagerDuty severity sent with the event. Possible values: info, warning, error, critical.

notify_alongside_primary_responder boolean

Whether to notify this PagerDuty integration alongside the primary responder for incidents with no escalation policy. For an incident with an escalation policy, it's notified only when a step of that policy notifies it.

team_id string

Team that owns this integration, such as t123.

team_name string

Name of the team that owns this integration.

Example cURL

Send as critical Only when a policy notifies it
curl --request POST \
  --url https://incidents.betterstack.com/api/v3/outgoing-pagerduty-integrations \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "name": "Production on-call",
  "key": "e93facc04764012d7bfb002500d5d1a6",
  "severity": "critical"
}'
curl --request POST \
  --url https://incidents.betterstack.com/api/v3/outgoing-pagerduty-integrations \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "name": "Staging alerts",
  "key": "a1b2c3d4e5f60718293a4b5c6d7e8f90",
  "severity": "warning",
  "notify_alongside_primary_responder": false
}'