Get url to incident created by Event-v2 API call

I’m using the Events V2 API to create a new incident using a unique dedup_key. I would like a URL to the incident created by this event. However, the response doesn’t give me much to work with, only status, message, and the same dedup_key I sent to the API.

Is there a predictable URL I can use to find incidents by dedup_key?

I realize I can link to https://{subdomain}{incident_id_or_number} but I don’t have an incident_id. Can I use an event dedup_key to look up the incident_id?

My use case is that several similar events should be grouped together by dedup_key, which sounds like exactly what I think the events API is designed for. So I think there MUST be some way to look up the incident by event, somehow.

Any tips, suggestions, or questions are welcome.

Hi @LeviWillmeth,

If you need to get the ID of the incident that is triggered in this scenario, you can use our REST API. You can do this by appending the incident key from the response to the request URI of the GET incidents endpoint. Here is a sample curl request:

curl -X GET --header 'Accept: application/vnd.pagerduty+json;version=2' --header 'Authorization: Token token=xxxxxxxxxxxxxxxx' ''

If you don’t have a REST API key for your account, note that the account owner and admin users on your account can generate REST API keys.

Hi Paul, thanks for the quick response. Maybe I’m missing something, but it looks like GET /incidents can take an incident_key, but not an event dedup_key? Here’s what I’m seeing:

incident_key Incident de-duplication key. Incidents with child alerts do not have an incident key; querying by incident key will return incidents whose alerts have alert_key matching the given incident key.

Does the dedup_key from an event match the alert_key?

Hi Levi,

When using Events v1 the payload schema will refer to this as the incident_key. In Events V2, this is known as the dedup_key, which is also sometimes referred to in the Web UI as the alert key.

You should still be able to use this endpoint entering the dedup_key as the incident_key. This will just return all the incidents whose associated alerts have that key.

Hope this helps!

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