Email Intergration : Resolve via API

I have a simple email integration setup.

I want to be able to resolve the incident(s) via API , I have been referencing:

I have been unsuccessful in closing the incident via API ; In the python code it states I need a “SERVICE_KEY” , I know I can get this via Configuration > Services > Service Details > Integrations:

However, since this is an email integration there is no (32 char) “KEY” only the email that PD generates … which I cannot use to make the call .

How can I resolve incidents via API with this type of integration ? Is there a step I am missing to get a “SERVICE_KEY” for an email integration ?

Thanks for your time!

This particular script is actually using PagerDuty’s v1 events API, so you wouldn’t be able to use it for this.

If you’d like to use the REST API to resolve incidents, you would just need the incident ID. This ID will be the 7 alphanumeric characters beginning with P when viewing the incident in the web UI. You can also do a GET on your incidents to obtain these IDs.

Once you have the incident ID, you can send a PUT request at this endpoint to resolve it. Here is a sample cURL request:

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/vnd.pagerduty+json;version=2' --header 'From: person@example.invalid' --header 'Authorization: Token token=xxxxxxxxxxxxxxxx' -d '{
  "incident": {
    "type": "incident_reference",
    "status": "resolved"
}' ''

Email integrations also allow you to configure email filters and management rules so that you can resolve incidents via email.

Paul, thanks for the answer !,
I will go that route and give this a shot…

Have a good one !

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.