Multi-SMS Feature: This endpoint is only available for tenants with multiple SMS numbers per organization enabled. The standard configuration is one SMS number per organization.
Assign SMS Number to User
Assign an available SMS phone number to a specific user within the organization. Once assigned, the user’s campaigns will automatically use this number.
Admin Only: This endpoint requires admin permissions. Only organization admins can assign phone numbers.
Authentication
Bearer token with admin role
Path Parameters
The phone number to assign (E.164 format, URL encoded if needed)
Query Parameters
Organization unique_id. Required when a user exists in multiple organizations to ensure correct permission scoping.
Request Body
The user’s unique_id to assign the number to
Response
Whether the assignment was successful
The assigned phone number
The user who now owns the number
ISO timestamp of assignment
Example Request
curl -X POST "https://api.teli.ai/v1/sms/phone-numbers/+14155551234/assign" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"user_id": "user_xyz789"
}'
Example Response
{
"success": true,
"phone_number": "+14155551234",
"user_id": "user_xyz789",
"assigned_at": "2024-01-15T10:30:00Z",
"powered_by": "Teli"
}
Error Responses
403 Forbidden - Admin Required
{
"success": false,
"error": "Admin permission required",
"detail": "This action requires admin privileges"
}
400 Bad Request
{
"success": false,
"error": "Phone number not found"
}
{
"success": false,
"error": "Phone number already assigned to a user"
}
{
"success": false,
"error": "User not found"
}
Notes
- Only unassigned numbers can be assigned
- To reassign, first unassign from current user
- Assignment is immediate and affects all future campaigns
Unassign SMS Number
DELETE /v1/sms/phone-numbers//assign
Remove a user’s assignment from an SMS number, returning it to the organization’s available pool.
Admin Only: This endpoint requires admin permissions.
Example Request
curl -X DELETE "https://api.teli.ai/v1/sms/phone-numbers/+14155551234/assign" \
-H "X-API-Key: your-api-key" \
-H "Authorization: Bearer your-jwt-token"
Example Response
{
"success": true,
"phone_number": "+14155551234",
"powered_by": "Teli"
}
Notes
- Does not delete the phone number, only removes user assignment
- Number becomes available for assignment to another user
- Active campaigns using this number continue to work