API reference
Conversations
How these fit together: the Conversations guide.
List conversations
get
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
limitintegerHow many items to return.
cursorstringThe
nextCursorof the previous page. Omit for the first page.channelstringOnly threads on this channel. Omitted: every channel (WhatsApp, email and SMS threads mixed, newest first).
One of
whatsappemailsmscontactIdstring (uuid)statusstringOne of
openresolvedwindowOpenbooleanWhatsApp 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 withchannel=emailorchannel=smsit is a 400.
Response 200PublicConversationPage
dataPublicConversation[]RequiredIts fields are listed under Get conversation
nextCursorstring | nullRequiredPass back as
cursorfor the next page; null on the last.
Errors
400VALIDATION_FAILED — a malformed filter or cursor, orwindowOpenwithchannel=email/sms(only WhatsApp has a service window).401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/conversations' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"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
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 fieldsHide the fields
assignedAtstring (date-time) | nullassignedUserIdstring (uuid) | nullThe organization member the thread is assigned to (their user id), or null. Set with
POST /v1/conversations/{id}/assign.channelstringRequiredOne of
whatsappemailsmscontactIdstring (uuid)RequiredcreatedAtstring (date-time)Requiredidstring (uuid)RequiredlastInboundAtstring (date-time) | nullRequiredlastMessageAtstring (date-time) | nullRequiredlastOutboundAtstring (date-time) | nullRequiredlivemodebooleanRequiredFalse 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’sconversation.*events carry.objectstringRequiredOne of
conversationresolvedAtstring (date-time) | nullsenderIdstring (uuid) | nullRequiredThe sending number’s id —
senderIdonPOST /v1/messages(or send withconversationId, which uses it for you). Null when the number is no longer connected.senderRefstringRequiredWhat 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) | nullRequiredWhatsApp: 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.
serviceWindowOpenbooleanRequiredWhatsApp: whether the window is open now. Always false on email and SMS (no window: they send any time, subject to consent).
statusstringRequiredOne of
openresolvedversionintegerMoves on every change — an assignment, a resolve, a customer’s message. Send it back as
versionon assign, resolve or reopen to change the thread only as you read it (409 CONVERSATION_CHANGED otherwise).
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such conversation in the key’s mode (another mode’s thread is not found).429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/conversations/CONVERSATION_ID' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"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
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-KeystringMakes 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
emailstringThe member to assign it to, by their sign-in email.
at most 320 characters
userIdobject | nullThe member to assign it to (an active member of the organization), or null to unassign. Or name them by
email.versionintegerThe conversation’s
versionas 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
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such conversation in the key’s mode (another mode’s thread is not found).409CONVERSATION_CHANGED — the conversation moved on from theversionsent (a customer’s message, another change), or another change raced this one; read it again and retry. IDEMPOTENCY_KEY_IN_FLIGHT — the first request with this Idempotency-Key is still running (retry afterRetry-After); or CONFLICT.422ASSIGNEE_NOT_A_MEMBER — the user is not an active member of the organization. TEST_MODE_UNSUPPORTED — a test key (a thread is a real customer’s). IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
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"
}'{
"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
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
limitintegerHow many items to return.
cursorstringThe
nextCursorof the previous page. Omit for the first page.
Response 200PublicMessagePage
dataPublicMessage[]RequiredIts fields are listed under Get message
nextCursorstring | nullRequiredPass back as
cursorfor the next page; null on the last.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such conversation in the key’s mode (another mode’s thread is not found).429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/conversations/CONVERSATION_ID/messages' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"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
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-KeystringMakes 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
versionintegerThe conversation’s
versionas 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
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such conversation in the key’s mode (another mode’s thread is not found).409CONVERSATION_CHANGED — the conversation moved on from theversionsent (a customer’s message, another change), or another change raced this one; read it again and retry. IDEMPOTENCY_KEY_IN_FLIGHT — the first request with this Idempotency-Key is still running (retry afterRetry-After); or CONFLICT.422TEST_MODE_UNSUPPORTED — a test key. IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
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 '{}'{
"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
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-KeystringMakes 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
versionintegerThe conversation’s
versionas 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
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such conversation in the key’s mode (another mode’s thread is not found).409CONVERSATION_CHANGED — the conversation moved on from theversionsent (a customer’s message, another change), or another change raced this one; read it again and retry. IDEMPOTENCY_KEY_IN_FLIGHT — the first request with this Idempotency-Key is still running (retry afterRetry-After); or CONFLICT.422TEST_MODE_UNSUPPORTED — a test key. IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
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 '{}'{
"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
}