Jump to

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

API reference

Sandbox

How these fit together: the Messaging sandbox guide.

List sandbox emails

get/v1/sandbox/emails

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

  • limitinteger

    How many items to return.

  • cursorstring

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

  • contactIdstring (uuid)

    Only the emails sent to this contact.

Response 200PublicSandboxEmailPage

  • dataPublicSandboxEmail[]Required

    Its fields are listed under Get sandbox email

  • nextCursorstring | nullRequired

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

Errors

Request
curl 'https://api.trovacast.com/v1/sandbox/emails' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/sandbox/emails/{messageId}

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 fields
  • attachmentsPublicSandboxEmailAttachment[]Required

    3 fields of attachments
    • contentTypestringRequired

    • filenamestringRequired

    • sizeintegerRequired

      Bytes.

  • bccstring[]Required

    Masked.

  • ccstring[]Required

    Masked.

  • contactIdstring (uuid)Required

  • createdAtstring (date-time)Required

  • deliveredAtstring (date-time) | nullRequired

  • fromstringRequired

    The address it went out from: your verified domain’s, the from you asked for, or the sandbox’s own (sandbox@test.trovacast.com).

  • fromNamestring | nullRequired

  • htmlstring | nullRequired

    The HTML part, as rendered and sanitized.

  • idstring (uuid)Required

    The message id (GET /v1/messages/{id} reads its status).

  • objectstringRequired

    One ofsandbox_email

  • replyTostring | nullRequired

  • statusstringRequired

    The message’s status: delivered once the sandbox delivered it, failed for an address that asks to bounce (+bounce).

    One ofqueuedsendingsentdeliveredreadfailed

  • subjectstring | nullRequired

  • textstring | nullRequired

    The plain-text part, as rendered.

  • tostring | nullRequired

    The recipient, masked (d•••@example.com).

  • warningsPublicMessageWarning[]Required

    What a live send of this email would need.

    2 fields of warnings
    • codestringRequired

      Stable: branch on it.

      One ofWHATSAPP_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_VERIFIED

    • messagestringRequired

      What a live send needs instead, in words.

Errors

Request
curl 'https://api.trovacast.com/v1/sandbox/emails/MESSAGE_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/sandbox/inbound-calls

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-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

  • atstring

    When the call is placed, for the flow’s hours and a target’s skip windows (default now). The call’s clock runs from it.

  • fromstringRequired

    The 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).

  • scriptPublicSandboxCallScript

    5 fields of script
    • aiPublicSandboxAiScript

      The mock AI agent’s conversation when an agent takes the caller (an ai route, a flow’s ai step, an AI_AGENT call). Absent, it plays a short scripted conversation and closes.

      1 field of ai
      • turnsPublicSandboxAiTurn[]Required

        The conversation, in order (at most 50 turns). After the last, the agent closes the call.

        8 fields of turns
        • agentstring

          The agent says this.

        • argumentsobject

          The tool call’s arguments (checked against its schema).

        • callerstring

          The caller says this (one of the call’s opt-out phrases opts them out).

        • endboolean

          true: the agent ends the conversation (its closing line said).

        • hangUpboolean

          true: the caller hangs up.

        • pressstring

          The caller presses a key (call.dtmf); the call’s opt-out key opts them out.

        • toolstring

          The 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.

        • transferPublicSandboxTransfer

          The agent hands the caller to a person: the call’s transfer target (an AI call or route) — or, in a flow’s ai step, its onEscalate.

          3 fields of transfer
          • answeredboolean

            The person answers (default true).

          • reasonstring

            Why the agent asked (kept, never spoken).

          • talkSecondsinteger

            How 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 connects
      • agentMembershipIdstring (uuid)

        A queue’s wait answered: the seat (membership id) that takes the caller; default the queue’s first member.

      • answeredByinteger

        Numbers rung at once (strategy: simultaneous): which answered, by its place in targets (0-based; default 0).

      • confirmboolean

        Pressed the confirm key when the step asks one (confirm). Default true; false is a pickup that never confirmed — no answer.

      • hangsUpstring

        Who ends the conversation: the caller (default — the call ends) or the party (the flow goes on).

        One ofcallerparty

      • outcomestring

        Default no_answer.

        One ofansweredno_answerbusyfailed

      • ringSecondsinteger

        How long it rang (default 5 when answered, else the step’s ring time). Answered later than the step rings for is no answer.

      • talkSecondsinteger

        How long they talked once connected (default 30).

    • hangUpAfterSecondsinteger

      The 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 inputs
      • afterSecondsinteger

        When, in seconds after the prompt (default 1). Past the gather’s timeoutSeconds the gather times out first and this answers the next one, with what is left.

      • digitsstring

        Keys pressed (0-9, *, #), in order.

      • hangUpboolean

        The caller hangs up here instead.

      • speechstring

        What 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 recordings
      • keystring

        A key pressed to end it: one of a voicemail’s keys, or the finish key.

      • secondsinteger

        How long it runs (default: the speech at 2.5 words a second). Held to the step’s maxSeconds.

      • speechstring

        What they say: the voicemail’s transcript.

      • thenstring

        After it: hang up (default) or stay on the line.

        One ofhang_upstay

  • tostring

    The sandbox number called, E.164 (or numberId).

Response 201PublicSandboxInboundCallResult

  • callPublicCallRequired

    The test call (direction: inbound, livemode: false) as it began — in_progress, its route running; failed when its route refused it. Its events reach your test endpoints as it plays.

    Its fields are listed under Get call

  • objectstringRequired

    One ofsandbox_inbound_call

Errors

Request
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"
      }
    ]
  }
}'
Response 201 (json)
{
  "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/v1/sandbox/inbound-messages

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-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

  • channelstringRequired

    One ofwhatsappsmsemail

  • contactIdstring (uuid)

    A test contact (one a test key created).

  • fromPublicSandboxInboundFrom

    2 fields of from
    • emailstring

      Email: the customer’s address. A test contact with it is used, or created.

    • phonestring

      WhatsApp 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.received lists them pending, and the media worker stores a real sample file of each type (GET /v1/messages/{id}/media?index=), then message.media.ready.

    1 field of media
    • contentTypestringRequired

      Its type: the sandbox stores a real sample file of it.

      One ofimage/jpegimage/pngimage/gifaudio/wavvideo/mp4application/pdftext/vcard

  • subjectstring

    Email only: the subject.

  • textstringRequired

    What the customer wrote (empty only for a picture message: media).

Response 201PublicSandboxInboundResult

  • messagePublicMessageRequired

    The inbound test message (direction: inbound, livemode: false); message.received was sent to your test webhook endpoints.

    Its fields are listed under Get message

  • objectstringRequired

    One ofsandbox_inbound_message

  • replyPublicMessage | nullRequired

    T8 — 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/sms helpReply) — a test SMS on the thread, message.sent and message.delivered to 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

Request
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?"
}'
Response 201 (json)
{
  "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/v1/sandbox/sms-registrations/review

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-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

  • idstring (uuid)Required

    The brand’s, campaign’s or number assignment’s id.

  • kindstringRequired

    What is decided: a brand, a campaign or a number_assignment.

    One ofbrandcampaignnumber_assignment

  • reasonstring

    Why it was rejected (its statusReason).

  • statusstringRequired

    The registry’s verdict.

    One ofapprovedrejected

Response 200PublicSandboxSmsRegistration

Show the 11 fields
  • brandIdstring (uuid)Required

  • campaignIdstring (uuid) | nullRequired

  • idstring (uuid)Required

  • kindstringRequired

    One ofbrandcampaignnumber_assignment

  • livemodebooleanRequired

    Always false: a sandbox registration.

  • numberIdstring (uuid) | nullRequired

  • previousStatusstring | nullRequired

    Where it was before this verdict.

    One ofpendingsubmittedapprovedrejectedexpiredremoved

  • referencestringRequired

  • senderIdstring (uuid) | nullRequired

  • statusstringRequired

    One ofpendingsubmittedapprovedrejectedexpiredremoved

  • statusReasonstring | nullRequired

Errors

Request
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"
}'
Response 200 (json)
{
  "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/v1/sandbox/verifications/review

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-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

  • notestring

    What the organization must do (its reviewNote). Required for needs_info and rejected.

    at most 1000 characters

  • statusstringRequired

    The decision, as a reviewer would make it.

    One ofapprovedneeds_inforejected

Response 200PublicVerification

Show the 15 fields
  • businessPublicVerificationBusinessRequired

    4 fields of business
    • countrystringRequired

      ISO 3166-1 alpha-2; picks the requirement set.

    • entityTypestring | nullRequired

      One ofprivate_limitedllppartnershipproprietorshippublic_limitedtrust_societygovernmentforeign_company

    • jurisdictionstring | nullRequired

      Where below the country the business is registered, when its country asks (a US state of registration, by its USPS code).

    • legalNamestring | nullRequired

  • documentsPublicVerificationDocument[]Required

    The documents uploaded, oldest first — never their file names or a link to them.

    7 fields of documents
    • createdAtstring (date-time)Required

    • idstring (uuid)Required

    • mimeTypestringRequired

    • objectstringRequired

      One ofverification_document

    • sizeBytesintegerRequired

    • statusstringRequired

      erased once the stored file was deleted; the entry only records that it existed and no longer satisfies a requirement.

      One ofstorederased

    • typestringRequired

      One ofpan_cardgst_certificateincorporation_certificateaddress_proofauthorisation_lettersignatory_idnumber_loaothertax_registration

  • idstring (uuid) | nullRequired

    What POST /v1/verifications/:id/documents and …/submit take; null until the verification is first saved.

  • identifiersPublicVerificationIdentifiersRequired

    The last four characters only; the identifiers themselves are sealed and never leave the platform’s review.

    5 fields of identifiers
    • cinLast4string | nullRequired

    • gstinLast4string | nullRequired

    • last4ByKindRecord<string, string>Required

      Every identifier on file, by kind (gstin, pan, cin, ein, company_number, vat_number, registration_number, tax_number), its last four characters. gstinLast4, panLast4 and cinLast4 carry the kinds those fields stand for in the business’s country.

    • panLast4string | nullRequired

    • signatoryPhoneLast4string | nullRequired

  • objectstringRequired

    One ofverification

  • requiredbooleanRequired

    Whether live features wait for approval — a self-serve organization’s live keys, numbers, live sends and calls.

  • requirementsPublicVerificationRequirements | nullRequired

    The documents the business must give (for numberType, when asked). Null until the entity type is chosen.

    4 fields of requirements
    • documentsPublicVerificationRequirement[]Required

      3 fields of documents
      • anyOfstring[]Required

        Any one of these document types satisfies it.

        One ofpan_cardgst_certificateincorporation_certificateaddress_proofauthorisation_lettersignatory_idnumber_loaothertax_registration

      • labelstringRequired

      • satisfiedbooleanRequired

        A stored document of one of those types is on file.

    • identifiersPublicVerificationIdentifierRequirement[]Required

      The 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 identifiers
      • anyOfstring[]Required

        Any one of these identifiers satisfies it.

        One ofgstinpancineincompany_numbervat_numberregistration_numbertax_number

      • labelstringRequired

      • satisfiedbooleanRequired

        One of those identifiers is on file.

    • numberTypestring | nullRequired

      One oflocalmobiletoll_freenationalpromotional_140transactional_160short_code

    • profilestringRequired

      The country’s verification profile — in, us, gb, eu, or international for any other country (GET /v1/verifications/requirements).

      One ofinusgbeuinternational

  • reviewNotestring | nullRequired

    The reviewer’s note to the organization (what to change, or why not).

  • reviewedAtstring (date-time) | nullRequired

  • statusstringRequired

    not_started until the organization first saves its verification (in the console, or POST /v1/verifications). needs_info and rejected carry the reviewer’s reviewNote.

    One ofnot_starteddraftsubmittedin_reviewneeds_infoapprovedrejectedexpired

  • submittedAtstring (date-time) | nullRequired

  • updatedAtstring (date-time) | nullRequired

  • verifiedbooleanRequired

    What the gate reads: verification is not required, or it is approved (and not withdrawn).

  • verifiedAtstring (date-time) | nullRequired

  • versioninteger | nullRequired

    Send it to submit (and, optionally, to a save) — 409 when it moved since you read it.

Errors

Request
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"
}'
Response 200 (json)
{
  "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
}