Jump to

  • Quickstarts
  • API reference
  • Webhook events
  • Error codes
  • SDKs

API reference

Conversations

How these fit together: the Conversations guide.

List conversations

get/v1/conversations

Lists conversations, newest first.

A conversation is one contact’s thread with one sender (a WhatsApp number, an email from address, an SMS header). Only the key’s own mode is listed: a live key’s are the live threads, a test key’s the test ones (a test contact’s, or the sandbox’s) — each says livemode. Filter by channel, contactId, status (open or resolved) and windowOpen — whether a WhatsApp thread’s 24-hour customer service window is open now, so free text can still be sent. What was said is not here: read it with GET /v1/conversations/{conversationId}/messages.

Access: an organization key with the conversations:read scope.

Query parameters

  • limitinteger

    How many items to return.

  • cursorstring

    The nextCursor of the previous page. Omit for the first page.

  • channelstring

    Only threads on this channel. Omitted: every channel (WhatsApp, email and SMS threads mixed, newest first).

    One ofwhatsappemailsms

  • contactIdstring (uuid)

  • statusstring

    One ofopenresolved

  • windowOpenboolean

    WhatsApp threads only — the 24-hour customer service window is WhatsApp’s. true: threads whose window is open now; false: threads where it is closed (or was never opened). Email and SMS threads have no window and are never matched by either value; combined with channel=email or channel=sms it is a 400.

Response 200PublicConversationPage

  • dataPublicConversation[]Required

    Its fields are listed under Get conversation

  • nextCursorstring | nullRequired

    Pass back as cursor for the next page; null on the last.

Errors

Request
curl 'https://api.trovacast.com/v1/conversations' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "data": [
    {
      "assignedAt": "2026-11-05T10:00:00.000Z",
      "assignedUserId": "ASSIGNED_USER_ID",
      "channel": "whatsapp",
      "contactId": "CONTACT_ID",
      "createdAt": "2026-11-05T10:00:00.000Z",
      "id": "ID",
      "lastInboundAt": "2026-11-05T10:00:00.000Z",
      "lastMessageAt": "2026-11-05T10:00:00.000Z",
      "lastOutboundAt": "2026-11-05T10:00:00.000Z",
      "livemode": true,
      "object": "conversation",
      "resolvedAt": "2026-11-05T10:00:00.000Z",
      "senderId": "SENDER_ID",
      "senderRef": "SENDER_REF",
      "serviceWindowExpiresAt": "2026-11-05T10:00:00.000Z",
      "serviceWindowOpen": true,
      "status": "open",
      "version": 4
    }
  ],
  "nextCursor": "NEXT_CURSOR"
}

Get conversation

get/v1/conversations/{conversationId}

Retrieves a conversation and its service window.

Its status, assignee, version and last inbound and outbound times and, on WhatsApp, the 24-hour customer service window: free text may be sent until serviceWindowExpiresAt, a template after. Email and SMS threads have no window (serviceWindowOpen is always false). To reply on a WhatsApp thread’s own number, send with its conversationId on POST /v1/messages.

Access: an organization key with the conversations:read scope.

Path parameters

  • conversationIdstringRequired

Response 200PublicConversation

Show the 18 fields
  • assignedAtstring (date-time) | null

  • assignedUserIdstring (uuid) | null

    The organization member the thread is assigned to (their user id), or null. Set with POST /v1/conversations/{id}/assign.

  • channelstringRequired

    One ofwhatsappemailsms

  • contactIdstring (uuid)Required

  • createdAtstring (date-time)Required

  • idstring (uuid)Required

  • lastInboundAtstring (date-time) | nullRequired

  • lastMessageAtstring (date-time) | nullRequired

  • lastOutboundAtstring (date-time) | nullRequired

  • livemodebooleanRequired

    False for a test thread — a test contact’s, or one on the platform’s test sender (the sandbox’s). A key lists and reads the conversations of its own mode only; another mode’s is a 404. The mode the thread’s conversation.* events carry.

  • objectstringRequired

    One ofconversation

  • resolvedAtstring (date-time) | null

  • senderIdstring (uuid) | nullRequired

    The sending number’s id — senderId on POST /v1/messages (or send with conversationId, which uses it for you). Null when the number is no longer connected.

  • senderRefstringRequired

    What the thread is sent from: the WhatsApp number’s phone_number_id, the email from address, or the SMS DLT header (one thread per contact per sender).

  • serviceWindowExpiresAtstring (date-time) | nullRequired

    WhatsApp: end of the 24-hour customer service window — free text may be sent until then, a template after. Always null on email and SMS, which have no window.

  • serviceWindowOpenbooleanRequired

    WhatsApp: whether the window is open now. Always false on email and SMS (no window: they send any time, subject to consent).

  • statusstringRequired

    One ofopenresolved

  • versioninteger

    Moves on every change — an assignment, a resolve, a customer’s message. Send it back as version on assign, resolve or reopen to change the thread only as you read it (409 CONVERSATION_CHANGED otherwise).

Errors

Request
curl 'https://api.trovacast.com/v1/conversations/CONVERSATION_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "assignedAt": "2026-11-05T10:00:00.000Z",
  "assignedUserId": "ASSIGNED_USER_ID",
  "channel": "whatsapp",
  "contactId": "CONTACT_ID",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "id": "ID",
  "lastInboundAt": "2026-11-05T10:00:00.000Z",
  "lastMessageAt": "2026-11-05T10:00:00.000Z",
  "lastOutboundAt": "2026-11-05T10:00:00.000Z",
  "livemode": true,
  "object": "conversation",
  "resolvedAt": "2026-11-05T10:00:00.000Z",
  "senderId": "SENDER_ID",
  "senderRef": "SENDER_REF",
  "serviceWindowExpiresAt": "2026-11-05T10:00:00.000Z",
  "serviceWindowOpen": true,
  "status": "open",
  "version": 4
}

Assign conversation

post/v1/conversations/{conversationId}/assign

Assigns a conversation to a member (or to nobody).

Names an active member of the organization by userId or sign-in email, or nobody with userId: null; assigning the thread to whoever already has it answers it as it is. Send the version you read to assign it only as you saw it (409 CONVERSATION_CHANGED otherwise). Anyone who is not an active member — another organization’s user, a revoked member, an unknown email, all alike — is refused with 422 ASSIGNEE_NOT_A_MEMBER, and a test key with 422 TEST_MODE_UNSUPPORTED. Audited against the key (conversation.assigned).

Access: an organization key with the conversations:write scope.

Path parameters

  • conversationIdstringRequired

Headers

  • Idempotency-Keystring

    Makes the request safe to retry: a repeat with the same key and the same body returns the stored success (with Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT, 503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.

Request body

  • emailstring

    The member to assign it to, by their sign-in email.

    at most 320 characters

  • userIdobject | null

    The member to assign it to (an active member of the organization), or null to unassign. Or name them by email.

  • versioninteger

    The conversation’s version as you read it; refused (409 CONVERSATION_CHANGED) when it has moved on. Omitted: the change applies to the thread as it is.

    at least 1

Response 200PublicConversation

Its fields are listed under Get conversation.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/conversations/CONVERSATION_ID/assign' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "riya@acme.test"
}'
Response 200 (json)
{
  "assignedAt": "2026-11-05T10:00:00.000Z",
  "assignedUserId": "ASSIGNED_USER_ID",
  "channel": "whatsapp",
  "contactId": "CONTACT_ID",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "id": "ID",
  "lastInboundAt": "2026-11-05T10:00:00.000Z",
  "lastMessageAt": "2026-11-05T10:00:00.000Z",
  "lastOutboundAt": "2026-11-05T10:00:00.000Z",
  "livemode": true,
  "object": "conversation",
  "resolvedAt": "2026-11-05T10:00:00.000Z",
  "senderId": "SENDER_ID",
  "senderRef": "SENDER_REF",
  "serviceWindowExpiresAt": "2026-11-05T10:00:00.000Z",
  "serviceWindowOpen": true,
  "status": "open",
  "version": 4
}

List conversation messages

get/v1/conversations/{conversationId}/messages

Lists a conversation’s messages, newest first.

Each in the shape GET /v1/messages/{messageId} returns, paged by cursor and limit. The thread is shared by both modes, its messages are not: a key lists the messages of its own mode only.

Access: an organization key with the messages:read scope.

Path parameters

  • conversationIdstringRequired

Query parameters

  • limitinteger

    How many items to return.

  • cursorstring

    The nextCursor of the previous page. Omit for the first page.

Response 200PublicMessagePage

  • dataPublicMessage[]Required

    Its fields are listed under Get message

  • nextCursorstring | nullRequired

    Pass back as cursor for the next page; null on the last.

Errors

Request
curl 'https://api.trovacast.com/v1/conversations/CONVERSATION_ID/messages' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "data": [
    {
      "button": {
        "payload": "COD_CONFIRM:1001",
        "text": "TEXT"
      },
      "channel": "whatsapp",
      "charge": {
        "amountMinor": 25,
        "category": "utility",
        "currency": "INR",
        "ratePerUnitMinor": 25,
        "ratedAt": "2026-11-05T10:00:00.000Z",
        "status": "charged",
        "units": 1
      },
      "contactId": "CONTACT_ID",
      "contacts": [
        {
          "emails": [
            {
              "email": "riya@example.com",
              "type": "WORK"
            }
          ],
          "name": "Riya Sharma",
          "organization": "Acme Pvt Ltd",
          "phones": [
            {
              "phone": "+91 98765 43210",
              "type": "CELL"
            }
          ]
        }
      ],
      "context": {
        "messageId": "MESSAGE_ID",
        "providerMessageId": "PROVIDER_MESSAGE_ID"
      },
      "conversationId": "CONVERSATION_ID",
      "createdAt": "2026-11-05T10:00:00.000Z",
      "deliveredAt": "2026-11-05T10:00:00.000Z",
      "direction": "inbound",
      "email": {
        "attachments": [
          {
            "contentType": "application/pdf",
            "filename": "invoice-1001.pdf",
            "size": 1
          }
        ],
        "bcc": [
          "BCC"
        ],
        "cc": [
          "a•••@acme-customer.com"
        ],
        "from": "orders@mail.acme.com",
        "subject": "Your order #1001 is confirmed",
        "to": "a•••@example.com",
        "tracking": {
          "clicks": {
            "count": 2,
            "enabled": true,
            "firstAt": "2026-11-05T10:00:00.000Z"
          },
          "opens": {
            "count": 2,
            "enabled": true,
            "firstAt": "2026-11-05T10:00:00.000Z"
          }
        }
      },
      "failedAt": "2026-11-05T10:00:00.000Z",
      "failure": {
        "code": "META_131026",
        "reason": "REASON"
      },
      "id": "ID",
      "livemode": true,
      "location": {
        "address": "12 MG Road, Bengaluru",
        "latitude": 12.9716,
        "longitude": 77.5946,
        "name": "Acme Store",
        "url": "URL"
      },
      "media": {
        "failureCode": "MEDIA_TOO_LARGE",
        "fileName": "FILE_NAME",
        "index": 0,
        "kind": "image",
        "mimeType": "image/jpeg",
        "sizeBytes": 1,
        "status": "pending"
      },
      "mediaItems": [
        {
          "failureCode": "MEDIA_TOO_LARGE",
          "fileName": "FILE_NAME",
          "index": 0,
          "kind": "image",
          "mimeType": "image/jpeg",
          "sizeBytes": 1,
          "status": "pending"
        }
      ],
      "metadata": {},
      "object": "message",
      "order": {
        "catalogId": "CATALOG_ID",
        "items": [
          {
            "currency": "INR",
            "itemPrice": 499,
            "productRetailerId": "SKU-1001",
            "quantity": 2
          }
        ],
        "text": "TEXT"
      },
      "pricing": {
        "billable": true,
        "category": "utility",
        "model": "MODEL",
        "type": "TYPE"
      },
      "providerMessageId": "PROVIDER_MESSAGE_ID",
      "reaction": {
        "emoji": "👍"
      },
      "readAt": "2026-11-05T10:00:00.000Z",
      "scheduledAt": "2026-11-05T10:00:00.000Z",
      "sentAt": "2026-11-05T10:00:00.000Z",
      "sms": {
        "country": "IN",
        "encoding": "gsm7",
        "expiresAt": "2026-11-05T10:00:00.000Z",
        "header": "ACMEIN",
        "keyword": "stop",
        "price": {
          "amount": "0.002780",
          "currency": "USD"
        },
        "segments": 1,
        "sendAfter": "2026-11-05T10:00:00.000Z"
      },
      "status": "queued",
      "template": {
        "id": "ID",
        "language": "en",
        "name": "order_confirmation"
      },
      "text": "TEXT",
      "type": "template",
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "warnings": [
        {
          "code": "WHATSAPP_NOT_CONNECTED",
          "message": "MESSAGE"
        }
      ]
    }
  ],
  "nextCursor": "NEXT_CURSOR"
}

Reopen conversation

post/v1/conversations/{conversationId}/reopen

Puts a resolved conversation back in the queue (conversation.opened, reason api).

The event commits with the change; a thread already open is answered as it is. Send the version you read to reopen it only as you saw it (409 CONVERSATION_CHANGED otherwise). A test key is refused (422 TEST_MODE_UNSUPPORTED). Audited against the key (conversation.reopened).

Access: an organization key with the conversations:write scope.

Path parameters

  • conversationIdstringRequired

Headers

  • Idempotency-Keystring

    Makes the request safe to retry: a repeat with the same key and the same body returns the stored success (with Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT, 503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.

Request body

  • versioninteger

    The conversation’s version as you read it — proof of which customer messages you had: a resolve sent with a version from before the customer’s latest message is refused (409 CONVERSATION_CHANGED). Omitted: applies to the thread as it is.

    at least 1

Response 200PublicConversation

Its fields are listed under Get conversation.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/conversations/CONVERSATION_ID/reopen' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{}'
Response 200 (json)
{
  "assignedAt": "2026-11-05T10:00:00.000Z",
  "assignedUserId": "ASSIGNED_USER_ID",
  "channel": "whatsapp",
  "contactId": "CONTACT_ID",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "id": "ID",
  "lastInboundAt": "2026-11-05T10:00:00.000Z",
  "lastMessageAt": "2026-11-05T10:00:00.000Z",
  "lastOutboundAt": "2026-11-05T10:00:00.000Z",
  "livemode": true,
  "object": "conversation",
  "resolvedAt": "2026-11-05T10:00:00.000Z",
  "senderId": "SENDER_ID",
  "senderRef": "SENDER_REF",
  "serviceWindowExpiresAt": "2026-11-05T10:00:00.000Z",
  "serviceWindowOpen": true,
  "status": "open",
  "version": 4
}

Resolve conversation

post/v1/conversations/{conversationId}/resolve

Marks a conversation handled (conversation.resolved).

The event commits with the change; a thread already resolved is answered as it is. Send the version you read, so a customer message you have not seen refuses the resolve (409 CONVERSATION_CHANGED) instead of closing over it. A test key is refused (422 TEST_MODE_UNSUPPORTED: a thread is a real customer’s). Audited against the key (conversation.resolved).

Access: an organization key with the conversations:write scope.

Path parameters

  • conversationIdstringRequired

Headers

  • Idempotency-Keystring

    Makes the request safe to retry: a repeat with the same key and the same body returns the stored success (with Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT, 503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.

Request body

  • versioninteger

    The conversation’s version as you read it — proof of which customer messages you had: a resolve sent with a version from before the customer’s latest message is refused (409 CONVERSATION_CHANGED). Omitted: applies to the thread as it is.

    at least 1

Response 200PublicConversation

Its fields are listed under Get conversation.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/conversations/CONVERSATION_ID/resolve' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{}'
Response 200 (json)
{
  "assignedAt": "2026-11-05T10:00:00.000Z",
  "assignedUserId": "ASSIGNED_USER_ID",
  "channel": "whatsapp",
  "contactId": "CONTACT_ID",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "id": "ID",
  "lastInboundAt": "2026-11-05T10:00:00.000Z",
  "lastMessageAt": "2026-11-05T10:00:00.000Z",
  "lastOutboundAt": "2026-11-05T10:00:00.000Z",
  "livemode": true,
  "object": "conversation",
  "resolvedAt": "2026-11-05T10:00:00.000Z",
  "senderId": "SENDER_ID",
  "senderRef": "SENDER_REF",
  "serviceWindowExpiresAt": "2026-11-05T10:00:00.000Z",
  "serviceWindowOpen": true,
  "status": "open",
  "version": 4
}