API reference
Sandbox
How these fit together: the Messaging sandbox guide.
List sandbox emails
get
Lists the emails your test keys sent — they land here instead of an inbox, newest first.
Every test email the sandbox accepted (an address that asks to be refused, +reject, never lands), optionally for one contactId; a live email is never here. It is a view over the messages themselves, so nothing is copied and an erased contact’s mail is simply gone. The recipient and copies are masked, as on the message resource.
Access: an organization key with the messages:read scope.
Query parameters
limitintegerHow many items to return.
cursorstringThe
nextCursorof the previous page. Omit for the first page.contactIdstring (uuid)Only the emails sent to this contact.
Response 200PublicSandboxEmailPage
dataPublicSandboxEmail[]RequiredIts fields are listed under Get sandbox email
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.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/sandbox/emails' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"data": [
{
"attachments": [
{
"contentType": "CONTENT_TYPE",
"filename": "FILENAME",
"size": 1
}
],
"bcc": [
"BCC"
],
"cc": [
"CC"
],
"contactId": "CONTACT_ID",
"createdAt": "2026-11-05T10:00:00.000Z",
"deliveredAt": "2026-11-05T10:00:00.000Z",
"from": "FROM",
"fromName": "FROM_NAME",
"html": "HTML",
"id": "ID",
"object": "sandbox_email",
"replyTo": "REPLY_TO",
"status": "queued",
"subject": "SUBJECT",
"text": "TEXT",
"to": "TO",
"warnings": [
{
"code": "WHATSAPP_NOT_CONNECTED",
"message": "MESSAGE"
}
]
}
],
"nextCursor": "NEXT_CURSOR"
}Get sandbox email
get
Reads one sandbox email: from, subject, the rendered text and HTML, attachments and warnings.
By the message id POST /v1/messages answered. Attachments are listed by name and size; warnings are what a live send of it would have been refused for. The recipient is masked, as on the message resource.
Access: an organization key with the messages:read scope.
Path parameters
messageIdstringRequired
Response 200PublicSandboxEmail
Show the 17 fieldsHide the fields
attachmentsPublicSandboxEmailAttachment[]Required3 fields of
attachmentscontentTypestringRequiredfilenamestringRequiredsizeintegerRequiredBytes.
bccstring[]RequiredMasked.
ccstring[]RequiredMasked.
contactIdstring (uuid)RequiredcreatedAtstring (date-time)RequireddeliveredAtstring (date-time) | nullRequiredfromstringRequiredThe address it went out from: your verified domain’s, the
fromyou asked for, or the sandbox’s own (sandbox@test.trovacast.com).fromNamestring | nullRequiredhtmlstring | nullRequiredThe HTML part, as rendered and sanitized.
idstring (uuid)RequiredThe message id (
GET /v1/messages/{id}reads its status).objectstringRequiredOne of
sandbox_emailreplyTostring | nullRequiredstatusstringRequiredThe message’s status:
deliveredonce the sandbox delivered it,failedfor an address that asks to bounce (+bounce).One of
queuedsendingsentdeliveredreadfailedsubjectstring | nullRequiredtextstring | nullRequiredThe plain-text part, as rendered.
tostring | nullRequiredThe recipient, masked (
d•••@example.com).warningsPublicMessageWarning[]RequiredWhat a live send of this email would need.
2 fields of
warningscodestringRequiredStable: branch on it.
One of
WHATSAPP_NOT_CONNECTEDTEMPLATE_TEST_ONLYSMS_NOT_CONFIGUREDSMS_SENDER_MISSINGSMS_TEMPLATE_REQUIREDSMS_DLT_TEMPLATE_ID_MISSINGSMS_DLT_ENTITY_MISSINGSMS_HEADER_CATEGORY_MISMATCHSMS_OUTSIDE_SEND_WINDOWSMS_DESTINATION_NOT_ALLOWEDEMAIL_NOT_CONFIGUREDEMAIL_FROM_NOT_VERIFIEDmessagestringRequiredWhat a live send needs instead, in words.
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 test email of this organization with that id (a live email is never here).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/sandbox/emails/MESSAGE_ID' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"attachments": [
{
"contentType": "CONTENT_TYPE",
"filename": "FILENAME",
"size": 1
}
],
"bcc": [
"BCC"
],
"cc": [
"CC"
],
"contactId": "CONTACT_ID",
"createdAt": "2026-11-05T10:00:00.000Z",
"deliveredAt": "2026-11-05T10:00:00.000Z",
"from": "FROM",
"fromName": "FROM_NAME",
"html": "HTML",
"id": "ID",
"object": "sandbox_email",
"replyTo": "REPLY_TO",
"status": "queued",
"subject": "SUBJECT",
"text": "TEXT",
"to": "TO",
"warnings": [
{
"code": "WHATSAPP_NOT_CONNECTED",
"message": "MESSAGE"
}
]
}Create sandbox inbound call
post
Simulates a caller ringing one of your sandbox numbers (test keys only): its route runs for real, scripted, and every call event reaches your test endpoints.
The number’s route — a flow, an answer-URL application (fetched and signed as live), a queue, a seat, an app identity or an AI agent — runs on the platform’s real call logic, on the sandbox’s media plane instead of a carrier. script plays the other side: the keys pressed and speech said to each gather (and when), who answers each ring (several numbers at once: answeredBy), whether they press the confirm key and how long they talk, what the caller says to a voicemail, when they hang up, and the mock AI agent’s conversation (lines, real signed tool calls to your tools, a key press, an opt-out, a hand-off to a person). Anything not scripted ends the call cleanly. Time is the script’s, not the wall clock’s: at is when the call is placed (for hours and skip windows), and durations are scripted seconds, so the call plays out in moments. Answers the test call as it began (in_progress; failed when an AI route’s agent cannot answer, with call.failed); then call.inbound, call.ringing and call.answered (who), call.missed, call.voicemail.ready (with its transcript), call.recording.ready (a fetchable test recording), call.flow.failed, call.transcript.segment, call.ai.transfer, call.ai.opt_out, call.dtmf, call.completed, call.transcript.ready and call.summary.ready reach your test endpoints as the call plays. The caller becomes a test contact. A sandbox call takes one of the organization’s test-call slots.
Access: an organization key with the calls:write scope.
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
atstringWhen the call is placed, for the flow’s
hoursand a target’s skip windows (default now). The call’s clock runs from it.fromstringRequiredThe caller’s number. A test contact with it is used, or created (a live contact’s number is refused).
numberIdstring (uuid)The sandbox number called (or
to).scriptPublicSandboxCallScript5 fields of
scriptaiPublicSandboxAiScriptThe mock AI agent’s conversation when an agent takes the caller (an
airoute, a flow’saistep, anAI_AGENTcall). Absent, it plays a short scripted conversation and closes.1 field of
aiturnsPublicSandboxAiTurn[]RequiredThe conversation, in order (at most 50 turns). After the last, the agent closes the call.
8 fields of
turnsagentstringThe agent says this.
argumentsobjectThe tool call’s arguments (checked against its schema).
callerstringThe caller says this (one of the call’s opt-out phrases opts them out).
endbooleantrue: the agent ends the conversation (its closing line said).
hangUpbooleantrue: the caller hangs up.
pressstringThe caller presses a key (
call.dtmf); the call’s opt-out key opts them out.toolstringThe agent calls this tool — the call’s own tool of that name, else the agent’s — with
arguments: a real signed request to its URL.transferPublicSandboxTransferThe agent hands the caller to a person: the call’s
transfertarget (an AI call or route) — or, in a flow’saistep, itsonEscalate.3 fields of
transferansweredbooleanThe person answers (default true).
reasonstringWhy the agent asked (kept, never spoken).
talkSecondsintegerHow long they talk.
connectsPublicSandboxConnect[]Each party rung in turn (a sequence), each ring of several numbers at once, each seat offered the call and each queue’s wait, in order (at most 50). With none left, nobody answers.
7 fields of
connectsagentMembershipIdstring (uuid)A queue’s wait answered: the seat (membership id) that takes the caller; default the queue’s first member.
answeredByintegerNumbers rung at once (
strategy: simultaneous): which answered, by its place intargets(0-based; default 0).confirmbooleanPressed the confirm key when the step asks one (
confirm). Default true; false is a pickup that never confirmed — no answer.hangsUpstringWho ends the conversation: the caller (default — the call ends) or the party (the flow goes on).
One of
callerpartyoutcomestringDefault
no_answer.One of
answeredno_answerbusyfailedringSecondsintegerHow long it rang (default 5 when answered, else the step’s ring time). Answered later than the step rings for is no answer.
talkSecondsintegerHow long they talked once connected (default 30).
hangUpAfterSecondsintegerThe caller hangs up at this point of the call (seconds of call time), whatever runs then.
inputsPublicSandboxInput[]Answers to the flow’s gathers and menus (and a voicemail greeting’s keys), in order (at most 50). With none left, a gather times out.
4 fields of
inputsafterSecondsintegerWhen, in seconds after the prompt (default 1). Past the gather’s
timeoutSecondsthe gather times out first and this answers the next one, with what is left.digitsstringKeys pressed (
0-9,*,#), in order.hangUpbooleanThe caller hangs up here instead.
speechstringWhat the caller says — heard by a speech gather, and a line of the call’s transcript.
recordingsPublicSandboxRecording[]What the caller leaves each time the flow records them (a voicemail,
record), in order (at most 10). With none left, they hang up without a word.4 fields of
recordingskeystringA key pressed to end it: one of a voicemail’s
keys, or the finish key.secondsintegerHow long it runs (default: the speech at 2.5 words a second). Held to the step’s
maxSeconds.speechstringWhat they say: the voicemail’s transcript.
thenstringAfter it: hang up (default) or stay on the line.
One of
hang_upstay
tostringThe sandbox number called, E.164 (or
numberId).
Response 201PublicSandboxInboundCallResult
callPublicCallRequiredThe test call (
direction: inbound,livemode: false) as it began —in_progress, its route running;failedwhen its route refused it. Its events reach your test endpoints as it plays.Its fields are listed under Get call
objectstringRequiredOne of
sandbox_inbound_call
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403SANDBOX_TEST_KEY_REQUIRED — a live key. API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no sandbox number of this organization with that id or number.409SANDBOX_NUMBER_NOT_ROUTED — the number routes nowhere, or would not take the call (reason). IDEMPOTENCY_KEY_IN_FLIGHT — the first request with this Idempotency-Key is still running (retry afterRetry-After); or CONFLICT.422TEST_MODE_UNSUPPORTED —fromis a live contact’s number. IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.429CALL_CONCURRENCY_LIMIT — the organization’s test calls in flight are at their cap. RATE_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/sandbox/inbound-calls' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"at": "2026-11-17T04:00:00Z",
"from": "+14155552673",
"numberId": "4a5b6c7d-8e9f-4a0b-8c1d-2e3f4a5b6c7d",
"script": {
"ai": {
"turns": [
{
"caller": "Can someone come tomorrow morning?"
},
{
"arguments": {
"date": "2026-11-18"
},
"tool": "book_visit"
},
{
"agent": "You are booked for nine tomorrow."
},
{
"transfer": {
"answered": true,
"talkSeconds": 60
}
}
]
},
"inputs": [
{
"afterSeconds": 2,
"speech": "I need a plumber"
}
]
}
}'{
"call": {
"agent": {
"audio": {
"encoding": "pcm_s16le",
"sampleRate": 16000
},
"maxDurationSec": 1,
"streamUrl": "STREAM_URL"
},
"aiAgentId": "AI_AGENT_ID",
"answeredAt": "2026-11-05T10:00:00.000Z",
"bridge": {
"agentMembershipId": "AGENT_MEMBERSHIP_ID",
"numberLast4": "0000",
"phoneId": "PHONE_ID",
"ringFirst": "contact",
"target": "number"
},
"charge": {
"amountMinor": 180,
"chargedMinutes": 3,
"currency": "INR",
"includedMinutes": 0,
"ratePerMinuteMinor": 60,
"ratedAt": "2026-11-05T10:00:00.000Z",
"reason": null,
"rule": null,
"status": "charged"
},
"contactId": "CONTACT_ID",
"createdAt": "2026-11-05T10:00:00.000Z",
"direction": "inbound",
"durationSeconds": 1,
"endedAt": "2026-11-05T10:00:00.000Z",
"failure": {
"code": "NO_ANSWER",
"reason": "REASON"
},
"flow": {
"applicationId": "APPLICATION_ID",
"callFlowId": "CALL_FLOW_ID",
"source": "definition"
},
"from": "+918031152580",
"fromSource": "organization_number",
"hangup": {
"apiKeyId": "API_KEY_ID",
"reason": "api-hangup",
"side": "agent"
},
"id": "ID",
"initiatedAt": "2026-11-05T10:00:00.000Z",
"legRole": "primary",
"livemode": true,
"machineDetection": {
"detectedAt": "2026-11-05T10:00:00.000Z",
"mode": "detect",
"result": "human"
},
"metadata": {},
"mode": "external_agent",
"numberId": "NUMBER_ID",
"object": "call",
"parentCallId": "PARENT_CALL_ID",
"provider": "airtel",
"purpose": "service",
"recording": {
"durationSeconds": 1,
"expiresAt": "EXPIRES_AT",
"format": "audio/mpeg",
"id": "ID",
"noticePlayed": true,
"purpose": "call",
"status": "pending",
"url": "URL"
},
"recordingEnabled": true,
"reference": "REFERENCE",
"ringingAt": "2026-11-05T10:00:00.000Z",
"rootCallId": "ROOT_CALL_ID",
"status": "queued",
"to": "•••• ••3210",
"updatedAt": "2026-11-05T10:00:00.000Z"
},
"object": "sandbox_inbound_call"
}Create sandbox inbound message
post
Simulates a customer writing to you (test keys only): records it as a test inbound message and sends message.received to your test endpoints.
Recorded exactly as a real inbound message is — the thread upserted and reopened, message.received and, on a thread’s first customer message, conversation.opened — but as a test record (livemode: false) whose events reach test endpoints only. A WhatsApp message opens the thread’s 24-hour window, and an SMS saying STOP (or START) moves the test contact’s SMS consent as a real one would. Naming the customer by from (a phone or email) instead of contactId finds or creates the contact and also needs contacts:write. Refused with 403 SANDBOX_TEST_KEY_REQUIRED for a live key and 422 TEST_MODE_UNSUPPORTED for a live contact.
Access: an organization key with the messages:write scope.
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
channelstringRequiredOne of
whatsappsmsemailcontactIdstring (uuid)A test contact (one a test key created).
fromPublicSandboxInboundFrom2 fields of
fromemailstringEmail: the customer’s address. A test contact with it is used, or created.
phonestringWhatsApp and SMS: the customer’s number. A test contact with it is used, or created.
mediaPublicSandboxInboundMedia[]T8 — SMS only: the files of a picture message (MMS), at most 10. The message is
type: mms,message.receivedlists thempending, and the media worker stores a real sample file of each type (GET /v1/messages/{id}/media?index=), thenmessage.media.ready.1 field of
mediacontentTypestringRequiredIts type: the sandbox stores a real sample file of it.
One of
image/jpegimage/pngimage/gifaudio/wavvideo/mp4application/pdftext/vcard
subjectstringEmail only: the subject.
textstringRequiredWhat the customer wrote (empty only for a picture message:
media).
Response 201PublicSandboxInboundResult
messagePublicMessageRequiredThe inbound test message (
direction: inbound,livemode: false);message.receivedwas sent to your test webhook endpoints.Its fields are listed under Get message
objectstringRequiredOne of
sandbox_inbound_messagereplyPublicMessage | nullRequiredT8 — the automatic reply the message drew, as a live one would: an SMS saying HELP or INFO is answered with your HELP reply (
PATCH /v1/settings/smshelpReply) — a test SMS on the thread,message.sentandmessage.deliveredto your test endpoints — once per message and at most once per thread every 10 minutes. Null when nothing was sent (no HELP reply set, the cooldown, another keyword).Its fields are listed under Get message
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403SANDBOX_TEST_KEY_REQUIRED — a live key. API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.409IDEMPOTENCY_KEY_IN_FLIGHT — the first request with this Idempotency-Key is still running (retry afterRetry-After); or CONFLICT.422TEST_MODE_UNSUPPORTED — the contact is a live one (only test contacts can be simulated). 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/sandbox/inbound-messages' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"channel": "email",
"from": {
"email": "customer@example.com"
},
"subject": "Re: Your order",
"text": "Can it come on Friday instead?"
}'{
"message": {
"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"
}
]
},
"object": "sandbox_inbound_message",
"reply": {
"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"
}
]
}
}Review sandbox SMS registration
post
Decides one of your sandbox 10DLC registrations (test keys only): approved, or rejected with a reason, as the registry would.
A test key’s brands, campaigns and number assignments (POST /v1/sms/brands, /v1/sms/campaigns, /v1/sms/campaigns/{id}/numbers) are the sandbox’s: never filed with the registry, submitted to its review at once — a campaign once its brand is approved, a number assignment once its campaign is — and decided here. Each move is sms.registration.updated to your test endpoints; an approval submits what waited on it. Answers the registration as it now stands (previousStatus where it was). A live registration is 404; one that is not under review (pending, rejected, removed) is 409 SMS_REGISTRATION_CLOSED. A live key is 403 SANDBOX_TEST_KEY_REQUIRED.
Access: an organization key with the sms:manage scope.
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
idstring (uuid)RequiredThe brand’s, campaign’s or number assignment’s id.
kindstringRequiredWhat is decided: a
brand, acampaignor anumber_assignment.One of
brandcampaignnumber_assignmentreasonstringWhy it was rejected (its
statusReason).statusstringRequiredThe registry’s verdict.
One of
approvedrejected
Response 200PublicSandboxSmsRegistration
Show the 11 fieldsHide the fields
brandIdstring (uuid)RequiredcampaignIdstring (uuid) | nullRequiredidstring (uuid)RequiredkindstringRequiredOne of
brandcampaignnumber_assignmentlivemodebooleanRequiredAlways false: a sandbox registration.
numberIdstring (uuid) | nullRequiredpreviousStatusstring | nullRequiredWhere it was before this verdict.
One of
pendingsubmittedapprovedrejectedexpiredremovedreferencestringRequiredsenderIdstring (uuid) | nullRequiredstatusstringRequiredOne of
pendingsubmittedapprovedrejectedexpiredremovedstatusReasonstring | nullRequired
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403SANDBOX_TEST_KEY_REQUIRED — a live key. API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no sandbox registration of yours with that id.409SMS_REGISTRATION_CLOSED — not under review (pending, rejected or removed). IDEMPOTENCY_KEY_IN_FLIGHT — the first request with this Idempotency-Key is still running (retry afterRetry-After); or CONFLICT.422IDEMPOTENCY_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/sandbox/sms-registrations/review' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"id": "3f9c2a10-7b4e-4c1d-9a2f-5e8d1c6b7a40",
"kind": "brand",
"status": "approved"
}'{
"brandId": "BRAND_ID",
"campaignId": "CAMPAIGN_ID",
"id": "ID",
"kind": "brand",
"livemode": true,
"numberId": "NUMBER_ID",
"previousStatus": "pending",
"reference": "REFERENCE",
"senderId": "SENDER_ID",
"status": "pending",
"statusReason": "STATUS_REASON"
}Review sandbox verification
post
Decides a test organization’s submitted business verification (test keys only): approved, needs more information, or rejected, as a reviewer would.
A test organization (one a test integration key provisioned) submits its verification as a live one does (POST /v1/verifications/{id}/submit), but the platform never reviews it: decide it here. approved marks its documents reviewed; needs_info and rejected carry the note the organization reads (reviewNote) and let it edit and submit again. The verification moves as it would live — status, reviewedAt, reviewNote — but verified stays false and verifiedAt null: a test organization never opens a live feature. Answers the verification as it now stands; audited against the key (sandbox: true). Refused with 403 SANDBOX_TEST_KEY_REQUIRED for a live key, 422 TEST_MODE_UNSUPPORTED for an organization that is not a test organization (the platform reviews its verification), 404 NOT_FOUND before the verification is saved and 409 CONFLICT unless it is submitted or in review.
Access: an organization key with the verifications:write scope.
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
notestringWhat the organization must do (its
reviewNote). Required forneeds_infoandrejected.at most 1000 characters
statusstringRequiredThe decision, as a reviewer would make it.
One of
approvedneeds_inforejected
Response 200PublicVerification
Show the 15 fieldsHide the fields
businessPublicVerificationBusinessRequired4 fields of
businesscountrystringRequiredISO 3166-1 alpha-2; picks the requirement set.
entityTypestring | nullRequiredOne of
private_limitedllppartnershipproprietorshippublic_limitedtrust_societygovernmentforeign_companyjurisdictionstring | nullRequiredWhere below the country the business is registered, when its country asks (a US state of registration, by its USPS code).
legalNamestring | nullRequired
documentsPublicVerificationDocument[]RequiredThe documents uploaded, oldest first — never their file names or a link to them.
7 fields of
documentscreatedAtstring (date-time)Requiredidstring (uuid)RequiredmimeTypestringRequiredobjectstringRequiredOne of
verification_documentsizeBytesintegerRequiredstatusstringRequirederasedonce the stored file was deleted; the entry only records that it existed and no longer satisfies a requirement.One of
storederasedtypestringRequiredOne of
pan_cardgst_certificateincorporation_certificateaddress_proofauthorisation_lettersignatory_idnumber_loaothertax_registration
idstring (uuid) | nullRequiredWhat
POST /v1/verifications/:id/documentsand…/submittake; null until the verification is first saved.identifiersPublicVerificationIdentifiersRequiredThe last four characters only; the identifiers themselves are sealed and never leave the platform’s review.
5 fields of
identifierscinLast4string | nullRequiredgstinLast4string | nullRequiredlast4ByKindRecord<string, string>RequiredEvery identifier on file, by kind (
gstin,pan,cin,ein,company_number,vat_number,registration_number,tax_number), its last four characters.gstinLast4,panLast4andcinLast4carry the kinds those fields stand for in the business’s country.panLast4string | nullRequiredsignatoryPhoneLast4string | nullRequired
objectstringRequiredOne of
verificationrequiredbooleanRequiredWhether live features wait for approval — a self-serve organization’s live keys, numbers, live sends and calls.
requirementsPublicVerificationRequirements | nullRequiredThe documents the business must give (for
numberType, when asked). Null until the entity type is chosen.4 fields of
requirementsdocumentsPublicVerificationRequirement[]Required3 fields of
documentsanyOfstring[]RequiredAny one of these document types satisfies it.
One of
pan_cardgst_certificateincorporation_certificateaddress_proofauthorisation_lettersignatory_idnumber_loaothertax_registrationlabelstringRequiredsatisfiedbooleanRequiredA stored document of one of those types is on file.
identifiersPublicVerificationIdentifierRequirement[]RequiredThe identifiers the business must give, each satisfied by any one of its kinds (a European business gives a VAT number or its national registration number).
3 fields of
identifiersanyOfstring[]RequiredAny one of these identifiers satisfies it.
One of
gstinpancineincompany_numbervat_numberregistration_numbertax_numberlabelstringRequiredsatisfiedbooleanRequiredOne of those identifiers is on file.
numberTypestring | nullRequiredOne of
localmobiletoll_freenationalpromotional_140transactional_160short_codeprofilestringRequiredThe country’s verification profile —
in,us,gb,eu, orinternationalfor any other country (GET /v1/verifications/requirements).One of
inusgbeuinternational
reviewNotestring | nullRequiredThe reviewer’s note to the organization (what to change, or why not).
reviewedAtstring (date-time) | nullRequiredstatusstringRequirednot_starteduntil the organization first saves its verification (in the console, orPOST /v1/verifications).needs_infoandrejectedcarry the reviewer’sreviewNote.One of
not_starteddraftsubmittedin_reviewneeds_infoapprovedrejectedexpiredsubmittedAtstring (date-time) | nullRequiredupdatedAtstring (date-time) | nullRequiredverifiedbooleanRequiredWhat the gate reads: verification is not required, or it is approved (and not withdrawn).
verifiedAtstring (date-time) | nullRequiredversioninteger | nullRequiredSend it to
submit(and, optionally, to a save) —409when it moved since you read it.
Errors
400VALIDATION_FAILED —needs_infoorrejectedwithout anote.401API_KEY_INVALID — missing, unknown, revoked or expired key.403SANDBOX_TEST_KEY_REQUIRED — a live key. API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — the verification was never saved.409CONFLICT — the verification is not submitted or in review; or IDEMPOTENCY_KEY_IN_FLIGHT.422TEST_MODE_UNSUPPORTED — not a test organization: the platform reviews its verification. 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/sandbox/verifications/review' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"status": "approved"
}'{
"business": {
"country": "IN",
"entityType": "private_limited",
"jurisdiction": "DE",
"legalName": "LEGAL_NAME"
},
"documents": [
{
"createdAt": "2026-11-05T10:00:00.000Z",
"id": "ID",
"mimeType": "application/pdf",
"object": "verification_document",
"sizeBytes": 1,
"status": "stored",
"type": "pan_card"
}
],
"id": "ID",
"identifiers": {
"cinLast4": "3456",
"gstinLast4": "1Z5A",
"last4ByKind": {
"gstin": "1Z5A",
"pan": "234F"
},
"panLast4": "234F",
"signatoryPhoneLast4": "3210"
},
"object": "verification",
"required": true,
"requirements": {
"documents": [
{
"anyOf": [
"pan_card"
],
"label": "PAN card of the business",
"satisfied": true
}
],
"identifiers": [
{
"anyOf": [
"gstin"
],
"label": "PAN",
"satisfied": true
}
],
"numberType": "local",
"profile": "in"
},
"reviewNote": "REVIEW_NOTE",
"reviewedAt": "2026-11-05T10:00:00.000Z",
"status": "not_started",
"submittedAt": "2026-11-05T10:00:00.000Z",
"updatedAt": "2026-11-05T10:00:00.000Z",
"verified": true,
"verifiedAt": "2026-11-05T10:00:00.000Z",
"version": 1
}