curl --request POST \
--url https://api.ciarem.ai/v1/conversations/{conversation_id}/assign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"keep_ai": false
}
'import requests
url = "https://api.ciarem.ai/v1/conversations/{conversation_id}/assign"
payload = {
"email": "<string>",
"keep_ai": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: '<string>', keep_ai: false})
};
fetch('https://api.ciarem.ai/v1/conversations/{conversation_id}/assign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ciarem.ai/v1/conversations/{conversation_id}/assign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '<string>',
'keep_ai' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ciarem.ai/v1/conversations/{conversation_id}/assign"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"keep_ai\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ciarem.ai/v1/conversations/{conversation_id}/assign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"keep_ai\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ciarem.ai/v1/conversations/{conversation_id}/assign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"keep_ai\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"channel_kind": "whatsapp",
"channel_id": "<string>",
"external_id": "<string>",
"display_name": "<string>",
"handled_by": "ai",
"status": "open",
"assignee_id": "<string>",
"team_id": "<string>",
"contact_id": "<string>",
"last_inbound_at": "2023-11-07T05:31:56Z",
"last_message_at": "2023-11-07T05:31:56Z",
"resolved_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"summary": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}Assign a conversation
Assign the conversation to a member, or unassign it, and return it.
With keep_ai: true the AI keeps answering while the member owns the
conversation, as with “keep it in my inbox” when handing a chat to the AI.
When the AI hands off, the conversation goes to that member, unless an
assignment rule names someone else. If a person already took the
conversation over, it moves to the new member and stays with a person.
Without keep_ai this works like assigning from the inbox: the member takes
the conversation over and the AI stops, also when the member already owned
it while the AI answered.
Unassigning sends the conversation back to the queue for automatic
assignment, or, with keep_ai, leaves it with the AI. A conversation with
no assignee that the AI is answering stays with the AI either way.
A new assignee gets the conversation unread, and a conversation.assigned
webhook is sent. Assigning the current assignee sends no webhook.
422 member_not_found when no current member of the organization has that
email. 422 assignee_is_viewer when that member has the Viewer role,
which reads but takes no chats. 409 conversation_resolved when the conversation
is resolved: the contact’s next message opens a new conversation, so assign
that one.
curl --request POST \
--url https://api.ciarem.ai/v1/conversations/{conversation_id}/assign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"keep_ai": false
}
'import requests
url = "https://api.ciarem.ai/v1/conversations/{conversation_id}/assign"
payload = {
"email": "<string>",
"keep_ai": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: '<string>', keep_ai: false})
};
fetch('https://api.ciarem.ai/v1/conversations/{conversation_id}/assign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ciarem.ai/v1/conversations/{conversation_id}/assign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '<string>',
'keep_ai' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ciarem.ai/v1/conversations/{conversation_id}/assign"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"keep_ai\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ciarem.ai/v1/conversations/{conversation_id}/assign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"keep_ai\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ciarem.ai/v1/conversations/{conversation_id}/assign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"keep_ai\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"channel_kind": "whatsapp",
"channel_id": "<string>",
"external_id": "<string>",
"display_name": "<string>",
"handled_by": "ai",
"status": "open",
"assignee_id": "<string>",
"team_id": "<string>",
"contact_id": "<string>",
"last_inbound_at": "2023-11-07T05:31:56Z",
"last_message_at": "2023-11-07T05:31:56Z",
"resolved_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"summary": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}Body
Response
Successful Response
Lifecycle of a conversation. resolved is terminal: the contact's next
message opens a fresh conversation. There is no expired value: WhatsApp
24h "expiry" is a derived window state (now - last_inbound_at >= 24h),
not a lifecycle status — an expired thread is still open. (closed was
dropped by migration 0200: nothing distinguished it from resolved.)
open, resolved