PUT/api/v1/numbers/assignment
Phone Numbers
Assign Number
Both the number and assistant must be owned by the authenticated user. Use this to route inbound calls to a specific assistant.
Request
Endpoint
PUT
/api/v1/numbers/assignmentAuthentication
x-api-keyorAuthorization: BearerBody Parameters
| Name | Type | Description |
|---|---|---|
phone_numberrequired | string | Owned phone number to assign. |
assistant_idrequired | ObjectId | Owned assistant id. |
Request Body Example
body.json
{
"phone_number": "+919876543210",
"assistant_id": "66aa2b3c4d5e6f7a8b9c0d11"
}Notes
This endpoint changes live call routing for the selected phone number.
Response Example
response.json
{
"success": true,
"data": {
"phone_number": "+919876543210",
"assistant_id": "66aa2b3c4d5e6f7a8b9c0d11",
"assistant_name": "Sales Bot",
"message": "+919876543210 assigned to \"Sales Bot\""
}
}Status Codes
| HTTP | Meaning | Description |
|---|---|---|
| 200 | OK | Request succeeded. |
| 400 | Bad request | Malformed input, invalid ObjectId, or no updatable fields. |
| 401 | Unauthorized | Missing, invalid, inactive, or origin-restricted API key. |
| 404 | Not found | Resource was not found inside the authenticated user's scope. |
| 415 | Unsupported media type | Content-Type header is missing or is not application/json. |
| 422 | Validation error | JSON body failed schema or business validation. |
| 429 | Rate limited | Per-IP or per-key request budget was exceeded. |
Security Model
User-scoped by default
This endpoint only sees resources owned by the user attached to the API key. If another user's id is supplied, the API responds as if the resource does not exist.