Update
Replace a call route’s configuration.
Sending a path retires any phone-tree menu on the route. Send an empty path to keep the menu.
curl --request PUT \
--url https://api.incident.io/v2/call_routes/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"custom_language": "en-US",
"name": "Regulator urgent request",
"path": [
{
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"level": {
"targets": [
{
"id": "lawrencejones",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
]
},
"type": "level",
"voicemail": {
"greeting_text": "Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded."
}
}
],
"responder_caller_id": "route_number",
"use_caller_allowlist": true
}
'import requests
url = "https://api.incident.io/v2/call_routes/{id}"
payload = {
"custom_language": "en-US",
"name": "Regulator urgent request",
"path": [
{
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"level": { "targets": [
{
"id": "lawrencejones",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
] },
"type": "level",
"voicemail": { "greeting_text": "Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded." }
}
],
"responder_caller_id": "route_number",
"use_caller_allowlist": True
}
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({
custom_language: 'en-US',
name: 'Regulator urgent request',
path: [
{
id: '01FCNDV6P870EA6S7TK1DSYDG0',
level: {
targets: [
{
id: 'lawrencejones',
schedule_mode: 'currently_on_call',
selected_rota_id: '01FCNDV6P870EA6S7TK1DSYDG0',
type: 'schedule',
urgency: 'high'
}
]
},
type: 'level',
voicemail: {
greeting_text: 'Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded.'
}
}
],
responder_caller_id: 'route_number',
use_caller_allowlist: true
})
};
fetch('https://api.incident.io/v2/call_routes/{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/call_routes/{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([
'custom_language' => 'en-US',
'name' => 'Regulator urgent request',
'path' => [
[
'id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'level' => [
'targets' => [
[
'id' => 'lawrencejones',
'schedule_mode' => 'currently_on_call',
'selected_rota_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'type' => 'schedule',
'urgency' => 'high'
]
]
],
'type' => 'level',
'voicemail' => [
'greeting_text' => 'Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded.'
]
]
],
'responder_caller_id' => 'route_number',
'use_caller_allowlist' => true
]),
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/call_routes/{id}"
payload := strings.NewReader("{\n \"custom_language\": \"en-US\",\n \"name\": \"Regulator urgent request\",\n \"path\": [\n {\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"level\": {\n \"targets\": [\n {\n \"id\": \"lawrencejones\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ]\n },\n \"type\": \"level\",\n \"voicemail\": {\n \"greeting_text\": \"Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded.\"\n }\n }\n ],\n \"responder_caller_id\": \"route_number\",\n \"use_caller_allowlist\": true\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/call_routes/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"custom_language\": \"en-US\",\n \"name\": \"Regulator urgent request\",\n \"path\": [\n {\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"level\": {\n \"targets\": [\n {\n \"id\": \"lawrencejones\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ]\n },\n \"type\": \"level\",\n \"voicemail\": {\n \"greeting_text\": \"Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded.\"\n }\n }\n ],\n \"responder_caller_id\": \"route_number\",\n \"use_caller_allowlist\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/call_routes/{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 \"custom_language\": \"en-US\",\n \"name\": \"Regulator urgent request\",\n \"path\": [\n {\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"level\": {\n \"targets\": [\n {\n \"id\": \"lawrencejones\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ]\n },\n \"type\": \"level\",\n \"voicemail\": {\n \"greeting_text\": \"Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded.\"\n }\n }\n ],\n \"responder_caller_id\": \"route_number\",\n \"use_caller_allowlist\": true\n}"
response = http.request(request)
puts response.read_body{
"call_route": {
"allowed_callers": [
{
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Regulator duty desk",
"phone_number": "+15551234567"
}
],
"country_code": "US",
"created_at": "2021-08-17T13:28:57.801578Z",
"current_state": "active",
"custom_language": "en-US",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Regulator urgent request",
"options": [
{
"digit": "1",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"path": [
{
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"level": {
"targets": [
{
"id": "lawrencejones",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
]
},
"type": "level",
"voicemail": {
"greeting_text": "Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded."
}
}
],
"prompt": "For an urgent production outage, press 1"
}
],
"path": [
{
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"level": {
"targets": [
{
"id": "lawrencejones",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
]
},
"type": "level",
"voicemail": {
"greeting_text": "Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded."
}
}
],
"phone_number": "+15551234567",
"phone_number_type": "toll_free",
"responder_caller_id": "route_number",
"updated_at": "2021-08-17T13:28:57.801578Z",
"use_caller_allowlist": true
}
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}call_routes.update scope.Authorizations
API key from your incident.io dashboard (Settings → API keys)
Path Parameters
The call route's ID
"01FCNDV6P870EA6S7TK1DSYDG0"
Body
The language we speak voice prompts in, via text-to-speech
en-US, en-GB, fr-FR, es-ES, pt-PT, pt-BR, de-DE, nl-NL "en-US"
Name for this call route
"Regulator urgent request"
Who to page when a call comes in. Retires any phone-tree menu on the route; send an empty list to keep the menu.
Show child attributes
Show child attributes
[ { "id": "01FCNDV6P870EA6S7TK1DSYDG0", "level": { "targets": [ { "id": "lawrencejones", "schedule_mode": "currently_on_call", "selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0", "type": "schedule", "urgency": "high" } ] }, "type": "level", "voicemail": { "greeting_text": "Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded." } } ]
Which number responders see when we call them:
- route_number: this route's own number
- oncall_number: an incident.io on-call number
route_number, oncall_number "route_number"
Whether to only answer calls from this route's allowed callers. Needs at least one allowed caller.
true
Response
OK response.
A call route is a phone number your customers can call to reach whoever is on call, for an urgent support line or a regulator hotline.
When a call comes in we work down the route's path, ringing each level's targets in turn until someone answers, then connect them to the caller. A trailing voicemail node records a message instead. Every call raises an alert, so calls can open incidents through an alert route.
List and edit call routes here. Create and delete them in the dashboard.
Show child attributes
Show child attributes
Was this page helpful?
curl --request PUT \
--url https://api.incident.io/v2/call_routes/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"custom_language": "en-US",
"name": "Regulator urgent request",
"path": [
{
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"level": {
"targets": [
{
"id": "lawrencejones",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
]
},
"type": "level",
"voicemail": {
"greeting_text": "Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded."
}
}
],
"responder_caller_id": "route_number",
"use_caller_allowlist": true
}
'import requests
url = "https://api.incident.io/v2/call_routes/{id}"
payload = {
"custom_language": "en-US",
"name": "Regulator urgent request",
"path": [
{
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"level": { "targets": [
{
"id": "lawrencejones",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
] },
"type": "level",
"voicemail": { "greeting_text": "Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded." }
}
],
"responder_caller_id": "route_number",
"use_caller_allowlist": True
}
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({
custom_language: 'en-US',
name: 'Regulator urgent request',
path: [
{
id: '01FCNDV6P870EA6S7TK1DSYDG0',
level: {
targets: [
{
id: 'lawrencejones',
schedule_mode: 'currently_on_call',
selected_rota_id: '01FCNDV6P870EA6S7TK1DSYDG0',
type: 'schedule',
urgency: 'high'
}
]
},
type: 'level',
voicemail: {
greeting_text: 'Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded.'
}
}
],
responder_caller_id: 'route_number',
use_caller_allowlist: true
})
};
fetch('https://api.incident.io/v2/call_routes/{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/call_routes/{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([
'custom_language' => 'en-US',
'name' => 'Regulator urgent request',
'path' => [
[
'id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'level' => [
'targets' => [
[
'id' => 'lawrencejones',
'schedule_mode' => 'currently_on_call',
'selected_rota_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'type' => 'schedule',
'urgency' => 'high'
]
]
],
'type' => 'level',
'voicemail' => [
'greeting_text' => 'Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded.'
]
]
],
'responder_caller_id' => 'route_number',
'use_caller_allowlist' => true
]),
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/call_routes/{id}"
payload := strings.NewReader("{\n \"custom_language\": \"en-US\",\n \"name\": \"Regulator urgent request\",\n \"path\": [\n {\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"level\": {\n \"targets\": [\n {\n \"id\": \"lawrencejones\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ]\n },\n \"type\": \"level\",\n \"voicemail\": {\n \"greeting_text\": \"Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded.\"\n }\n }\n ],\n \"responder_caller_id\": \"route_number\",\n \"use_caller_allowlist\": true\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/call_routes/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"custom_language\": \"en-US\",\n \"name\": \"Regulator urgent request\",\n \"path\": [\n {\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"level\": {\n \"targets\": [\n {\n \"id\": \"lawrencejones\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ]\n },\n \"type\": \"level\",\n \"voicemail\": {\n \"greeting_text\": \"Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded.\"\n }\n }\n ],\n \"responder_caller_id\": \"route_number\",\n \"use_caller_allowlist\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/call_routes/{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 \"custom_language\": \"en-US\",\n \"name\": \"Regulator urgent request\",\n \"path\": [\n {\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"level\": {\n \"targets\": [\n {\n \"id\": \"lawrencejones\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ]\n },\n \"type\": \"level\",\n \"voicemail\": {\n \"greeting_text\": \"Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded.\"\n }\n }\n ],\n \"responder_caller_id\": \"route_number\",\n \"use_caller_allowlist\": true\n}"
response = http.request(request)
puts response.read_body{
"call_route": {
"allowed_callers": [
{
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Regulator duty desk",
"phone_number": "+15551234567"
}
],
"country_code": "US",
"created_at": "2021-08-17T13:28:57.801578Z",
"current_state": "active",
"custom_language": "en-US",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Regulator urgent request",
"options": [
{
"digit": "1",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"path": [
{
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"level": {
"targets": [
{
"id": "lawrencejones",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
]
},
"type": "level",
"voicemail": {
"greeting_text": "Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded."
}
}
],
"prompt": "For an urgent production outage, press 1"
}
],
"path": [
{
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"level": {
"targets": [
{
"id": "lawrencejones",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
]
},
"type": "level",
"voicemail": {
"greeting_text": "Sorry, no one is available to take your call. Please leave a message after the tone. This call will be recorded."
}
}
],
"phone_number": "+15551234567",
"phone_number_type": "toll_free",
"responder_caller_id": "route_number",
"updated_at": "2021-08-17T13:28:57.801578Z",
"use_caller_allowlist": true
}
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}