Unassign Conversation
Remove an agent or a team from a conversation. Supply its conversation_id in the path and either agent_id or user_group_id in the JSON body, not both. Other agents and teams on the conversation are not changed.
Unassigning an agent or team that is currently assigned also removes a Chatway AI assistant from the conversation. Unassigning an agent or team that is not assigned succeeds without changes and returns changed: false, so it is safe to retry.
Returns 200 OK with the resulting assignment.
POST https://developers.chatway.app/api/v1/conversations/{conversation_id}/unassignExample request
curl -X POST "https://developers.chatway.app/api/v1/conversations/0f46c0a1-8938-40e3-b2b5-bb56f569fcab/unassign" \
-H "X-API-KEY: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "26fa75f2-7ac1-47b4-84e1-b943491ba4da"
}'Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
conversation_id | path | Yes | string | Conversation ID Example: 0f46c0a1-8938-40e3-b2b5-bb56f569fcab |
Request body
application/json
agent_id (string|null)— Agent ID to unassign. Required when user_group_id is not sent.user_group_id (string|null)— Team (user group) ID to unassign. Required when agent_id is not sent.
Responses
200
application/json
message (string enum: Conversation unassigned., required)data (object, required)conversation_id (string, required)agent_id (string|null, required)— Set when the request used agent_id; otherwise null. Only one of agent_id and user_group_id is populated.user_group_id (string|null, required)— Set when the request used user_group_id; otherwise null. Only one of agent_id and user_group_id is populated.is_assigned (boolean, required)changed (boolean, required)
422
404
Conversation not found
application/json
message (string, required)
409
Another change to this conversation is in progress. Retry the request.
application/json
message (string, required)
429
Conversation action limit reached. Each account can assign or unassign up to 30 conversations per minute, shared with its MCP connections. Wait for the number of seconds in the Retry-After header before retrying.
application/json
message (string, required)retry_after (integer, required)
Examples
Request body example
{
"agent_id": "26fa75f2-7ac1-47b4-84e1-b943491ba4da"
}Response 200 example
{
"message": "Conversation unassigned.",
"data": {
"conversation_id": "0f46c0a1-8938-40e3-b2b5-bb56f569fcab",
"agent_id": "26fa75f2-7ac1-47b4-84e1-b943491ba4da",
"user_group_id": null,
"is_assigned": false,
"changed": true
}
}