Skip to content
v1

Reference Conversations

Conversations

List and fetch a team's conversations on every channel, with their status, assignee, whether a person has taken them over and when the last messages came and went. Separate permissions control message content and delivery.

Overview

A conversation is one thread with a lead, on one channel and business account: WhatsApp, email, the web chat (chatbot), Facebook, Instagram, SMS or TikTok. A lead can have several conversations on the same channel and business account, one for each contact address (phone number, email address or handle) it has used, so key your copy on the conversation's id. The list and detail endpoints return conversation metadata:

  • channel_type: the channel, or null for a channel this version of the API does not know.
  • status: active or archived in the team's inbox.
  • assignee: the team member the conversation is assigned to, or null.
  • reply_mode: human while a person has taken the conversation over, including a WhatsApp chat answered from the WhatsApp Business app, and ai otherwise. ai means no takeover is active; it does not mean an assistant is set up or answering on that channel. A takeover with a time limit goes back to ai when it ends, and the conversation gets a new version then.
  • last_inbound_at and last_outbound_at: when the latest message came in from the customer, and when the latest message that did not fail went out to them. Erased messages, imported WhatsApp history and web-chat visitor messages do not count as inbound, so a chatbot conversation reads null there. Imported WhatsApp history does count as outbound.

The contact's name, phone number or handle travel on the linked lead, not on the conversation. For the picture across all of a lead's channels, read the lead's response facet with GET /v1/leads/{id}.

Use GET /v1/conversations and GET /v1/conversations/{id} to look conversations up; GET /v1/conversations?lead= lists one lead's conversations. To keep a copy, follow the changes feed: Keep a copy in sync explains it.

Message content and delivery

POST /v1/conversations/messages reads a bounded page of the selected current conversation only with the separate message-content permission. A truncated page is not a complete export; attachment metadata does not grant attachment content.

Use POST /v1/messages/channels to discover current configured senders. POST /v1/messages/send accepts a current conversation or an owned lead and a returned sender reference. The destination is resolved from current records rather than a raw address supplied by the caller. Text, approved WhatsApp templates, calling invitations and reviewed Library selections retain their own channel and recipient checks. Explicit consent assertions never override opt-outs.

POST /v1/messages/requested-info admits the configured requested-information response; its receipt does not certify delivery. POST /v1/messages/prepare-reply prepares the canonical first response for the current conversation without claiming that it reached a provider. Observe asynchronous operations and reconcile uncertain outcomes before repeating an effect.

List conversations

GET /v1/conversations

Returns a page of the team's conversations, one per channel, business account and contact address: channel, inbox status, assignee and the times of the latest inbound and outbound messages. Pass lead for one lead's conversations. Message content is never exported.

Scopes
messages:read
Rate limit
Sync

Query parameters

  • limit integer Range 1–100 Default 25

    Items per page, 1–100. Defaults to 25.

  • cursor string 1–512 chars

    The next_cursor of the previous page. Omit it for the first page.

  • lead string ID prefix lead_…

    Only the conversations linked to this lead: every item's lead is this id. A lead of another team, or one that does not exist, matches nothing.

Headers

  • Totem-Team string Conditional ID prefix team_…

    The team to read, as a team_… id. Omit it when the key reads one team; it is required when the key reads several (400 team_required). When you send it, it must name a team the key reads: a malformed id gets 400 invalid_request, and a team outside the key gets 404 team_not_accessible, as does a request without it once the key reads no team at all.

Returns

Returns a list of Conversation objects.

  • object string

    Always list.

  • data Array<Conversation>

    The items of this page.

  • has_more boolean

    true when another page follows: fetch it with next_cursor, even if this page holds fewer items than limit.

  • next_cursor string Nullable

    Opaque cursor for the next page, or null on the last page. Never parse it.

Errors

+ 12 common errors

GET /v1/conversations
curl 'https://api.totemstudio.ai/v1/conversations?limit=25' \
  -H "Authorization: Bearer $TOTEM_API_KEY" \
  -H "Totem-Team: $TOTEM_TEAM_ID"
Response · 200JSON
{
  "object": "list",
  "data": [
    {
      "id": "conv_m3GhGjRHmFbww1g10oqOp7j3gWqPJ",
      "object": "conversation",
      "livemode": false,
      "team": "team_r9uYrIW4gSFJJ6hZQ9ip1UIpPaAD1CF7NR",
      "lead": "lead_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMXKSF0QbLS8CiUKJpEP34LFQG",
      "channel_type": "whatsapp",
      "status": "active",
      "assignee": "mem_h548E7UiYhutHhucVrQCzkM0eaea0",
      "reply_mode": "ai",
      "created_at": "2026-09-28T10:16:00.000Z",
      "last_inbound_at": "2026-10-01T08:58:00.000Z",
      "last_outbound_at": "2026-10-01T08:59:30.000Z",
      "version": 12,
      "updated_at": "2026-10-01T08:59:31.040Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Get a conversation

GET /v1/conversations/{id}

Returns one conversation by its id, without message content. A conversation this key cannot read, or one that was removed, answers 404 resource_missing.

Scopes
messages:read
Rate limit
Read

Path parameters

  • id string Required ID prefix conv_…

    The conversation's public id.

Returns

Returns a Conversation object.

Errors

+ 12 common errors

GET /v1/conversations/{id}
curl 'https://api.totemstudio.ai/v1/conversations/conv_m3GhGjRHmFbww1g10oqOp7j3gWqPJ' \
  -H "Authorization: Bearer $TOTEM_API_KEY"
Response · 200JSON
{
  "id": "conv_m3GhGjRHmFbww1g10oqOp7j3gWqPJ",
  "object": "conversation",
  "livemode": false,
  "team": "team_r9uYrIW4gSFJJ6hZQ9ip1UIpPaAD1CF7NR",
  "lead": "lead_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMXKSF0QbLS8CiUKJpEP34LFQG",
  "channel_type": "whatsapp",
  "status": "active",
  "assignee": "mem_h548E7UiYhutHhucVrQCzkM0eaea0",
  "reply_mode": "ai",
  "created_at": "2026-09-28T10:16:00.000Z",
  "last_inbound_at": "2026-10-01T08:58:00.000Z",
  "last_outbound_at": "2026-10-01T08:59:30.000Z",
  "version": 12,
  "updated_at": "2026-10-01T08:59:31.040Z"
}

Read current conversation messages

POST /v1/conversations/messages

Reads a bounded latest slice of retained message text under its separate explicit content grant; existing messages:read keys remain metadata-only. Hosted executions derive their exact current conversation, and any supplied opaque id must match it. Media locations, provider identifiers and erased messages are withheld, with explicit truncation.

Scopes
messages:content:read
Rate limit
Read

Headers

  • Totem-Team string Conditional ID prefix team_…

    The team to read, as a team_… id. Omit it when the key reads one team; it is required when the key reads several (400 team_required). When you send it, it must name a team the key reads: a malformed id gets 400 invalid_request, and a team outside the key gets 404 team_not_accessible, as does a request without it once the key reads no team at all.

Request body

Read at most fifty latest retained messages of the exact conversation; hosted processing can derive its signed source.

  • conversation_id string ID prefix conv_…

    Current conversation in the selected team. Tenant integrations must supply its identifier; hosted processing may derive its exact signed source.

  • limit integer Range 1–50 Default 20

    Maximum number of latest retained messages to return, from one to fifty.

Returns

Returns a ConversationMessages object.

Errors

+ 12 common errors

POST /v1/conversations/messages
# Fictional fixtures: replace references and dates with current API values.
# Send consent or confirmation attestations only after the person confirms.
curl -X POST 'https://api.totemstudio.ai/v1/conversations/messages' \
  -H "Authorization: Bearer $TOTEM_API_KEY" \
  -H "Totem-Team: $TOTEM_TEAM_ID" \
  -H "Content-Type: application/json" \
  --data '{"conversation_id": "conv_m3GhGjRHmFbww1g10oqOp7j3gWqPJ", "limit": 25}'
Response · 200JSON
{
  "object": "conversation_messages",
  "messages": [],
  "truncated": false
}

List current message senders

POST /v1/messages/channels

Returns bounded opaque references to currently configured permitted sending channels. It exposes no provider account identifiers, destinations or message content; sending rechecks the current connection and recipient.

Scopes
messages:send
Rate limit
Read

Headers

  • Totem-Team string Conditional ID prefix team_…

    The team to read, as a team_… id. Omit it when the key reads one team; it is required when the key reads several (400 team_required). When you send it, it must name a team the key reads: a malformed id gets 400 invalid_request, and a team outside the key gets 404 team_not_accessible, as does a request without it once the key reads no team at all.

Returns

Returns a MessageChannels object.

Errors

+ 12 common errors

POST /v1/messages/channels
# Fictional fixtures: replace references and dates with current API values.
# Send consent or confirmation attestations only after the person confirms.
curl -X POST 'https://api.totemstudio.ai/v1/messages/channels' \
  -H "Authorization: Bearer $TOTEM_API_KEY" \
  -H "Totem-Team: $TOTEM_TEAM_ID" \
  -H "Content-Type: application/json" \
  --data '{}'
Response · 200JSON
{
  "object": "message_channels",
  "channels": [
    {
      "reference": "mch1_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "channel_type": "chatbot",
      "name": "Example chat"
    }
  ]
}

Queue the configured information response

POST /v1/messages/requested-info

Queues staff-configured requested information for the current authorized lead. Current server configuration selects the WhatsApp or designed-email channel, sender and template; raw destinations and caller-selected templates are refused. The receipt confirms queue admission without claiming delivery; reuse Idempotency-Key after an uncertain acknowledgement.

Scopes
messages:send
Rate limit
write

Headers

  • Totem-Team string Conditional ID prefix team_…

    The team to read, as a team_… id. Omit it when the key reads one team; it is required when the key reads several (400 team_required). When you send it, it must name a team the key reads: a malformed id gets 400 invalid_request, and a team outside the key gets 404 team_not_accessible, as does a request without it once the key reads no team at all.

  • Idempotency-Key string Required 1–255 chars Pattern ^[\x21-\x7e]+$

    One unique visible-ASCII key per logical write; reuse exactly on retries and never retry outcome_unknown automatically.

Request body

Enqueue the current configured information response for the authorized contact through the canonical requested-information queue.

  • lead_id string ID prefix lead_…

    Current retained lead; hosted processing may derive its exact signed source.

  • info string Required 1–500 chars

    The information requested by the contact, up to five hundred characters. The current staff configuration selects the sender and template.

Returns

Returns an Operation object.

Errors

+ 12 common errors

POST /v1/messages/requested-info
# Fictional fixtures: replace references and dates with current API values.
# Send consent or confirmation attestations only after the person confirms.
curl -X POST 'https://api.totemstudio.ai/v1/messages/requested-info' \
  -H "Authorization: Bearer $TOTEM_API_KEY" \
  -H "Totem-Team: $TOTEM_TEAM_ID" \
  -H "Idempotency-Key: ${TOTEM_IDEMPOTENCY_KEY:?Set one unique key for this logical write}" \
  -H "Content-Type: application/json" \
  --data '{"lead_id": "lead_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMXKSF0QbLS8CiUKJpEP34LFQG", "info": "Requested the first-visit information."}'
Response · 202JSON
{
  "object": "operation",
  "id": "op_m3yGe1tkVy6hn3m9LH9m7e640wg0O",
  "status": "queued",
  "endpoint": "messages.requestInfo",
  "created_at": "2026-10-01T09:30:00.000Z",
  "updated_at": "2026-10-01T09:30:00.000Z",
  "result": null,
  "error": null
}

Prepare the configured first reply

POST /v1/messages/prepare-reply

Processes the configured first-reply campaign for the exact saved inbound conversation, preserving lifetime deduplication, human control and newer-message fences. Tenant integrations provide an owned conversation while hosted execution derives its signed source; configured Library content may be sent or prepared for webchat. Read the completed receipt before continuing the assistant because 202 only accepts the intent; private source identifiers and provider URLs are withheld.

Scopes
messages:sendmessages:content:readlibrary:read
Rate limit
write

Headers

  • Totem-Team string Conditional ID prefix team_…

    The team to read, as a team_… id. Omit it when the key reads one team; it is required when the key reads several (400 team_required). When you send it, it must name a team the key reads: a malformed id gets 400 invalid_request, and a team outside the key gets 404 team_not_accessible, as does a request without it once the key reads no team at all.

  • Idempotency-Key string Required 1–255 chars Pattern ^[\x21-\x7e]+$

    One unique visible-ASCII key per logical write; reuse exactly on retries and never retry outcome_unknown automatically.

Request body

Prepare the configured canonical first reply for the current saved customer turn.

  • conversation_id string ID prefix conv_…

    Current owned conversation. Required for tenant integrations; hosted execution derives its exact saved source.

Returns

Returns an Operation object.

Errors

+ 12 common errors

POST /v1/messages/prepare-reply
# Fictional fixtures: replace references and dates with current API values.
# Send consent or confirmation attestations only after the person confirms.
curl -X POST 'https://api.totemstudio.ai/v1/messages/prepare-reply' \
  -H "Authorization: Bearer $TOTEM_API_KEY" \
  -H "Totem-Team: $TOTEM_TEAM_ID" \
  -H "Idempotency-Key: ${TOTEM_IDEMPOTENCY_KEY:?Set one unique key for this logical write}" \
  -H "Content-Type: application/json" \
  --data '{"conversation_id": "conv_m3GhGjRHmFbww1g10oqOp7j3gWqPJ"}'
Response · 202JSON
{
  "object": "operation",
  "id": "op_m3yGe1tkVy6hn3m9LH9m7e640wg0O",
  "status": "queued",
  "endpoint": "messages.prepareReply",
  "created_at": "2026-10-01T09:30:00.000Z",
  "updated_at": "2026-10-01T09:30:00.000Z",
  "result": null,
  "error": null
}

Send a message

POST /v1/messages/send

Starts one durable send to a current owned conversation or canonical lead using a permitted configured sender. Current source, recipient, actor and channel rules are checked at the actual provider boundary. Prepared web chat responses are distinguished from provider acceptance; uncertain delivery must be reconciled before repeating it.

Scopes
messages:send
Rate limit
write

Headers

  • Totem-Team string Conditional ID prefix team_…

    The team to read, as a team_… id. Omit it when the key reads one team; it is required when the key reads several (400 team_required). When you send it, it must name a team the key reads: a malformed id gets 400 invalid_request, and a team outside the key gets 404 team_not_accessible, as does a request without it once the key reads no team at all.

  • Idempotency-Key string Required 1–255 chars Pattern ^[\x21-\x7e]+$

    One unique visible-ASCII key per logical write; reuse exactly on retries and never retry outcome_unknown automatically.

Request body

Start one durable message operation using current source and channel policy. A web chat response is prepared rather than provider-delivered.

  • target object Required

    Choose the current conversation or a current lead and configured sender; never supply a raw destination.

  • content object Required

    One bounded text, approved WhatsApp template, calling invitation or current retained Library selection.

Returns

Returns an Operation object.

Errors

+ 12 common errors

POST /v1/messages/send
# Fictional fixtures: replace references and dates with current API values.
# Send consent or confirmation attestations only after the person confirms.
curl -X POST 'https://api.totemstudio.ai/v1/messages/send' \
  -H "Authorization: Bearer $TOTEM_API_KEY" \
  -H "Totem-Team: $TOTEM_TEAM_ID" \
  -H "Idempotency-Key: ${TOTEM_IDEMPOTENCY_KEY:?Set one unique key for this logical write}" \
  -H "Content-Type: application/json" \
  --data '{"target": {"kind":"conversation","conversation_id":"conv_m3GhGjRHmFbww1g10oqOp7j3gWqPJ"}, "content": {"kind":"text","text":"Here is the requested update."}}'
Response · 202JSON
{
  "object": "operation",
  "id": "op_m3yGe1tkVy6hn3m9LH9m7e640wg0O",
  "status": "queued",
  "endpoint": "messages.send",
  "created_at": "2026-10-01T09:30:00.000Z",
  "updated_at": "2026-10-01T09:30:00.000Z",
  "result": null,
  "error": null
}

The Conversation object

A conversation on one channel: its status, assignee and the times of the latest messages, never their content.

Attributes

  • id string ID prefix conv_…

    Public id of the record.

  • object string

    Always conversation.

  • livemode boolean

    true for real data; false in example data.

  • team string ID prefix team_…

    The team this record belongs to.

  • lead string Nullable ID prefix lead_…

    The lead this conversation is linked to, or null when it is unlinked or the lead no longer exists. Identity (name, phone, handle) travels on the lead only.

  • channel_type string Nullable

    The channel: whatsapp, email, chatbot (the web chat), facebook, instagram, sms or tiktok; null for a value this version does not know. A lead can have several conversations on the same channel and business account, one for each contact address (phone number, email address or handle) it has used, so key your copy on id.

    Possible values
    • sms
    • whatsapp
    • facebook
    • instagram
    • tiktok
    • chatbot
    • email
  • status string Nullable

    active or archived in the team's inbox; null for a value this version does not know.

    Possible values
    • active
    • archived
  • assignee string Nullable ID prefix mem_…

    The team member assigned to the conversation (see /members), or null.

  • reply_mode string

    human while a person has taken the conversation over, including a WhatsApp chat answered from the WhatsApp Business app; ai otherwise. ai means no takeover is active, not that an assistant is set up or answering on this channel. A timed takeover returns to ai when it expires, and the record's version changes then.

    Possible values
    • ai
    • human
  • created_at string Nullable Format date-time

    When the conversation was created (UTC).

  • last_inbound_at string Nullable Format date-time

    The latest customer message (UTC). Not counted: erased messages, imported WhatsApp history and web-chat visitor turns, so a chatbot conversation reads null. Instagram shares cannot be told apart and count.

  • last_outbound_at string Nullable Format date-time

    The latest message sent to the customer that did not fail (UTC), whoever sent it. Imported WhatsApp history counts.

  • version integer Range ≥ 1

    Increases every time one of the record's exported fields changes. Apply a change only when its version is greater than the one you hold.

  • updated_at string Format date-time

    When Totem recorded this version (UTC). It is not the time the business event happened.

Conversation · exampleJSON
{
  "id": "conv_m3GhGjRHmFbww1g10oqOp7j3gWqPJ",
  "object": "conversation",
  "livemode": false,
  "team": "team_r9uYrIW4gSFJJ6hZQ9ip1UIpPaAD1CF7NR",
  "lead": "lead_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMXKSF0QbLS8CiUKJpEP34LFQG",
  "channel_type": "whatsapp",
  "status": "active",
  "assignee": "mem_h548E7UiYhutHhucVrQCzkM0eaea0",
  "reply_mode": "ai",
  "created_at": "2026-09-28T10:16:00.000Z",
  "last_inbound_at": "2026-10-01T08:58:00.000Z",
  "last_outbound_at": "2026-10-01T08:59:30.000Z",
  "version": 12,
  "updated_at": "2026-10-01T08:59:31.040Z"
}

The ConversationMessages object

Bounded current message bodies without sender destinations, raw identifiers or media locations. Truncated means older retained rows may exist.

Attributes

  • object string

    Identifies a content-authorized conversation message page.

    Value
    • conversation_messages
  • messages Array<object> ≤ 50 items

    Latest retained messages visible under the current content grant, with at most fifty entries.

  • truncated boolean

    True when older retained messages may exist beyond this bounded page.

ConversationMessages · exampleJSON
{
  "object": "conversation_messages",
  "messages": [],
  "truncated": false
}

The MessageChannels object

Configured sender references without provider identifiers or credentials.

Attributes

  • object string

    Identifies a configured message sender inventory.

    Value
    • message_channels
  • channels Array<object> ≤ 100 items

    Current configured senders, limited to one hundred entries. References are scoped to this integration and team.

MessageChannels · exampleJSON
{
  "object": "message_channels",
  "channels": [
    {
      "reference": "mch1_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "channel_type": "chatbot",
      "name": "Example chat"
    }
  ]
}

The MessageReceipt object

Current-source message result without body, destination or provider identifiers.

Attributes

  • object string

    Identifies a retained message delivery result.

    Value
    • message_receipt
  • status string

    Sent requires actual provider acceptance; prepared identifies a retained web chat response awaiting its delivery surface.

    Possible values
    • sent
    • prepared
  • conversation_id string ID prefix conv_…

    Current conversation in the selected team. Tenant integrations must supply its identifier; hosted processing may derive its exact signed source.

MessageReceipt · exampleJSON
{
  "object": "message_receipt",
  "status": "prepared",
  "conversation_id": "conv_m3GhGjRHmFbww1g10oqOp7j3gWqPJ"
}

The FirstReplyReceipt object

Source-proven canonical first-reply receipt with bounded context and no provider identifiers.

Attributes

  • object string

    Always first_reply_receipt.

  • first_reply object Nullable

    Current source-proven context, or null when no content may be disclosed.

  • skip_ai_reply boolean

    Whether the canonical campaign or human ownership suppresses the normal assistant reply.

  • prepared_reference string Nullable 40–16384 chars Pattern ^tcnt1\.[A-Za-z0-9_-]+$

    Opaque prepared webchat content reference, or null. Resolve it with the same current content permissions.

FirstReplyReceipt · exampleJSON
{
  "object": "first_reply_receipt",
  "first_reply": null,
  "skip_ai_reply": false,
  "prepared_reference": null
}

The RequestedInfoReceipt object

Immutable queue admission acknowledgement, without content, destination or provider identifiers.

Attributes

  • object string

    Always requested_info_receipt.

  • status string

    Whether this admission created the queued request or found an existing request in progress. This is an admission snapshot.

    Possible values
    • queued
    • already_queued
  • channel string

    Configured response channel chosen by current staff policy.

    Possible values
    • whatsapp
    • email
  • delivery_confirmed boolean

    This queue acknowledgement does not attest delivery, including when read again after dispatch.

    Value
    • false
  • includes_requested_detail boolean

    Whether the configured response includes the requested information field.

  • eta_minutes number

    The canonical queue estimate at admission, in minutes; not a delivery guarantee.

    Value
    • 5
RequestedInfoReceipt · exampleJSON
{
  "object": "requested_info_receipt",
  "status": "queued",
  "channel": "email",
  "delivery_confirmed": false,
  "includes_requested_detail": true,
  "eta_minutes": 5
}

API version 1.0.0