# Pagerduty ## List PagerDuty services `alerting.destinations.pagerduty.get(PagerdutyGetParams**kwargs) -> SyncSinglePage[Pagerduty]` **get** `/accounts/{account_id}/alerting/v3/destinations/pagerduty` Get a list of all configured PagerDuty services. ### Parameters - `account_id: str` The account id ### Returns - `class Pagerduty: …` - `id: Optional[str]` UUID - `name: Optional[str]` The name of the pagerduty service. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.alerting.destinations.pagerduty.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.id) ``` #### 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 `alerting.destinations.pagerduty.create(PagerdutyCreateParams**kwargs) -> PagerdutyCreateResponse` **post** `/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect` Creates a new token for integrating with PagerDuty. ### Parameters - `account_id: str` The account id ### Returns - `class PagerdutyCreateResponse: …` - `id: Optional[str]` token in form of UUID ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) pagerduty = client.alerting.destinations.pagerduty.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(pagerduty.id) ``` #### Response ```json { "errors": [ { "message": "message", "code": 1000 } ], "messages": [ { "message": "message", "code": 1000 } ], "success": true, "result": { "id": "a313ba7d3e464c0ea40808fafbc3816a" } } ``` ## Delete PagerDuty Services `alerting.destinations.pagerduty.delete(PagerdutyDeleteParams**kwargs) -> PagerdutyDeleteResponse` **delete** `/accounts/{account_id}/alerting/v3/destinations/pagerduty` Deletes all the PagerDuty Services connected to the account. ### Parameters - `account_id: str` The account id ### Returns - `class PagerdutyDeleteResponse: …` - `errors: List[Error]` - `message: str` - `code: Optional[int]` - `messages: List[Message]` - `message: str` - `code: Optional[int]` - `success: Literal[true]` Whether the API call was successful - `true` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) pagerduty = client.alerting.destinations.pagerduty.delete( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(pagerduty.errors) ``` #### Response ```json { "errors": [ { "message": "message", "code": 1000 } ], "messages": [ { "message": "message", "code": 1000 } ], "success": true } ``` ## Connect PagerDuty `alerting.destinations.pagerduty.link(strtoken_id, PagerdutyLinkParams**kwargs) -> PagerdutyLinkResponse` **get** `/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect/{token_id}` Links PagerDuty with the account using the integration token. ### Parameters - `account_id: str` The account id - `token_id: str` The token integration key ### Returns - `class PagerdutyLinkResponse: …` - `id: Optional[str]` UUID ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.alerting.destinations.pagerduty.link( token_id="8c71e667571b4f61b94d9e4b12158038", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(response.id) ``` #### Response ```json { "errors": [ { "message": "message", "code": 1000 } ], "messages": [ { "message": "message", "code": 1000 } ], "success": true, "result": { "id": "f174e90afafe4643bbbc4a0ed4fc8415" } } ``` ## Domain Types ### Pagerduty - `class Pagerduty: …` - `id: Optional[str]` UUID - `name: Optional[str]` The name of the pagerduty service. ### Pagerduty Create Response - `class PagerdutyCreateResponse: …` - `id: Optional[str]` token in form of UUID ### Pagerduty Delete Response - `class PagerdutyDeleteResponse: …` - `errors: List[Error]` - `message: str` - `code: Optional[int]` - `messages: List[Message]` - `message: str` - `code: Optional[int]` - `success: Literal[true]` Whether the API call was successful - `true` ### Pagerduty Link Response - `class PagerdutyLinkResponse: …` - `id: Optional[str]` UUID