Incidents in a post-incident status can be closed via our API.
This is particularly useful for teams that carry out follow-up actions from incidents in external tools, and want to automatically close the incident in incident.io once those tasks are complete.
Prerequisites
To use this feature, you must use an API Key with a specific scope. This ensures that incidents aren’t accidentally closed without a proper review unless explicitly authorized.
- Navigate to Settings > Integrations > API Keys
- Create a new API Key
- Ensure the key has the Close incidents by opting out of the post-incident flow permission enabled
How to use it
You can transition the incident by using the Edit Incident endpoint (PATCH /v2/incidents/{id}).
- From: The incident must currently be in a valid post-incident status (e.g.,
Resolved, Fixing)
- To: The target status must be
Closed
When you successfully close an incident via the API:
- The incident status moves to Closed
- The incident is marked as “opted out” of the post-incident flow
Resolving incidents
You can resolve active incidents using the same Edit Incident endpoint by setting the status to a post-incident or closed status:
- To a post-incident status (e.g.
Resolved): the incident enters the post-incident flow and tasks are created as normal. The status must belong to the post-incident flow that applies to this incident.
- Directly to closed: any configured post-incident flow is skipped entirely. This requires the same Close incidents by opting out of the post-incident flow permission described above.
Once an incident is in the post-incident flow, its status is managed automatically based on task completion. Moving between post-incident statuses via the API is not recommended, as the system will recalculate the correct status when tasks are updated.