{
"success": true,
"message": "<string>",
"data": null
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Assistant Phone Numbers
Assign Phone Number by String
Assign a phone number to an assistant by phone number string.
Auto-syncs from Twilio if the number doesn’t exist locally and auto_sync is True. This is the recommended way to assign newly purchased Twilio numbers.
Args: assistant_id: ID of the assistant to assign the phone number to request: JSON request containing phone_number, friendly_name (optional), and auto_sync
POST
/
api
/
v1
/
assistants
/
{assistant_id}
/
phone-numbers
/
assign-by-number
{
"success": true,
"message": "<string>",
"data": null
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}This endpoint assigns an available phone number from your organization to a specific assistant. The phone number must already exist within your organization’s pool of numbers and not be currently assigned to another assistant.
Path Parameters
assistant_id(string, required): The unique identifier of the assistant to whom the phone number will be assigned.
Request Body
phone_number(string, required): The phone number to assign, specified in E.164 format (e.g.,+15551234567).
Request
{
"phone_number": "+15551234567"
}
Response
A successful assignment will return the updated phone number object, which now includes theassistant_id.
Response
{
"id": "pn_1a2b3c4d5e6f7g8h",
"phone_number": "+15551234567",
"assistant_id": "asst_a1b2c3d4e5f67890",
"organization_id": "org_67890",
"created_at": "2023-10-26T11:00:00Z",
"updated_at": "2023-10-28T14:00:00Z"
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Schema for assigning a phone number to an assistant.
⌘I