# Pagerduty ## List PagerDuty services **get** `/accounts/{account_id}/alerting/v3/destinations/pagerduty` Get a list of all configured PagerDuty services. ### Path Parameters - `account_id: string` The account id ### Returns - `errors: array of object { message, code }` - `message: string` - `code: optional number` - `messages: array of object { message, code }` - `message: string` - `code: optional number` - `success: true` Whether the API call was successful - `true` - `result: optional array of Pagerduty` - `id: optional string` UUID - `name: optional string` The name of the pagerduty service. ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/alerting/v3/destinations/pagerduty \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "errors": [ { "message": "message", "code": 1000 } ], "messages": [ { "message": "message", "code": 1000 } ], "success": true, "result": [ { "id": "f174e90afafe4643bbbc4a0ed4fc8415", "name": "My PagerDuty Service" } ] } ``` ## Create PagerDuty integration token **post** `/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect` Creates a new token for integrating with PagerDuty. ### Path Parameters - `account_id: string` The account id ### Returns - `errors: array of object { message, code }` - `message: string` - `code: optional number` - `messages: array of object { message, code }` - `message: string` - `code: optional number` - `success: true` Whether the API call was successful - `true` - `result: optional object { id }` - `id: optional string` token in form of UUID ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/alerting/v3/destinations/pagerduty/connect \ -X POST \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "errors": [ { "message": "message", "code": 1000 } ], "messages": [ { "message": "message", "code": 1000 } ], "success": true, "result": { "id": "a313ba7d3e464c0ea40808fafbc3816a" } } ``` ## Delete PagerDuty Services **delete** `/accounts/{account_id}/alerting/v3/destinations/pagerduty` Deletes all the PagerDuty Services connected to the account. ### Path Parameters - `account_id: string` The account id ### Returns - `errors: array of object { message, code }` - `message: string` - `code: optional number` - `messages: array of object { message, code }` - `message: string` - `code: optional number` - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/alerting/v3/destinations/pagerduty \ -X DELETE \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "errors": [ { "message": "message", "code": 1000 } ], "messages": [ { "message": "message", "code": 1000 } ], "success": true } ``` ## Connect PagerDuty **get** `/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect/{token_id}` Links PagerDuty with the account using the integration token. ### Path Parameters - `account_id: string` The account id - `token_id: string` The token integration key ### Returns - `errors: array of object { message, code }` - `message: string` - `code: optional number` - `messages: array of object { message, code }` - `message: string` - `code: optional number` - `success: true` Whether the API call was successful - `true` - `result: optional object { id }` - `id: optional string` UUID ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/alerting/v3/destinations/pagerduty/connect/$TOKEN_ID \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "errors": [ { "message": "message", "code": 1000 } ], "messages": [ { "message": "message", "code": 1000 } ], "success": true, "result": { "id": "f174e90afafe4643bbbc4a0ed4fc8415" } } ``` ## Domain Types ### Pagerduty - `Pagerduty object { id, name }` - `id: optional string` UUID - `name: optional string` The name of the pagerduty service. ### Pagerduty Create Response - `PagerdutyCreateResponse object { id }` - `id: optional string` token in form of UUID ### Pagerduty Delete Response - `PagerdutyDeleteResponse object { errors, messages, success }` - `errors: array of object { message, code }` - `message: string` - `code: optional number` - `messages: array of object { message, code }` - `message: string` - `code: optional number` - `success: true` Whether the API call was successful - `true` ### Pagerduty Link Response - `PagerdutyLinkResponse object { id }` - `id: optional string` UUID