Tag chat

Add tags to a chat, or remove them.

POST https://cotlet.dev/api/v1/livechat/chats/{chat_id}/tag

write

Adds the tags in add to a chat and removes the tags in remove. Tags must already exist in Settings > Tags, which only admins and the owner can change, and must be visible to your role. Works on active and archived chats. Tagging reaches no customer and is undone with one call, so tag_chat runs without asking first.

Parameters

Parameters: tag_chat
NameTypeDescription
chat_id string required string Chat ID from list_chats or list_archived_chats.
add string[] string[] Tag names to add.
remove string[] string[] Tag names to remove.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/livechat/chats/PJ0MRSHTDG/tag \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"add":["refund"]}'
Python
result = client.call("livechat", "tag_chat", {"chat_id":"PJ0MRSHTDG","add":["refund"]})
Node.js
const result = await cotlet.call('livechat', 'tag_chat', {"chat_id":"PJ0MRSHTDG","add":["refund"]});
CLI
cotlet call livechat tag_chat --data '{"chat_id":"PJ0MRSHTDG","add":["refund"]}'

Example response

JSON

{
  "chat_id": "PJ0MRSHTDG",
  "added": [
    "refund"
  ],
  "removed": [],
  "tags": [
    "refund"
  ]
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.