Assign conversation to a team member
Hands a conversation to a team member (subaccount). Use the public ID (sub_...) of the team member as
returned by List subaccounts; the numeric ID is accepted too. Sending null (or no
team_member) releases the conversation; its status is kept. When the request is made by a team user,
that team member is recorded as the one who assigned the conversation.
Base URL:
PUT: https://api.smsgatewayapi.com/v1/conversations/{key}/assignmentExample:
PUT: https://api.smsgatewayapi.com/v1/conversations/32470123456/assignment
| Parameter | Input | Description | |
|---|---|---|---|
| client_id | API client ID | Developer › API & Webhooks › API credentials | Required |
| client_secret | API client secret | A cs_ credential, shown once when you create it under Developer › API & Webhooks › API credentials | Required |
| key | conversation key | The conversation as shown in your conversation list: a phone number in international format (e.g. 32470123456), a WhatsApp user ID for a user without phone number (BE.… for WhatsApp Business, WA.LID… for WhatsApp Web) or group:gid_… for a group conversation (the numeric group ID is accepted too). Group keys are always returned with the public group ID. | Required |
| team_member | id of a team member | Public ID (sub_...) or numeric ID of an active team member of your account. null, empty or omitted releases the conversation | Optional |
<?php
//PHP - cURL
$ch = curl_init();
$url = "https://api.smsgatewayapi.com/v1/conversations/{key}/assignment";
$client_id = "XXX"; // Your API client ID (required)
$client_secret = "YYY"; // Your API client secret (required)
$data = [
'team_member' => "sub_3520a1ec234dbabe1232def67e858855" //Public ID of the team member, null releases (optional)
];
curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-Client-Id: $client_id",
"X-Client-Secret: $client_secret",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
?>
Example request:
{
"team_member": "sub_3520a1ec234dbabe1232def67e858855"
}
Example success response:
{
"conversation_key": "32470123456",
"assignee": {
"public_id": "sub_3520a1ec234dbabe1232def67e858855",
"name": "alice"
},
"status": "open",
"assigned_at": "2026-09-07 10:15:00"
}
Example error response:
{
"error": 143,
"errorMsg": "Team member not found"
}