API Reference
Incidents

Incidents API

Create, read, update, and manage incidents and their updates.

List Incidents

GET /api/v1/incidents

Retrieve incidents for your organization.

Query Parameters

ParameterTypeDescription
statusstringFilter: investigating, identified, monitoring, resolved
limitintegerMaximum results (default: 50, max: 100)

Response

{
  "incidents": [
    {
      "id": "inc_abc123",
      "title": "API Performance Degradation",
      "description": "Investigating slow response times",
      "status": "investigating",
      "severity": "minor",
      "createdAt": "2024-01-15T12:00:00Z",
      "updatedAt": "2024-01-15T12:15:00Z",
      "updates": [
        {
          "id": "upd_xyz789",
          "status": "investigating",
          "message": "We are investigating reports of slow API responses.",
          "createdAt": "2024-01-15T12:00:00Z"
        }
      ]
    }
  ],
  "count": 1
}

Example

curl -X GET "https://statly.live/api/v1/incidents?status=investigating" \
  -H "Authorization: Bearer sk_live_xxx"

Create Incident

POST /api/v1/incidents

Create a new incident.

Request Body

FieldTypeRequiredDescription
titlestringYesIncident title (max 200 chars)
descriptionstringNoDetailed description
statusstringNoinvestigating, identified, monitoring (default: investigating)
severitystringNomajor, minor, maintenance (default: minor)
affectedMonitorsarrayNoArray of monitor IDs affected

Example

curl -X POST "https://statly.live/api/v1/incidents" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "API Performance Degradation",
    "description": "Users are experiencing slow response times on API endpoints.",
    "severity": "minor",
    "status": "investigating",
    "affectedMonitors": ["mon_abc123"]
  }'

Response

{
  "id": "inc_abc123",
  "title": "API Performance Degradation",
  "description": "Users are experiencing slow response times on API endpoints.",
  "status": "investigating",
  "severity": "minor",
  "createdAt": "2024-01-15T12:00:00Z",
  "updates": [
    {
      "id": "upd_xyz789",
      "status": "investigating",
      "message": "Users are experiencing slow response times on API endpoints.",
      "createdAt": "2024-01-15T12:00:00Z"
    }
  ]
}

Get Incident

GET /api/v1/incidents/{id}

Get details of a specific incident with all updates.

Response

{
  "id": "inc_abc123",
  "title": "API Performance Degradation",
  "status": "resolved",
  "severity": "minor",
  "createdAt": "2024-01-15T12:00:00Z",
  "resolvedAt": "2024-01-15T13:00:00Z",
  "updates": [
    {
      "id": "upd_1",
      "status": "investigating",
      "message": "We are investigating reports of slow API responses.",
      "createdAt": "2024-01-15T12:00:00Z"
    },
    {
      "id": "upd_2",
      "status": "identified",
      "message": "Root cause identified as database connection pool exhaustion.",
      "createdAt": "2024-01-15T12:15:00Z"
    },
    {
      "id": "upd_3",
      "status": "resolved",
      "message": "Fix deployed. All systems operational.",
      "createdAt": "2024-01-15T13:00:00Z"
    }
  ]
}

Update Incident

PATCH /api/v1/incidents/{id}

Update an incident's status or add a new update message.

Request Body

FieldTypeDescription
titlestringUpdate the title
descriptionstringUpdate the description
statusstringNew status (creates an update entry)
severitystringUpdate severity
messagestringUpdate message (required with status change)

Example: Add Status Update

curl -X PATCH "https://statly.live/api/v1/incidents/inc_abc123" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "identified",
    "message": "Root cause identified as database connection pool exhaustion. Working on fix."
  }'

Example: Resolve Incident

curl -X PATCH "https://statly.live/api/v1/incidents/inc_abc123" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "resolved",
    "message": "Fix has been deployed. All systems are operating normally."
  }'

Delete Incident

DELETE /api/v1/incidents/{id}

Delete an incident and all its updates.

⚠️

This permanently removes the incident and its update history. Consider resolving the incident instead of deleting it.

Example

curl -X DELETE "https://statly.live/api/v1/incidents/inc_abc123" \
  -H "Authorization: Bearer sk_live_xxx"

Response

HTTP/1.1 204 No Content

Add Incident Update

POST /api/v1/incidents/{id}/updates

Add an update to an existing incident without changing status.

Request Body

FieldTypeRequiredDescription
messagestringYesUpdate message
statusstringNoStatus (defaults to current)

Example

curl -X POST "https://statly.live/api/v1/incidents/inc_abc123/updates" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "We are continuing to monitor the situation. No issues detected in the past 30 minutes."
  }'