Skip to main content
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.

Steven Silverstone
Updated by Steven Silverstone

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).

Admin permissions are required to enable Incident API detection at the company level. Team-level overrides require access to the relevant team settings.

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
  1. Generate a LinearB API token .
  2. Go to Company Settings → Project Management, and open the Incidents tab.
  3. In Incidents Detection, select API Integration.
  4. 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_KEY with your LinearB API key.
  • Replace PROVIDER_ID with the identifier from your incident system.
  • Use ISO 8601 timestamps (for example, YYYY-MM-DDTHH:MM:SSZ).

Best practices
  • Keep incidents current: update started_at and ended_at so 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

  1. Go to Metrics → Git Activity → Incidents.
  2. Use filters to focus on relevant incidents.
Incidents roll up from sub-teams to their parent groups. For example, if Group A includes Teams B and C, Group A’s incidents include data from both teams.

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).

Changing a team’s incident detection method affects how LinearB calculates CFR and MTTR for that team.
  1. In the LinearB side menu, click Settings → Company Settings.
  2. Select the team that requires a different incident detection method.
  3. Open Team Settings → Project Management → Incidents.
  4. Select API Integration.
  5. Click Save.
  6. 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

Contact