Assign a phone number to an agent. This enables the agent to handle inbound calls to this number.
For Twilio phone numbers, this endpoint automatically configures the webhook URLs in Twilio.
Your API key for authentication.
Must be application/json.
Path Parameters
The unique identifier of the agent.
Request Body
The unique identifier of the phone number to assign (format: phon_[a-f0-9]{12,}).
Permissions
phone_numbers:update (admin, agent_manager)
Response
Indicates if the assignment was successful.
Human-readable success message.
The updated agent object.
{
"phone_number_id": "phon_b2c3d4e5f6a7"
}
{
"success": true,
"message": "Phone number assigned successfully",
"data": {
"agent_id": "agent_a1b2c3d4e5f6",
"agent_name": "Sales Rep",
"assigned_phone_number_ids": ["phon_b2c3d4e5f6a7"],
"updated_at": "2024-01-20T14:45:00Z"
}
}
Errors
Agent or phone number not found.
Access denied to agent or phone number belongs to different organization.
Phone number already assigned to another agent, or already assigned to this agent.
Phone number has no associated integration (for Twilio numbers).