Skip to main content

Incidents

Updated over a week ago

DX docs are moving! Visit docs.getdx.com for all current and future help—this page will no longer be updated.

Incidents API methods allow capturing incident data from any data source. This offers a flexible solution in cases where DX does not offer a data connector, or custom logic is desired.

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 -X POST https://yourinstance.getdx.net/api/incidents.sync \
-H 'Accepts: application/json' \
-H 'Authorization: Bearer your_bearer_token_here' \
-H '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.

invalid_json

The JSON body of the request could not be parsed. This usually indicates a syntax error.

invalid_timestamp

The started_at or resolved_at format was not a readable ISO-8601 date format.

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?