Transition
Confirm or detach the connection between an alert and an incident.
Set state to ‘related’ to confirm the connection, or ‘unrelated’ to detach the alert from the incident. The API key also needs the ‘manage incident alerts’ scope.
A detached connection no longer appears in the list endpoint, which returns related connections only.
Busy incidents can be locked by another operation, in which case this endpoint returns a 409 and the request can be retried.
POST
/
v2
/
incident_alerts
/
{id}
/
actions
/
transition
Transition
curl --request POST \
--url https://api.incident.io/v2/incident_alerts/{id}/actions/transition \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"state": "related"
}
'import requests
url = "https://api.incident.io/v2/incident_alerts/{id}/actions/transition"
payload = { "state": "related" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({state: 'related'})
};
fetch('https://api.incident.io/v2/incident_alerts/{id}/actions/transition', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.incident.io/v2/incident_alerts/{id}/actions/transition",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'state' => 'related'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/incident_alerts/{id}/actions/transition"
payload := strings.NewReader("{\n \"state\": \"related\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.incident.io/v2/incident_alerts/{id}/actions/transition")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"state\": \"related\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/incident_alerts/{id}/actions/transition")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"state\": \"related\"\n}"
response = http.request(request)
puts response.read_body{
"incident_alert": {
"alert": {
"alert_group_ids": [
"01GW2G3V0S59R238FAHPDS1R66"
],
"alert_source_id": "01GW2G3V0S59R238FAHPDS1R66",
"created_at": "2021-08-17T13:28:57.801578Z",
"deduplication_key": "4293868629",
"description": "CPU on the payments service has exceeded 75 percent for 5 minutes",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"resolved_at": "2021-08-17T14:28:57.801578Z",
"source_url": "https://www.my-alerting-platform.com/alerts/my-alert-123",
"status": "firing",
"title": "*errors.withMessage: PG::Error failed to connect",
"updated_at": "2021-08-17T13:28:57.801578Z"
},
"alert_route_id": "01GW2G3V0S59R238FAHPDS1R67",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"incident": {
"external_id": 123,
"id": "01FDAG4SAP5TYPT98WGR2N7W91",
"name": "Our database is sad",
"reference": "INC-123",
"status_category": "triage",
"summary": "Our database is really really sad, and we don't know why yet.",
"visibility": "public"
}
}
}🔑 Requires the
incident_alerts.transition scope.Authorizations
API key from your incident.io dashboard (Settings → API keys)
Path Parameters
Unique identifier for the incident alert
Example:
"01FDAG4SAP5TYPT98WGR2N7W91"
Body
application/json
What state to move the connection to
Available options:
related, unrelated Example:
"related"
Response
200 - application/json
OK response.
Show child attributes
Show child attributes
Was this page helpful?
Transition
curl --request POST \
--url https://api.incident.io/v2/incident_alerts/{id}/actions/transition \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"state": "related"
}
'import requests
url = "https://api.incident.io/v2/incident_alerts/{id}/actions/transition"
payload = { "state": "related" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({state: 'related'})
};
fetch('https://api.incident.io/v2/incident_alerts/{id}/actions/transition', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.incident.io/v2/incident_alerts/{id}/actions/transition",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'state' => 'related'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/incident_alerts/{id}/actions/transition"
payload := strings.NewReader("{\n \"state\": \"related\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.incident.io/v2/incident_alerts/{id}/actions/transition")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"state\": \"related\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/incident_alerts/{id}/actions/transition")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"state\": \"related\"\n}"
response = http.request(request)
puts response.read_body{
"incident_alert": {
"alert": {
"alert_group_ids": [
"01GW2G3V0S59R238FAHPDS1R66"
],
"alert_source_id": "01GW2G3V0S59R238FAHPDS1R66",
"created_at": "2021-08-17T13:28:57.801578Z",
"deduplication_key": "4293868629",
"description": "CPU on the payments service has exceeded 75 percent for 5 minutes",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"resolved_at": "2021-08-17T14:28:57.801578Z",
"source_url": "https://www.my-alerting-platform.com/alerts/my-alert-123",
"status": "firing",
"title": "*errors.withMessage: PG::Error failed to connect",
"updated_at": "2021-08-17T13:28:57.801578Z"
},
"alert_route_id": "01GW2G3V0S59R238FAHPDS1R67",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"incident": {
"external_id": 123,
"id": "01FDAG4SAP5TYPT98WGR2N7W91",
"name": "Our database is sad",
"reference": "INC-123",
"status_category": "triage",
"summary": "Our database is really really sad, and we don't know why yet.",
"visibility": "public"
}
}
}