Skip to main content

Assign Thread

Assign an SMS conversation thread to a specific user (e.g. a loan officer or sales rep). Once assigned:
  • The thread is marked as qualified (lead_outcome: "qualified")
  • AI auto-responses and drip messages are stopped for this thread
  • Non-admin users will only see threads assigned to them

Endpoint

POST /v1/threads/assign

Authentication

X-API-Key
string
required
Your API key

Request Body

campaign_id
string
required
The campaign ID containing the thread
phone_number
string
required
The contact’s phone number (E.164 format recommended, e.g. +15551234567)
assigned_user_id
string
required
The unique_id of the user to assign the thread to
organization_id
string
The organization’s unique_id
assigned_by
string
The unique_id of the admin performing the assignment

Response

success
boolean
Whether the assignment was successful
message
string
Human-readable result message
thread_id
string
The thread identifier (format: {phone_number}_{campaign_id})
assigned_to
object
Details of the assigned user

Example Request

curl -X POST "https://partner.teli.ai/api/proxy/v1/threads/assign" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "campaign_id": "camp_abc123",
    "phone_number": "+15551234567",
    "assigned_user_id": "user_xyz789",
    "organization_id": "org_456",
    "assigned_by": "admin_user_001"
  }'

Example Response

{
  "success": true,
  "message": "Thread assigned to Jane Smith",
  "thread_id": "+15551234567_camp_abc123",
  "assigned_to": {
    "user_id": "user_xyz789",
    "name": "Jane Smith"
  },
  "powered_by": "Teli"
}

Error Responses

400
{
  "error": "campaign_id, phone_number, and assigned_user_id are required",
  "success": false,
  "powered_by": "Teli"
}
404
{
  "error": "Thread not found for +15551234567 in campaign camp_abc123",
  "success": false,
  "powered_by": "Teli"
}
404
{
  "error": "User 'user_xyz789' not found",
  "success": false,
  "powered_by": "Teli"
}

Side Effects

Assigning a thread triggers the following:
  1. AI responses stop — the thread is marked as complete, so the AI agent will no longer auto-reply
  2. Drip messages cancelled — any scheduled follow-up messages are ended
  3. Lead outcome set — the contact’s lead_outcome is set to "qualified"
  4. Visibility filtered — non-admin users will only see threads assigned to them when fetching campaign contacts or messages