Incident API
Base URL:
https://service.devstats.com/api/v1Authorization
Bearer token required. Include in the header:
Authorization: Bearer <token>GET
/incidentsList Incidents
Retrieves a list of incidents.
Query Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
per_page | number | query | No | Min: 1 |
page | number | query | No | Min: 1 |
repository | string | query | No | Min length: 1Max length: 255 |
severity | string | query | No | Enum: critical, high, medium, low |
status | string | query | No | Enum: resolved, detected, investigating, identified, mitigated |
GET /api/v1/incidents HTTP/1.1
Host: service.devstats.com
Authorization: Bearer <token>
Accept: application/jsonResponses
POST
/incidentsCreate Incident
Creates a new incident for the repository.
Request Body
| Name | Type | In | Required | Description |
|---|---|---|---|---|
name | string | body | Yes | The incident name. |
severity | string | body | No | The incident severity. |
status | string | body | No | The incident status. |
description | string | body | No | The incident description. |
detected_by | string | body | Yes | Enum: automated_monitoring, customers, internally |
root_cause | string | null | body | No | The root cause of the incident. |
started_at | string | body | Yes | The incident start date in the ISO 8601 format. |
resolved_at | string | body | No | The resolved date in the ISO 8601 format. |
repositories | array | body | Yes | The full names of the repositories to associate with the incident. |
POST /api/v1/incidents HTTP/1.1
Host: service.devstats.com
Authorization: Bearer <token>
Accept: application/json
Content-Type: application/json
{
"name": "Problem with login",
"severity": "high",
"status": "detected",
"description": "It's impossible to log in to the system.",
"detected_by": "<detected_by>",
"root_cause": "Database connection timeout",
"started_at": "2024-07-20T15:30:00+00:00",
"resolved_at": "2024-07-20T15:30:00+00:00",
"repositories": [
"organization/repository-one",
"organization/repository-two"
]
}Responses
DELETE
/incidents/{incident}Delete Incident
Deletes an existing incident.
Path Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
incident | string | path | Yes | The incident UUID |
DELETE /api/v1/incidents/<incident> HTTP/1.1
Host: service.devstats.com
Authorization: Bearer <token>
Accept: application/jsonResponses
PATCH
/incidents/{incident}Update Incident
Updates an existing incident.
Path Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
incident | string | path | Yes | The incident UUID |
Request Body
| Name | Type | In | Required | Description |
|---|---|---|---|---|
name | string | body | No | The incident name. |
severity | string | body | No | The incident severity. |
status | string | body | No | The incident status. |
description | string | body | No | The incident description. |
detected_by | string | body | No | Enum: automated_monitoring, customers, internally |
root_cause | string | null | body | No | The root cause of the incident. |
started_at | string | body | No | The incident start date in the ISO 8601 format. |
resolved_at | string | body | No | The resolved date in the ISO 8601 format. |
repositories | array | body | No | The full names of the repositories to associate with the incident. |
PATCH /api/v1/incidents/<incident> HTTP/1.1
Host: service.devstats.com
Authorization: Bearer <token>
Accept: application/json
Content-Type: application/json
{
"name": "Problem with login",
"severity": "high",
"status": "detected",
"description": "It's impossible to log in to the system.",
"detected_by": "<detected_by>",
"root_cause": "Database connection timeout",
"started_at": "2024-07-20T15:30:00+00:00",
"resolved_at": "2024-07-20T15:30:00+00:00",
"repositories": [
"organization/repository-one",
"organization/repository-two"
]
}Responses