API Reference

Incident Management API

An incident record is created automatically when a worker fails a job with no retries left. Use these endpoints to list, create, resolve and export incident records.

Overview· Workers· Incidents· Correlation IDs· Job Policies
Incident records and the INCIDENT state

INCIDENT is a process instance state: the engine sets it whenever a run fails and cannot move on (a job failed with no retries left, a decision that cannot be evaluated, a gateway condition that cannot be read, a timer error). An incident record, listed below, is created only for the first case, a job failed with retries of 0 or less. To find every failed run, including those with no record, use GET /api/v1/process-instances?filter.state=INCIDENT.

GET /api/v1/incidents List incident records

Returns every incident record of your account, open and resolved, in one response. There is no pagination and there are no filters: query parameters are ignored, and the order is not specified. An X-Correlation-ID request header is echoed back.

Incident fields

FieldTypeDescription
idstringinc- followed by 32 hex characters.
instance_keystringThe process instance key, e.g. run_1ce49bbc5260b39423bd.
process_keystringThe instance's processDefinitionKey.
element_idstringFor a record the engine created, the key of the failed job.
error_codestringJOB_FAILED for a record the engine created.
error_messagestringThe errorMessage the worker sent with its last fail call.
severitystringcritical, warning or info.
created_at, resolved_atstringRFC 3339 times; resolved_at only once resolved.
api_keystringYour own key, echoed in full. Do not forward these records to third parties as they are.

Optional fields appear when set: resolved_by, root_cause, post_mortem_url, tags, retry_count, alert_sent, correlation_id.

Example response 200 OK

{
  "items": [
    {
      "id": "inc-4f1c0a9b2d7e4e0c8a51b6f3d2c9e7a1",
      "api_key": "ps_your_key",
      "process_key": "3f9c2a7e5b1d8c4e6a02",
      "instance_key": "run_1ce49bbc5260b39423bd",
      "element_id": "a99f579d62ae71f8764f",
      "error_code": "JOB_FAILED",
      "error_message": "Stripe timeout after 3 retries",
      "severity": "critical",
      "created_at": "2026-09-29T09:05:00Z"
    }
  ],
  "total": 1,
  "open_count": 1
}
POST /api/v1/incidents Create an incident record

Records an incident of your own, for example one your worker detected. Answers 201 Created with the record.

Request body

FieldTypeDescription
instance_key, process_key, element_idstringWhat the incident is about.
error_code, error_messagestringYour own code and message.
severitystringcritical, warning (default) or info.
tagsarray of stringsOptional labels.
retry_countintegerOptional.
PATCH /api/v1/incidents/{id} Resolve an incident record

Marks the record resolved. It does not touch the process instance, which stays in INCIDENT. A JSON body is required; {} is enough.

Request body

FieldTypeDescription
resolved_bystringWho resolved it. Defaults to your key.
root_causestringOptional note.
post_mortem_urlstringOptional link.

Example response 200 OK

{ "id": "inc-4f1c0a9b2d7e4e0c8a51b6f3d2c9e7a1", "status": "resolved" }

An unknown id (or another account's) answers 404; a record already resolved answers 422.

POST /api/v1/incidents/bulk-resolve Resolve several records

Body {"ids": ["inc-...", "inc-..."], "resolved_by": "..."}. Answers {"resolved": 2, "status": "ok"}.

GET /api/v1/incidents/export Export records as CSV

Returns every record of your account as text/csv, without the api_key column.

Retrying failed work

Retries are decided when the worker fails the job: POST /api/v1/jobs/{key}/fail with retries above 0 puts the job back in the queue at once, and 0 or less raises the incident. Once an instance is in INCIDENT, no REST route resumes or cancels it today, and there is no route to change a job's retries. Resolving the record closes the record only.

Alerting on incidents

No webhook event is fired for incidents (see the event list). To alert on them, poll GET /api/v1/incidents and watch open_count, or poll GET /api/v1/process-instances?filter.state=INCIDENT.

See also:   Worker API · Job policies & retry configuration · Troubleshooting guide