Incidents
The LinearB incident API offers the capability to send incident data to LinearB, enabling the accurate calculation of metrics such as CFR (Change Failure Rate) and MTTR (Mean Time to Recovery). This API empowers you to track and monitor incidents seamlessly from any project management tool, By integrating with the LinearB incident API, you can track all DORA (DevOps Research and Assessment) metrics, enabling you to evaluate and improve your team's overall performance.
Create incident
Create a new incident within the LinearB platform. By making a POST request to this endpoint, you can provide the necessary information to initiate an incident record.
HTTP request
POST https://public-api.linearb.io/api/v1/incidents
Body parameters
Parameter name | Value | Description |
---|---|---|
provider_id (required) | string max 255 chars | The unique identifier of the incident in your incident management provider |
http_url (required) | string max 512 chars | The URL of your incident management provider. The combination http_url/provider_key should open the incident in your PM provider Pattern:^(http |
title (required) | string max 255 chars | The title of the incident |
issued_at (required) | string (timestamp ISO 8601 format) | The specific time when the incident was logged and officially opened |
started_at | string (timestamp ISO 8601 format) | The specific time when work on the incident commenced |
ended_at | string (timestamp ISO 8601 format) | The specific time when the incident was successfully resolved |
git_ref | string | The Git reference of the release responsible for causing this incident, i.e. commit short or long sha or tag name (i.e. commit short or long sha/tag name) Pattern:^[!\"#\$%&\'()+,-0-9;<=>\@A-Z]_`a-z{ |
teams | Array of strings (lowercase only) | The list of LinearB teams names related to this incident |
services | Array of strings (lowercase only) | The list of LinearB services related to this incident |
repository_urls | Array of strings (lowercase only) | The list of repos urls related to this incident |
Example
Reporting an incident
{
"provider_id": "provider_internal_id1",
"http_url": "http://myprovider.io/1",
"title": "This is critical production bug",
"issued_at": "2019-09-26T07:58:30.996",
"teams": [
"Team A",
"Team B"
],
"repository_urls": [
"https://github.com/myorg/repo1.git",
"https://github.com/myorg/repo2.git"
]
}
Responses
201 - Successful Response
400 - Bad Request
401 - Unauthorized
405 - Method Not Allowed
422 - Validation Error
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
500 - Internal Server Error
Update incident
Use this endpoint to modify an existing incident within the LinearB platform. By making a PATCH request to this endpoint, you can provide updated information to reflect changes, progress, or additional details related to the incident
HTTP request
PATCH https://public-api.linearb.io/api/v1/incidents{provider_id}
Body parameters
Parameter name | Value | Description |
---|---|---|
title (required) | string max 255 chars | The title of the incident |
issued_at (required) | string (timestamp ISO 8601 format) | The specific time when the incident was logged and officially opened |
started_at | string (timestamp ISO 8601 format) | The specific time when work on the incident commenced |
ended_at | string (timestamp ISO 8601 format) | The specific time when the incident was successfully resolved |
git_ref (required) | string | The Git reference of the release responsible for causing this incident, i.e. commit short or long sha or tag name (i.e. commit short or long sha/tag name) Pattern:^[!\"#\$%&\'()+,-0-9;<=>\@A-Z]_`a-z{ |
teams | Array of strings (lowercase only) | The list of LinearB teams names related to this incident |
services | Array of strings (lowercase only) | The list of LinearB services related to this incident |
repository_urls | Array of strings (lowercase only) | The list of repos urls related to this incident |
Example
Updating an incident
{
"title": "This is changed title",
"started_at": "2023-05-03 18:00",
"repository_urls": [
"https://github.com/myorg/repo2.git"
]
}
Responses
204 - Successful Response
400 - Bad Request
401 - Unauthorized
405 - Method Not Allowed
422 - Validation Error
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
500 - Internal Server Error
Search incidents
Get a list of incidents that have been saved in the LinearB platform
HTTP request
POST https://public-api.linearb.io/api/v1/incidents/search
Query parameters
Parameter name | Value | Description |
---|---|---|
teams | Array of strings (lowercase only) | The list of LinearB teams names related to this incident |
services | Array of strings (lowercase only) | The list of LinearB services related to this incident |
repository_urls | Array of strings (lowercase only) | The list of repos urls related to this incident |
issued_at (required) | object | The specific time when the incident was logged and officially opened |
started_at | object | The specific time when work on the incident commenced |
ended_at | object | The specific time when the incident was successfully resolved |
statuses | Array of strings (lowercase only) | The status of the incident Valid values are: "open" "in-progress" "closed" "deleted" (Default: "issued_at") |
sort_by | string | Sort by Valid values are: "issued_at" "started_at" "ended_at" (Default: "issued_at") |
sort_dir | string | Sort direction Valid values are: "desc" and "asc" (Default: "desc") |
limit | integer | The maximum number of incidents to return. Acceptable values are 1 to 100, inclusive. (Default: 25) |
offset | integer | Valid values are: >=0 (Default: "0") |
Examples
Opened incidents after a date
{
"limit": 50,
"issued_at": {
"after": "2021-12-01"
},
"statuses": [
"open"
]
}
Uncompleted incidents between dates at a specific repo
{
"limit": 50,
"issued_at": {
"after": "2021-01-01",
"before": "2022-12-31"
},
"repository_urls": [
"https://github.com/myorg/website.git"
],
"statuses": [
"open",
"in-progress"
]
}
Responses
200 - Successful Response
{
"total": 0,
"items": [
{
"provider_id": "string",
"http_url": "string",
"title": "string",
"issued_at": "string",
"started_at": "string",
"ended_at": "string",
"git_ref": "string",
"teams": [
{}
],
"services": [
{}
],
"repositories": [
{}
],
"status": "string"
}
]
}
400 - Bad Request
401 - Unauthorized
404 - Not Found
405 - Method Not Allowed
422 - Validation Error
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
500 - Internal Server Error
Get incident
Get an incident by its provider ID
HTTP request
GET https://public-api.linearb.io/api/v1/incidents/{provider_id}
Query parameters
Parameter name | Value | Description |
---|---|---|
provider_id (required) | string max 255 chars | The unique identifier of the incident in your project management provider |
Responses
200 - Successful Response
{
"provider_id": "string",
"http_url": "string",
"title": "string",
"issued_at": "string",
"started_at": "string",
"ended_at": "string",
"git_ref": "string",
"teams": [
{}
],
"services": [
{}
],
"repositories": [
{}
],
"status": "string"
}
400 - Bad Request
401 - Unauthorized
404 - Not Found
405 - Method Not Allowed
422 - Validation Error
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
500 - Internal Server Error
Delete incident
Delete an incident by its provider ID
HTTP request
Delete https://public-api.linearb.io/api/v1/incidents/{provider_id}
Query parameters
Parameter name | Value | Description |
---|---|---|
provider_id (required) | string max 255 chars | The unique identifier of the incident in your project management provider |
Responses
204 - Successful Response
400 - Bad Request
401 - Unauthorized
405 - Method Not Allowed
422 - Validation Error
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
500 - Internal Server Error