The chat inbox — conversations, messages, contacts, and teams — is served by a v1
API under /api/v1/chat/. It predates the v2 conventions and does not share them. Read
this page once before you write against it; everything else in the API Reference describes
v2.
Base URL and authentication
curl -X GET "https://agent-studio.seeyu.ai/api/v1/chat/conversations?workspaceId=WORKSPACE_ID" \
-H "X-API-Key: YOUR_API_KEY"Authentication is the same X-API-Key header as the rest of the API — see
Authentication.
Every operation names a workspace
workspaceId is a required query parameter on every read and a required body field on
every write. There is no implicit workspace: a request without it is a 400.
A workspace-scoped API key can only ever reach its own workspace. If a request names a
different workspaceId, the API answers 403 before any query runs. See
Workspace scoping for the full rules and
the three distinct 403 messages.
Because resources are always resolved inside workspaceId, a conversation, contact, or
team that lives in another workspace is reported as 404 not found rather than as denied —
the API is never an existence oracle for a workspace you cannot reach.
Who an action is attributed to
With a personal key, messages and conversation changes are attributed to the key's owner.
With a workspace key they appear as Robô: a message carries senderType: "User" and
senderId: "robot", and a conversation change appears as Robô in the conversation's
activity, for example "Robô atribuiu a conversa à equipe Suporte" (Robô assigned the
conversation to the Suporte team). A Robô message still counts as an agent's reply for the
first response, the SLA response target, and the contact's waiting time, and agent
variables such as {{agent.name}} render empty in it. Assigning an agent or a team while
the AI agent is answering pauses the AI agent, and its panel shows "Pausado por Robô".
Use a workspace key for automations, so no collaborator's name appears on actions they did not take.
What a personal key may do
A personal key acts as its owner and never does more than they can in the app, right now. Each request is held to the owner's current access in the workspace, the same checks the inbox applies to them:
- Conversations they can reach. Lists return only the conversations of the owner's
inboxes, teams and conversation access. A conversation outside it is answered
404, the same as one in another workspace, whether you read it, read its messages, send into it, or update it. - What their role allows. Starting a conversation, sending a message (private notes
included), updating a conversation (labels included), assigning an agent or a team, and
creating, editing or deleting a contact each need the owner's role to allow it. Assigning inside a create or an
update is checked on its own, so a role that may update but not assign can still change a
status but not a
teamIdorassigneeId. - What the request carries. Creating a conversation needs the key permission
chat_conversations.create, and alsochat_messages.sendwhen you send a first message. Resolving a conversation that a conversation form applies to for the owner is refused with422andcode: "conversation_tabulation_invalid", because the app asks for the form first;missingFieldsnames its required fields. - The inbox's signature. When an inbox requires a message signature, a personal key's message is signed as the owner's would be.
A refusal from the owner's role is a 403 that names what is missing:
{
"error": "The owner of this API key can't use the chat_messages.send permission: their role in this workspace doesn't allow disableChatMessageSend",
"details": {
"code": "API_KEY_OWNER_PERMISSION_DENIED",
"permission": "chat_messages.send",
"control": "disableChatMessageSend"
}
}details.permission is the key permission refused and details.control the part of the
role that withholds it, for example disableChatConversationCreate (starting a
conversation), disableChatMessageSend (sending messages), disableChatConversationUpdate
(updating a conversation), disableChatConversationAssign (assigning),
disableChatContactCreate (creating a contact), disableChatContactEdit (editing a contact)
or disableChatContactDelete (deleting a contact). An organization admin can change the role.
A workspace key is Robô and is not held to any person's access: it reaches the whole workspace within what the key itself was granted.
Responses are bare objects, not { data }
v2 wraps every success in { "data": ... }. v1 does not:
{ "conversation": { "id": "conv_...", "status": "open" } }{ "conversations": [ ... ], "pagination": { "page": 1, "perPage": 25, "total": 42, "totalPages": 2 } }Errors are flat
v2 answers { "error": { "code": "...", "message": "..." } }. v1 answers a flat object
whose only guaranteed field is error:
| Status | Body | Meaning |
|---|---|---|
400 | { error, details } | The request failed validation. details lists the failing fields. |
400 | { error, code } | The request is valid but names something the operation cannot use. See below. |
401 | { error } | The X-API-Key header is missing, malformed, expired, or revoked. |
403 | { error, details? } | The key may not do this in this workspace. details.code names why: API_KEY_OWNER_PERMISSION_DENIED when a personal key's owner may not, with details.permission and details.control (see What a personal key may do); API_KEY_PERMISSION_DENIED when the key itself was not granted the action. |
404 | { error } | No such resource in this workspace. |
409 | { error, code, ... } | The request collides with existing state. See below. |
422 | { error, code, missingFields? } | A personal key resolved a conversation whose conversation form must be filled in first (conversation_tabulation_invalid), or a contact being deleted is connected right now (contact_online). |
429 | { error, message, retryAfter } | Rate limited. Prefer the Retry-After header, which is in seconds. |
500 | { error, requestId } | Unexpected server error. Quote requestId in a support request. |
Branch on the HTTP status and, for a 409, a coded 400 or a 422, on code; for a 403,
on details.code. The error string is human-readable and is not a stable contract.
Recovering from a 409
Three operations can conflict, and each hands you the blocking record so you can reuse it instead of retrying.
POST /api/v1/chat/conversations → code: "active_conversation_exists". The contact
already has a conversation in progress in that inbox. The conversation field carries it
— continue the thread there. Conversations in the contact's other inboxes do not block.
POST /api/v1/chat/contacts → code: "PHONE_ALREADY_EXISTS". Another contact in the
workspace already holds that phone number, normalized to digits. The response carries
contactId, contactName, phone, and conversationId — the existing contact's most
recently active conversation, or null. With a personal key, conversationId is only ever a
conversation its owner can reach.
PATCH /api/v1/chat/contacts/{contactId} → code: "PHONE_ALREADY_EXISTS". The new phone
number belongs to another contact in the workspace. contactId names that contact; nothing was
changed.
Opening a conversation for a team
POST /api/v1/chat/conversations with a teamId → 400 and code: "team_not_in_inbox"
unless the team serves the inbox: at least one member of the team is also a member of the
inbox. A team with no such member could never be assigned the conversation. When the team
serves the inbox, the conversation stays on it and is assigned to a member of both, or waits
in the team's queue. An inboxId or contactId that is not the workspace's is answered 404.
Updating and deleting a contact
PATCH /api/v1/chat/contacts/{contactId} changes a contact. Send workspaceId and only the
fields to change: a field you leave out is kept, and null clears it. customAttributes is
merged into the attributes the contact already has, so a key you leave out is kept.
curl -X PATCH "https://agent-studio.seeyu.ai/api/v1/chat/contacts/CONTACT_ID" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workspaceId": "WORKSPACE_ID",
"lastName": "Ribeiro",
"email": "ana.ribeiro@example.com",
"customAttributes": { "plan": "enterprise" }
}'The response is the contact after the update, in the same shape GET /api/v1/chat/contacts/{contactId} returns:
{ "contact": { "id": "cnt_...", "name": "Ana Ribeiro", "email": "ana.ribeiro@example.com", "customAttributes": { "plan": "enterprise" } } }firstName cannot be cleared. A phone number another contact of the workspace holds is refused
with 409 (see Recovering from a 409), and correcting a phone makes
the next WhatsApp message go to the new number. identifier cannot be changed: it holds the id
WhatsApp issued for the contact.
DELETE /api/v1/chat/contacts/{contactId} deletes a contact, with workspaceId in the query.
It cannot be undone. The contact's conversations stay, without a contact, and can no longer send.
curl -X DELETE "https://agent-studio.seeyu.ai/api/v1/chat/contacts/CONTACT_ID?workspaceId=WORKSPACE_ID" \
-H "X-API-Key: YOUR_API_KEY"{ "success": true, "contactId": "cnt_..." }A contact connected right now, as a website visitor with the chat widget open, is kept: the call
answers 422 with code: "contact_online". Retry once they have left.
The key needs chat_contacts.update to edit a contact and chat_contacts.delete to delete one.
A personal key does either as its owner, so the owner's role must also allow editing contacts
(disableChatContactEdit) or deleting them (disableChatContactDelete).
Pagination
Most v1 chat lists page by offset, with page and perPage (both integers; perPage
caps at 100), and return a pagination object:
{ "page": 2, "perPage": 25, "total": 130, "totalPages": 6 }Offset pagination is not a stable snapshot. Conversations are ordered by most recent
activity, so a conversation whose activity changes between two requests can appear on two
pages or on none. For a consistent sweep, filter to a fixed status or process pages
back to front.
Two endpoints differ, both preserved from the original release:
GET /api/v1/chat/contactsuseslimitinstead ofperPage, and itspaginationobject carrieslimitinstead ofperPage.GET /api/v1/chat/conversations/{conversationId}/messagesis cursor-paginated instead. Omitbeforefor the latest page, then passmeta.beforefrom each response to walk backwards untilmeta.hasMoreisfalse. Messages come back oldest-first within a page.
Interactive WhatsApp messages
On a WhatsApp inbox, a message can give the contact options to tap instead of a reply to
type. Send them as contentAttributes.items on
Send Message, or on the first message of
Create Conversation:
curl -X POST "https://agent-studio.seeyu.ai/api/v1/chat/conversations/CONVERSATION_ID/messages" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workspaceId": "WORKSPACE_ID",
"content": "Selecione o setor com o qual deseja falar:",
"contentAttributes": {
"button": "Menu",
"sectionTitle": "Setores",
"items": [
{ "title": "Financeiro", "value": "1" },
{ "title": "Comercial", "value": "2" },
{ "title": "Secretaria", "value": "3" },
{ "title": "Livraria", "value": "4" }
]
}
}'content is the text shown above the options. Each item is { title, value, description? }:
the contact sees title, and value comes back when they tap it, so give every item a
different value. How many items you send decides how they appear:
| Items | Sent as | title | description | value |
|---|---|---|---|---|
| 1 to 3 | Reply buttons | up to 20 characters | not shown | up to 256 characters |
| 4 to 10 | A list the contact opens with a button | up to 24 characters | up to 72 characters | up to 200 characters |
A list sends the first 10 items and drops the rest. Two more keys set its labels, and reply buttons ignore both:
| Key | What it sets | Limit | Default |
|---|---|---|---|
button | The label of the button that opens the list | 20 characters | Selecionar |
sectionTitle | The title above the options | 24 characters | Opções |
A title, description or label over its limit is cut to fit rather than rejected, and a
blank label falls back to its default. A value is sent as is, so keep it within its limit.
Leave contentType at its default: WhatsApp reads items whatever the type.
The contact's tap arrives as an incoming message whose content is the option's title.
Its contentAttributes.interactive holds WhatsApp's reply, with your value as
button_reply.id or list_reply.id. Match on that value rather than on the title.
Options are a free-form message, so WhatsApp only delivers them inside the 24-hour window that opens each time the contact writes to you. Outside it, start with an approved template.
Campaign messages in a conversation
When a contact replies to a WhatsApp campaign inside its response window, the conversation
the reply lands in gets a copy of the campaign message that contact received.
List Messages returns it with
messageType: "template" and a contentAttributes.campaign object:
{
"messageType": "template",
"content": "Olá Ana! Só hoje: 30% de desconto no plano anual. Toque em Quero para garantir.",
"senderType": null,
"senderId": null,
"contentAttributes": {
"campaign": {
"campaignId": "CAMPAIGN_ID",
"deliveryId": "DELIVERY_ID",
"name": "Black Friday",
"sentAt": "2026-10-30T12:00:00.000Z"
}
},
"createdAt": "2026-10-30T12:00:00.000Z"
}The copy is a record of what was sent, not a message sent from the conversation:
- It was not sent to the contact. Writing it delivers nothing, notifies no one and does not
count as an agent's reply. It has no sender, so
senderTypeandsenderIdarenull. - It has no message id of its own on WhatsApp. The id of the original send, when known, is
in
contentAttributes.campaign.sourceId. - It is dated at the send.
createdAtis when the campaign went out (or just before the reply, when both fall in the same second), so the copy sits where the contact saw it, which can be before messages exchanged between the send and the reply.
content is the text the contact received, with the template's header, body, footer and
buttons. status is delivered or read as it stood when the copy was written; the campaign's
results stay the source for delivery counts. Only the first reply to each send gets a copy.
To tell the copy apart, check for contentAttributes.campaign rather than messageType,
which the inbox greeting shares.
Rate limits
Every response carries X-RateLimit-Limit, X-RateLimit-Remaining, and
X-RateLimit-Reset. A 429 adds Retry-After in seconds — add jitter rather than
retrying at exactly that offset. Limits are per plan and shared with the rest of the API.