Give the agent a phone number
curl --request POST \
--url https://guidinghand.ai/v1/agents/{agent_id}/phone_numbers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number_id": "pn_3f9a0c1d2e4b5a6978c1d2e3",
"connection_id": "pc_8c1d2e3f9a0c1d2e4b5a6978",
"number": "+14155550123"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number_id: 'pn_3f9a0c1d2e4b5a6978c1d2e3',
connection_id: 'pc_8c1d2e3f9a0c1d2e4b5a6978',
number: '+14155550123'
})
};
fetch('https://guidinghand.ai/v1/agents/{agent_id}/phone_numbers', 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"
payload = {
"phone_number_id": "pn_3f9a0c1d2e4b5a6978c1d2e3",
"connection_id": "pc_8c1d2e3f9a0c1d2e4b5a6978",
"number": "+14155550123"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(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>"
}
}{
"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
Give the agent a phone number
Gives the agent one of the org’s numbers on Eager (phone_number_id), or adds a number from a connected Twilio account (connection_id and number) and gives it to the agent. A number another agent answers moves to this one. Needs the admin role or an API key.
POST
/
v1
/
agents
/
{agent_id}
/
phone_numbers
Give the agent a phone number
curl --request POST \
--url https://guidinghand.ai/v1/agents/{agent_id}/phone_numbers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number_id": "pn_3f9a0c1d2e4b5a6978c1d2e3",
"connection_id": "pc_8c1d2e3f9a0c1d2e4b5a6978",
"number": "+14155550123"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number_id: 'pn_3f9a0c1d2e4b5a6978c1d2e3',
connection_id: 'pc_8c1d2e3f9a0c1d2e4b5a6978',
number: '+14155550123'
})
};
fetch('https://guidinghand.ai/v1/agents/{agent_id}/phone_numbers', 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"
payload = {
"phone_number_id": "pn_3f9a0c1d2e4b5a6978c1d2e3",
"connection_id": "pc_8c1d2e3f9a0c1d2e4b5a6978",
"number": "+14155550123"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(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>"
}
}{
"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
The agent’s id, e.g. billing.
Body
application/json
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"