Take a phone number off the agent
curl --request DELETE \
--url https://guidinghand.ai/v1/agents/{agent_id}/phone_numbers/{phone_number_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://guidinghand.ai/v1/agents/{agent_id}/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/agents/{agent_id}/phone_numbers/{phone_number_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, 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>"
}
}Phone numbers
Take a phone number off the agent
The agent stops answering the number. It stays on Eager with no agent, and calls to it aren’t answered, until it’s given to an agent again or taken off Eager. Needs the admin role or an API key.
DELETE
/
v1
/
agents
/
{agent_id}
/
phone_numbers
/
{phone_number_id}
Take a phone number off the agent
curl --request DELETE \
--url https://guidinghand.ai/v1/agents/{agent_id}/phone_numbers/{phone_number_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://guidinghand.ai/v1/agents/{agent_id}/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/agents/{agent_id}/phone_numbers/{phone_number_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, 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>"
}
}Authorizations
An org API key (gh_live_…) from Settings → API keys in the console.
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"