Incidents API
Endpoints Overview
| Method | Path | Description |
|---|---|---|
| GET | /prod/api/incidents | List incidents with filters |
| GET | /prod/api/incidents/:id | Get single incident |
| POST | /prod/api/incidents | Create new incident |
| PATCH | /prod/api/incidents/:id | Update incident fields |
| DELETE | /prod/api/incidents/:id | Delete incident (admin only) |
| GET | /prod/api/incidents/:id/notes | List work notes |
| POST | /prod/api/incidents/:id/notes | Add work note |
| POST | /prod/api/incidents/bulk | Bulk create/update |
List Incidents
GET /prod/api/incidents
curl -H "Authorization: Bearer $TOKEN" "https://your-instance.stackflow-tech.com/prod/api/incidents?state=new&priority=P1&limit=25"
Query Parameters:
| Parameter | Type | Description | Example |
|---|---|---|---|
state | string | Filter by state | new, in_progress, resolved, closed |
priority | string | Filter by priority | P1, P2, P3, P4 |
assignment_group | string | Filter by group name | Platform Engineering |
assigned_to | string | Filter by assignee email | jane@example.com |
category | string | Filter by category | database, network |
created_after | ISO 8601 | Created after timestamp | 2026-05-01T00:00:00Z |
created_before | ISO 8601 | Created before timestamp | 2026-05-31T23:59:59Z |
page | integer | Page number | 1 |
limit | integer | Records per page (max 200) | 50 |
sort | string | Sort field | created_at, priority, updated_at |
order | string | Sort direction | asc, desc |
q | string | Full-text search | database+timeout |
Get Incident
GET /prod/api/incidents/:id
curl -H "Authorization: Bearer $TOKEN" https://your-instance.stackflow-tech.com/prod/api/incidents/INC0001234
{
"id": "INC0001234",
"number": "INC0001234",
"short_description": "Database timeout in prod",
"description": "Seeing intermittent timeouts on the main Aurora cluster...",
"priority": "P2",
"state": "in_progress",
"category": "database",
"subcategory": "aurora",
"impact": "medium",
"urgency": "medium",
"assignment_group": "Platform Engineering",
"assigned_to": "jane.doe@example.com",
"opened_by": "john.smith@example.com",
"ci_id": "CI0000789",
"parent_problem_id": null,
"change_id": null,
"sla_breach_at": "2026-05-19T18:30:00Z",
"resolved_at": null,
"closed_at": null,
"created_at": "2026-05-19T14:30:00Z",
"updated_at": "2026-05-19T14:45:00Z",
"work_notes_count": 3,
"ai_suggested_resolution": "Check Aurora connection pool settings..."
}
Create Incident
POST /prod/api/incidents
curl -X POST https://your-instance.stackflow-tech.com/prod/api/incidents -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{
"short_description": "Redis cache miss rate above 90%",
"description": "ElastiCache Redis cluster showing 95% cache miss rate since 15:00 UTC. All microservices impacted.",
"priority": "P1",
"category": "cache",
"subcategory": "elasticache",
"impact": "high",
"urgency": "high",
"assignment_group": "Platform Engineering",
"ci_id": "CI0000456",
"notify_stakeholders": true
}'
Update Incident
PATCH /prod/api/incidents/:id
curl -X PATCH https://your-instance.stackflow-tech.com/prod/api/incidents/INC0001234 -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{
"state": "in_progress",
"assigned_to": "jane.doe@example.com",
"work_note": "Investigating Aurora slow query log — identified missing index on incidents_created_at"
}'
State transitions follow this machine:
new → in_progress → resolved → closed
new → cancelled
in_progress → on_hold → in_progress
resolved → reopened → in_progress
Delete Incident
DELETE /prod/api/incidents/:id
# Requires super_admin or itsm_manager role
curl -X DELETE -H "Authorization: Bearer $TOKEN" https://your-instance.stackflow-tech.com/prod/api/incidents/INC0001234
Soft Delete: DELETE marks the incident as
deleted=true in Aurora and removes it from all list views, but the record is retained for audit purposes. Hard deletion requires a database administrator operation and is irreversible.
Work Notes Sub-Resource
# List work notes
GET /prod/api/incidents/:id/notes
curl -H "Authorization: Bearer $TOKEN" https://your-instance.stackflow-tech.com/prod/api/incidents/INC0001234/notes
# Add a work note
POST /prod/api/incidents/:id/notes
curl -X POST https://your-instance.stackflow-tech.com/prod/api/incidents/INC0001234/notes -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{
"body": "Restarted Aurora connection pool. Error rate dropped to 0. Monitoring for 30 min.",
"visibility": "team",
"attachments": []
}'
{
"id": "note_abc123",
"incident_id": "INC0001234",
"body": "Restarted Aurora connection pool...",
"visibility": "team",
"author": "jane.doe@example.com",
"created_at": "2026-05-19T15:10:00Z"
}
Bulk Operations
POST /prod/api/incidents/bulk
curl -X POST https://your-instance.stackflow-tech.com/prod/api/incidents/bulk -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{
"operation": "update",
"ids": ["INC0001230", "INC0001231", "INC0001232"],
"fields": {
"assignment_group": "Platform Engineering",
"state": "in_progress"
}
}'
Field Reference
| Field | Type | Writable | Description |
|---|---|---|---|
id | string | No | System-generated incident ID (INCxxxxxxx) |
short_description | string | Yes | One-line summary, max 255 chars (required) |
description | string | Yes | Full description, supports Markdown |
priority | enum | Yes | P1, P2, P3, P4 (default: P3) |
state | enum | Yes | new, in_progress, on_hold, resolved, closed, cancelled |
category | string | Yes | Incident category |
subcategory | string | Yes | Subcategory within category |
impact | enum | Yes | high, medium, low |
urgency | enum | Yes | high, medium, low |
assignment_group | string | Yes | Assignment group name |
assigned_to | string | Yes | Assignee email address |
ci_id | string | Yes | Related CI ID from CMDB |
sla_breach_at | ISO 8601 | No | Computed SLA breach timestamp |
created_at | ISO 8601 | No | Record creation timestamp (UTC) |
updated_at | ISO 8601 | No | Last update timestamp (UTC) |