Update a conversation

Halaman ini belum tersedia dalam Bahasa Indonesia. Menampilkan bahasa default (English).

Update a conversation

PUThttps://api.cekat.ai/api/conversations/{conversation_id}

Changes which AI agent replies in a conversation, and whether it stays assigned after the conversation is resolved. Each change adds a system note to the conversation.

Authorization

api_keystringheaderrequired

Your Cekat API key, from Settings → Developers & API in the Cekat dashboard.

Authorizationstringheader

Alternative to api_key: send the same key as Bearer YOUR_API_KEY.

Path parameters

conversation_idstring<uuid>required

Body application/jsonrequired

assigned_ai_agentstring<uuid>

ID of the AI agent to assign.

keep_assigned_ai_agent_on_resolveboolean

Keep the AI agent assigned after the conversation is resolved. Not allowed on inboxes that use a flow.

Response

200
400
401
404
429

Conversation updated.

successboolean
dataobject

The updated conversation record.

The AI agent was not found, keep_assigned_ai_agent_on_resolve is not a boolean, or the inbox uses a flow.

successboolean
messagestring
statusCodeinteger
errorobject
Show child attributes
messagestring
correlationIdstring

Request ID. Include it when contacting Cekat support.

The API key is missing or invalid.

successboolean
messagestring
statusCodeinteger
errorobject
Show child attributes
messagestring
correlationIdstring

Request ID. Include it when contacting Cekat support.

The resource was not found or does not belong to your business.

successboolean
messagestring
statusCodeinteger
errorobject
Show child attributes
messagestring
correlationIdstring

Request ID. Include it when contacting Cekat support.

Rate limit exceeded. Wait and retry.

messagestring
PUT/api/conversations/{conversation_id}
cURL
JavaScript
Python
PHP
curl --request PUT \
  --url 'https://api.cekat.ai/api/conversations/3c90c3cc-0d44-4b50-8888-8dd25736052a' \
  --header 'api_key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "assigned_ai_agent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "keep_assigned_ai_agent_on_resolve": true
}'
const response = await fetch('https://api.cekat.ai/api/conversations/3c90c3cc-0d44-4b50-8888-8dd25736052a', {
  method: 'PUT',
  headers: { 'api_key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "assigned_ai_agent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "keep_assigned_ai_agent_on_resolve": true
  })
});

const data = await response.json();
console.log(data);
import requests

url = "https://api.cekat.ai/api/conversations/3c90c3cc-0d44-4b50-8888-8dd25736052a"
headers = {"api_key": "YOUR_API_KEY"}
payload = {
    "assigned_ai_agent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "keep_assigned_ai_agent_on_resolve": True
}

response = requests.put(url, headers=headers, json=payload)
print(response.json())
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://api.cekat.ai/api/conversations/3c90c3cc-0d44-4b50-8888-8dd25736052a',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_HTTPHEADER => ['api_key: YOUR_API_KEY', 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode([
    'assigned_ai_agent' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'keep_assigned_ai_agent_on_resolve' => true
  ]),
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response
200
400
401
404
429
{
  "success": true,
  "data": {}
}
{
  "success": true,
  "message": "<string>",
  "statusCode": 1,
  "error": {
    "message": "<string>"
  },
  "correlationId": "<string>"
}
{
  "success": true,
  "message": "<string>",
  "statusCode": 1,
  "error": {
    "message": "<string>"
  },
  "correlationId": "<string>"
}
{
  "success": true,
  "message": "<string>",
  "statusCode": 1,
  "error": {
    "message": "<string>"
  },
  "correlationId": "<string>"
}
{
  "message": "<string>"
}