Turn the AI receptionist on or off
curl --request PUT \
--url https://api.withallo.com/v2/api/numbers/{number}/agent/status \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.withallo.com/v2/api/numbers/{number}/agent/status"
payload = {}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.withallo.com/v2/api/numbers/{number}/agent/status', 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.withallo.com/v2/api/numbers/{number}/agent/status",
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([
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.withallo.com/v2/api/numbers/{number}/agent/status"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.withallo.com/v2/api/numbers/{number}/agent/status")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/numbers/{number}/agent/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"data": {
"agent": {
"id": "agt-abc123",
"name": "Maya",
"is_default": true,
"business_name": "Acme Plumbing",
"business_address": "12 Main Street, Austin TX",
"business_phone": "+14155551234",
"business_email": "[email protected]",
"business_website": "https://acme.test",
"business_industry": "Plumbing",
"language": "en-US",
"voice_id": "maya",
"greeting_message": "Thanks for calling Acme Plumbing, how can I help?",
"closing_message": "Thanks for calling, have a good day.",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"prompt": {
"sections": [
{
"title": "Objective",
"content": "Book a visit with the caller.",
"fields": [
{
"label": "Email",
"question": "What is the best email to send the quote to?",
"complete_when": "a valid email address is given"
}
]
}
],
"custom_prompt": "<string>"
},
"capabilities": {
"SCHEDULING": true,
"CALL_TRANSFER": true,
"WARM_TRANSFER": true
},
"business_hours": {
"timezone": "America/New_York",
"schedule": [
{
"schedule": [
{
"start_time": 32400,
"end_time": 61200
}
]
}
]
},
"transfer_rules": [
{
"description": "Billing or invoice questions",
"transfer_message": "Let me put you through to billing.",
"target_number": "+14155551234",
"target_member_id": "<string>",
"target_line_number": "<string>"
}
],
"scheduling": {
"calendars": [
{
"calendar_connection_id": "exc-abc123",
"name": "Acme bookings",
"is_team_default": true,
"owner": {
"user_id": "<string>",
"user_name": "<string>",
"email": "<string>",
"is_current_user": true
},
"event_types": [
{
"id": "42",
"slug": "intro-call",
"title": "Intro call",
"length_in_minutes": 30,
"description": "Book this one when the caller wants a quote.",
"required_questions": [
{
"id": "notes",
"label": "Anything we should know before the visit?"
}
]
}
]
}
]
},
"knowledge": {
"text": "<string>",
"websites": [
{
"id": "wkb-abc123",
"url": "https://acme.test/pricing",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"files": [
{
"id": "fkb-abc123",
"file_name": "pricing.pdf",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}AI Receptionist
Turn on or off
Puts the receptionist on the line (ACTIVE) or takes it off (FORWARDING, which sends calls to your business phone instead). This reprograms how a live line routes real calls, so confirm with a person before calling it.
PUT
/
v2
/
api
/
numbers
/
{number}
/
agent
/
status
Turn the AI receptionist on or off
curl --request PUT \
--url https://api.withallo.com/v2/api/numbers/{number}/agent/status \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.withallo.com/v2/api/numbers/{number}/agent/status"
payload = {}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.withallo.com/v2/api/numbers/{number}/agent/status', 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.withallo.com/v2/api/numbers/{number}/agent/status",
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([
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.withallo.com/v2/api/numbers/{number}/agent/status"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.withallo.com/v2/api/numbers/{number}/agent/status")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/numbers/{number}/agent/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"data": {
"agent": {
"id": "agt-abc123",
"name": "Maya",
"is_default": true,
"business_name": "Acme Plumbing",
"business_address": "12 Main Street, Austin TX",
"business_phone": "+14155551234",
"business_email": "[email protected]",
"business_website": "https://acme.test",
"business_industry": "Plumbing",
"language": "en-US",
"voice_id": "maya",
"greeting_message": "Thanks for calling Acme Plumbing, how can I help?",
"closing_message": "Thanks for calling, have a good day.",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"prompt": {
"sections": [
{
"title": "Objective",
"content": "Book a visit with the caller.",
"fields": [
{
"label": "Email",
"question": "What is the best email to send the quote to?",
"complete_when": "a valid email address is given"
}
]
}
],
"custom_prompt": "<string>"
},
"capabilities": {
"SCHEDULING": true,
"CALL_TRANSFER": true,
"WARM_TRANSFER": true
},
"business_hours": {
"timezone": "America/New_York",
"schedule": [
{
"schedule": [
{
"start_time": 32400,
"end_time": 61200
}
]
}
]
},
"transfer_rules": [
{
"description": "Billing or invoice questions",
"transfer_message": "Let me put you through to billing.",
"target_number": "+14155551234",
"target_member_id": "<string>",
"target_line_number": "<string>"
}
],
"scheduling": {
"calendars": [
{
"calendar_connection_id": "exc-abc123",
"name": "Acme bookings",
"is_team_default": true,
"owner": {
"user_id": "<string>",
"user_name": "<string>",
"email": "<string>",
"is_current_user": true
},
"event_types": [
{
"id": "42",
"slug": "intro-call",
"title": "Intro call",
"length_in_minutes": 30,
"description": "Book this one when the caller wants a quote.",
"required_questions": [
{
"id": "notes",
"label": "Anything we should know before the visit?"
}
]
}
]
}
]
},
"knowledge": {
"text": "<string>",
"websites": [
{
"id": "wkb-abc123",
"url": "https://acme.test/pricing",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"files": [
{
"id": "fkb-abc123",
"file_name": "pricing.pdf",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}Required scope:
AGENTS_WRITEBehavior
Puts the AI receptionist on the line or takes it off, and returns the whole configuration with the new status.ACTIVE: the receptionist answers incoming calls.FORWARDING: it does not, and calls go to your business phone instead.
This reprograms how a live line routes real calls. It is deliberately its own endpoint, so a configuration write can never flip it by accident. Configure the receptionist fully before switching it on, and confirm with a person before calling it.
business_phone and is not writable through this API.
Errors
400 AGENT_NO_FORWARDING_NUMBER:FORWARDINGwas requested and no business phone is set on the workspace. Until one is, the receptionist can only stayACTIVE.409 AGENT_LINE_NOT_ASSIGNED: the line has no phone number assigned, so it can neither answer nor forward.404 PHONE_NUMBER_NOT_FOUND: the number is not one you have access to.
Authorizations
Path Parameters
Allo phone number in E.164 format
Example:
"+14155551234"
Body
application/json
ACTIVE puts the receptionist on the line. FORWARDING takes it off and sends calls to your business phone.
Available options:
ACTIVE, FORWARDING Response
The configuration, with the new status
The whole configuration of one line's AI receptionist.
Show child attributes
Show child attributes
Was this page helpful?
⌘I