Update
Update an existing incident role
PUT
/
v2
/
incident_roles
/
{id}
Update
curl --request PUT \
--url https://api.incident.io/v2/incident_roles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "The person currently coordinating the incident",
"instructions": "Take point on the incident; Make sure people are clear on responsibilities",
"name": "Incident Lead",
"shortform": "lead"
}
'import requests
url = "https://api.incident.io/v2/incident_roles/{id}"
payload = {
"description": "The person currently coordinating the incident",
"instructions": "Take point on the incident; Make sure people are clear on responsibilities",
"name": "Incident Lead",
"shortform": "lead"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'The person currently coordinating the incident',
instructions: 'Take point on the incident; Make sure people are clear on responsibilities',
name: 'Incident Lead',
shortform: 'lead'
})
};
fetch('https://api.incident.io/v2/incident_roles/{id}', 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_roles/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'The person currently coordinating the incident',
'instructions' => 'Take point on the incident; Make sure people are clear on responsibilities',
'name' => 'Incident Lead',
'shortform' => 'lead'
]),
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_roles/{id}"
payload := strings.NewReader("{\n \"description\": \"The person currently coordinating the incident\",\n \"instructions\": \"Take point on the incident; Make sure people are clear on responsibilities\",\n \"name\": \"Incident Lead\",\n \"shortform\": \"lead\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.incident.io/v2/incident_roles/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"The person currently coordinating the incident\",\n \"instructions\": \"Take point on the incident; Make sure people are clear on responsibilities\",\n \"name\": \"Incident Lead\",\n \"shortform\": \"lead\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/incident_roles/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"The person currently coordinating the incident\",\n \"instructions\": \"Take point on the incident; Make sure people are clear on responsibilities\",\n \"name\": \"Incident Lead\",\n \"shortform\": \"lead\"\n}"
response = http.request(request)
puts response.read_body{
"incident_role": {
"created_at": "2021-08-17T13:28:57.801578Z",
"description": "The person currently coordinating the incident",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"instructions": "Take point on the incident; Make sure people are clear on responsibilities",
"name": "Incident Lead",
"role_type": "lead",
"shortform": "lead",
"updated_at": "2021-08-17T13:28:57.801578Z"
}
}🔑 Requires the
organisation_settings.update scope.Authorizations
API key from your incident.io dashboard (Settings → API keys)
Path Parameters
Unique identifier for the role
Example:
"01FCNDV6P870EA6S7TK1DSYDG0"
Body
application/json
Describes the purpose of the role
Minimum string length:
1Example:
"The person currently coordinating the incident"
Provided to whoever is nominated for the role. Note that this will be empty for the 'reporter' role.
Example:
"Take point on the incident; Make sure people are clear on responsibilities"
Human readable name of the incident role
Minimum string length:
1Example:
"Incident Lead"
Short human readable name for Slack. Note that this will be empty for the 'reporter' role.
Example:
"lead"
Response
200 - application/json
OK response.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Update
curl --request PUT \
--url https://api.incident.io/v2/incident_roles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "The person currently coordinating the incident",
"instructions": "Take point on the incident; Make sure people are clear on responsibilities",
"name": "Incident Lead",
"shortform": "lead"
}
'import requests
url = "https://api.incident.io/v2/incident_roles/{id}"
payload = {
"description": "The person currently coordinating the incident",
"instructions": "Take point on the incident; Make sure people are clear on responsibilities",
"name": "Incident Lead",
"shortform": "lead"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'The person currently coordinating the incident',
instructions: 'Take point on the incident; Make sure people are clear on responsibilities',
name: 'Incident Lead',
shortform: 'lead'
})
};
fetch('https://api.incident.io/v2/incident_roles/{id}', 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_roles/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'The person currently coordinating the incident',
'instructions' => 'Take point on the incident; Make sure people are clear on responsibilities',
'name' => 'Incident Lead',
'shortform' => 'lead'
]),
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_roles/{id}"
payload := strings.NewReader("{\n \"description\": \"The person currently coordinating the incident\",\n \"instructions\": \"Take point on the incident; Make sure people are clear on responsibilities\",\n \"name\": \"Incident Lead\",\n \"shortform\": \"lead\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.incident.io/v2/incident_roles/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"The person currently coordinating the incident\",\n \"instructions\": \"Take point on the incident; Make sure people are clear on responsibilities\",\n \"name\": \"Incident Lead\",\n \"shortform\": \"lead\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/incident_roles/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"The person currently coordinating the incident\",\n \"instructions\": \"Take point on the incident; Make sure people are clear on responsibilities\",\n \"name\": \"Incident Lead\",\n \"shortform\": \"lead\"\n}"
response = http.request(request)
puts response.read_body{
"incident_role": {
"created_at": "2021-08-17T13:28:57.801578Z",
"description": "The person currently coordinating the incident",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"instructions": "Take point on the incident; Make sure people are clear on responsibilities",
"name": "Incident Lead",
"role_type": "lead",
"shortform": "lead",
"updated_at": "2021-08-17T13:28:57.801578Z"
}
}