Table of Contents
Incident API – Configure Incident Detection for DORA Metrics
Configure the LinearB Incident API to ingest incidents from your incident management tools. This article explains setup, supported workflows, and best practices for ensuring incidents are accurately reflected in DORA metrics such as Change Failure Rate and MTTR.
The Incident API lets you report production incidents to LinearB from any incident-management system (or custom workflow). Incidents reported via the API feed DORA metrics such as Change Failure Rate (CFR) and Mean Time to Recovery (MTTR).
Summary
- Enable Incident API detection under Company Settings → Project Management → Incidents.
- Create incidents with a POST request and keep them updated via PATCH.
- Retrieve or delete incidents using GET and DELETE endpoints.
- View reported incidents in Metrics → Git Activity → Incidents and in DORA widgets.
- Optionally override incident detection per team.
Step 1 — Enable Incident API detection
- Generate a LinearB API token .
- Go to Company Settings → Project Management, and open the Incidents tab.
- In Incidents Detection, select API Integration.
- Click Save.
Step 2 — Start sending incident data
After the integration is enabled, you can begin sending incident data to the Incident API. The examples below show the most common operations.
Create an incident
To create a new incident, include at least the following fields:
-
provider_id
A unique identifier from your incident system (used to map the incident in LinearB). -
http_url
A link to the incident in the external system (for quick navigation). -
title
The incident title. For clarity, use the same title as the external provider. -
issued_at
The creation timestamp in ISO 8601 format.
Example
curl -X POST "https://public-api.linearb.io/api/v1/incidents" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider_id": "B1BUOEOBKNAHKG",
"http_url": "https://acme.pagerduty.com/incidents/B1BUOEOBKNAHKG",
"title": "[#1] My First Incident",
"issued_at": "2024-01-25T17:18:36Z"
}'
For the full list of required and optional fields, see the API reference documentation .
Retrieve an incident
To retrieve an incident, send a GET request using its provider_id.
Example
curl -X GET "https://public-api.linearb.io/api/v1/incidents/PROVIDER_ID" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Update an incident
Keep incidents up to date by patching timestamps for when work starts and ends. Use ISO 8601 timestamps.
Mark an incident as started
curl -X PATCH "https://public-api.linearb.io/api/v1/incidents/PROVIDER_ID" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"started_at": "2024-01-27T17:18:36Z"
}'
Mark an incident as finished
curl -X PATCH "https://public-api.linearb.io/api/v1/incidents/PROVIDER_ID" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ended_at": "2024-01-27T17:18:36Z"
}'
Delete an incident
To delete an incident, send a DELETE request using its provider_id.
Example
curl -X DELETE "https://public-api.linearb.io/api/v1/incidents/PROVIDER_ID" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Notes
- Replace
YOUR_API_KEYwith your LinearB API key. - Replace
PROVIDER_IDwith the identifier from your incident system. - Use ISO 8601 timestamps (for example,
YYYY-MM-DDTHH:MM:SSZ).
Best practices
-
Keep incidents current: update
started_atandended_atso CFR/MTTR reflects reality. - Report incidents retroactively: if a ticket is created after resolution, you can still submit the incident with accurate timestamps.
Viewing incident data in LinearB
Incidents page
- Go to Metrics → Git Activity → Incidents.
- Use filters to focus on relevant incidents.
Metrics dashboard
- API-reported incidents appear in the CFR and MTTR widgets on the Metrics dashboard.
- Click a date in the chart to drill down into the corresponding incident details.
Configuring Incident API detection for a specific team
If a team needs a different incident detection method than the organization default, you can override incident detection at the team level (for example, the org uses a PM tool, but a specific team uses the Incident API).
- In the LinearB side menu, click Settings → Company Settings.
- Select the team that requires a different incident detection method.
- Open Team Settings → Project Management → Incidents.
- Select API Integration.
- Click Save.
- Report incidents using the Incident API as described above.
How did we do?
How LinearB Detects Releases for DORA Metrics
Mean Time to Restore (MTTR): Definition and Calculation