Skip to main content
Incidents API
Updated over a week ago

Overview

The Incidents API enables capturing incident data from any data source.

API methods

incidents.sync

Sync an incident with DX.

Required arguments

Name

Description

reference_id

string - Unique identifier for the incident to support idempotent updates.

Example:

36b1f37a-e60f-4ccd-b0c4-878a6d1175fe

started_at

string - ISO-8601 timestamp when the incident started.

Example:

2024-01-01T11:22:33

services

array of strings - Array of service names that are related to this incident.
​
Example:
​["app", "auth", "payments"]

Optional arguments

Name

Description

name

string - The name of the incident.

Example:

Invalid argument broke settings page

priority

string - Priority assigned to the incident.

Example:

p1

source_url

string - URL to the incident in your incident management system.

Example:

https://app.opsgenie.com/incidents/123

resolved_at

string - ISO-8601 timestamp when the incident was resolved.

Example:

2024-01-01T11:22:33

metadata

JSON Object - You may pass a metadata object with additional data about your deployment that you define.

{ "version": "v1.11.23" }


​

Example

 curl --request POST \
--url 'https://yourinstance.getdx.net/api/incidents.sync' \
--header 'Accepts: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"reference_id": "36b1f37a-e60f-4ccd-b0c4-878a6d1175fe",
"name": "Invalid argument broke settings page",
"priority": "p1",
"source_url": "https://app.opsgenie.com/incidents/123",
"services" : ["payments-api"],
"started_at": "2024-01-01T11:22:33",
"resolved_at": null
}'

Error codes

Error Code

Description

not_authed

This error occurs if the API request does not include a valid API key for authentication.

invalid_arguments

The provided arguments are invalid. Ensure you're passing a reference_id.

metadata_invalid

The metadata was not able to be processed. Metadata must be an object and keys may include letters, numbers, dashes and underscores.

Did this answer your question?