Pick the agent that answers
curl --request PATCH \
--url https://guidinghand.ai/v1/phone_numbers/{phone_number_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "billing"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_id: 'billing'})
};
fetch('https://guidinghand.ai/v1/phone_numbers/{phone_number_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/phone_numbers/{phone_number_id}"
payload = { "agent_id": "billing" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"object": "phone_number",
"id": "pn_3f9a0c1d2e4b5a6978c1d2e3",
"number": "+14155550123",
"display": "(415) 555-0123",
"agent_id": "billing",
"connection_id": "<string>",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"name": "Front desk",
"connection_name": "<string>"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}Phone numbers
Pick the agent that answers
agent_id null: not answered. Needs the admin role or an API key.
PATCH
/
v1
/
phone_numbers
/
{phone_number_id}
Pick the agent that answers
curl --request PATCH \
--url https://guidinghand.ai/v1/phone_numbers/{phone_number_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "billing"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_id: 'billing'})
};
fetch('https://guidinghand.ai/v1/phone_numbers/{phone_number_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/phone_numbers/{phone_number_id}"
payload = { "agent_id": "billing" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"object": "phone_number",
"id": "pn_3f9a0c1d2e4b5a6978c1d2e3",
"number": "+14155550123",
"display": "(415) 555-0123",
"agent_id": "billing",
"connection_id": "<string>",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"name": "Front desk",
"connection_name": "<string>"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}Authorizations
An org API key (gh_live_…) from Settings → API keys in the console.
Path Parameters
Body
application/json
Example:
"billing"
Response
OK
One of the org's numbers on Eager. Calls to it are answered by its agent's published version, out loud, with its tools.
Allowed value:
"phone_number"Example:
"pn_3f9a0c1d2e4b5a6978c1d2e3"
E.164.
Example:
"+14155550123"
Example:
"(415) 555-0123"
The agent that answers it; null: not answered.
Example:
"billing"
Available options:
active, released Its friendly name in Twilio.
Example:
"Front desk"