Jump to

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

API reference

WhatsApp

How these fit together: the Connect WhatsApp guide.

Get WhatsApp account

get/v1/whatsapp/account

The WhatsApp connection: status, numbers, display-name review, quality, messaging limit and billing currency.

The shape whatsapp.account.updated embeds. status is not_connected until a connect session finishes (POST /v1/whatsapp/connect-sessions), needs_attention when the token is invalid or expiring, a number is restricted or quality is RED, and disconnected when the business or Meta removed access. Each number carries the senderId a send takes to go from it rather than the default number.

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

Response 200PublicWhatsAppAccount

Show the 10 fields
  • billingCurrencystring | nullRequired

    The currency Meta bills the WhatsApp account in.

  • businessIdstring | nullRequired

  • connectedAtstring (date-time) | nullRequired

  • connectionMethodstring | nullRequired

    One ofembedded_signupmanual

  • credentialStatusstring | nullRequired

  • messagingLimitstring | nullRequired

  • numbersPublicWhatsAppNumber[]Required

    10 fields of numbers
    • displayPhoneNumberstring | nullRequired

    • isDefaultbooleanRequired

    • messagingTierstring | nullRequired

    • nameStatusstring | nullRequired

      Meta’s display-name review status (APPROVED, PENDING_REVIEW, …).

    • phoneNumberIdstringRequired

      WhatsApp phone_number_id.

    • qualityRatingstring | nullRequired

    • senderIdstring (uuid)Required

      Our id for the number: senderId on POST /v1/messages, to send from it rather than the default number.

    • statusstringRequired

    • throughputstring | nullRequired

    • verifiedNamestring | nullRequired

  • objectstringRequired

    One ofwhatsapp_account

  • statusstringRequired

    needs_attention: the token is invalid or expiring, a number is restricted, or quality is RED. disconnected: access was removed by the business or Meta.

    One ofnot_connectedconnectedneeds_attentiondisconnected

  • wabaIdstring | nullRequired

Errors

Request
curl 'https://api.trovacast.com/v1/whatsapp/account' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "billingCurrency": "INR",
  "businessId": "BUSINESS_ID",
  "connectedAt": "2026-11-05T10:00:00.000Z",
  "connectionMethod": "embedded_signup",
  "credentialStatus": "CREDENTIAL_STATUS",
  "messagingLimit": "MESSAGING_LIMIT",
  "numbers": [
    {
      "displayPhoneNumber": "+91 98765 43210",
      "isDefault": true,
      "messagingTier": "TIER_1K",
      "nameStatus": "NAME_STATUS",
      "phoneNumberId": "PHONE_NUMBER_ID",
      "qualityRating": "GREEN",
      "senderId": "SENDER_ID",
      "status": "active",
      "throughput": "THROUGHPUT",
      "verifiedName": "VERIFIED_NAME"
    }
  ],
  "object": "whatsapp_account",
  "status": "not_connected",
  "wabaId": "WABA_ID"
}

Disconnect WhatsApp account

post/v1/whatsapp/account/disconnect

Disconnects the WhatsApp account (idempotent); sending stops until it is connected again.

Removes the connection and its numbers, drops Trovacast’s webhook subscription on the WhatsApp Business Account and fires whatsapp.account.updated; audited against the key. With nothing connected — never, or a disconnect that already happened — it answers the account as it stands (not_connected). Refused with 409 CONFLICT when a reconnect raced this request (read the account again).

Access: an organization key with the whatsapp:manage scope. Live keys only: a test key is refused with 422 TEST_MODE_UNSUPPORTED.

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.

Response 200PublicWhatsAppAccount

Show the 10 fields
  • billingCurrencystring | nullRequired

    The currency Meta bills the WhatsApp account in.

  • businessIdstring | nullRequired

  • connectedAtstring (date-time) | nullRequired

  • connectionMethodstring | nullRequired

    One ofembedded_signupmanual

  • credentialStatusstring | nullRequired

  • messagingLimitstring | nullRequired

  • numbersPublicWhatsAppNumber[]Required

    10 fields of numbers
    • displayPhoneNumberstring | nullRequired

    • isDefaultbooleanRequired

    • messagingTierstring | nullRequired

    • nameStatusstring | nullRequired

      Meta’s display-name review status (APPROVED, PENDING_REVIEW, …).

    • phoneNumberIdstringRequired

      WhatsApp phone_number_id.

    • qualityRatingstring | nullRequired

    • senderIdstring (uuid)Required

      Our id for the number: senderId on POST /v1/messages, to send from it rather than the default number.

    • statusstringRequired

    • throughputstring | nullRequired

    • verifiedNamestring | nullRequired

  • objectstringRequired

    One ofwhatsapp_account

  • statusstringRequired

    needs_attention: the token is invalid or expiring, a number is restricted, or quality is RED. disconnected: access was removed by the business or Meta.

    One ofnot_connectedconnectedneeds_attentiondisconnected

  • wabaIdstring | nullRequired

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/whatsapp/account/disconnect' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response 200 (json)
{
  "billingCurrency": "INR",
  "businessId": "BUSINESS_ID",
  "connectedAt": "2026-11-05T10:00:00.000Z",
  "connectionMethod": "embedded_signup",
  "credentialStatus": "CREDENTIAL_STATUS",
  "messagingLimit": "MESSAGING_LIMIT",
  "numbers": [
    {
      "displayPhoneNumber": "+91 98765 43210",
      "isDefault": true,
      "messagingTier": "TIER_1K",
      "nameStatus": "NAME_STATUS",
      "phoneNumberId": "PHONE_NUMBER_ID",
      "qualityRating": "GREEN",
      "senderId": "SENDER_ID",
      "status": "active",
      "throughput": "THROUGHPUT",
      "verifiedName": "VERIFIED_NAME"
    }
  ],
  "object": "whatsapp_account",
  "status": "not_connected",
  "wabaId": "WABA_ID"
}

Create WhatsApp connect session

post/v1/whatsapp/connect-sessions

Creates a hosted WhatsApp connect link.

Returns a single-use link to Trovacast’s hosted Embedded Signup page. Open it in a new window; poll GET /v1/whatsapp/connect-sessions/{id} (or GET /v1/whatsapp/account) for the outcome. The link opens within 24 hours, and the signup must finish within 10 minutes of opening it.

Access: an organization key with the whatsapp:manage scope. Live keys only: a test key is refused with 422 TEST_MODE_UNSUPPORTED.

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

  • returnUrlstring

    Where the hosted page offers to send the person when they are done. Must be an https URL on an origin this deployment allows; omit for no button.

    at most 2048 characters

Response 201WhatsAppConnectSessionCreated

  • expiresAtstring (date-time)Required

    The link must be opened before this (24 h). Once opened, the signup must finish within 10 minutes.

  • idstring (uuid)Required

  • statusstringRequired

    One ofCREATEDOPENEDCONNECTEDREGISTEREDFAILEDEXPIRED

  • urlstringRequired

    Open this in a new window. Shown once: the secret part is in the fragment, which the API stores only as a hash and never returns again.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/whatsapp/connect-sessions' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "returnUrl": "https://admin.shopify.com/store/example/apps/trovacast"
}'
Response 201 (json)
{
  "expiresAt": "2026-11-05T10:00:00.000Z",
  "id": "ID",
  "status": "CREATED",
  "url": "https://trovacast.com/connect/whatsapp#t=…"
}

Get WhatsApp connect session

get/v1/whatsapp/connect-sessions/{sessionId}

Where a hosted WhatsApp connect session stands.

Poll it after opening the link: status moves CREATED → OPENED → CONNECTED → REGISTERED, or to FAILED with a failureReason, and reads EXPIRED when the link was not opened in time or the signup did not finish by activeUntil. registration says whether the number still waits for its two-step PIN. A session of another organization reads as missing; 503 WHATSAPP_CONNECT_UNAVAILABLE when sessions cannot be read right now (retry).

Access: an organization key with the whatsapp:manage scope. Live keys only: a test key is refused with 422 TEST_MODE_UNSUPPORTED.

Path parameters

  • sessionIdstringRequired

Response 200WhatsAppConnectSession

  • activeUntilstring (date-time) | nullRequired

    Set once opened: the signup must finish before this.

  • createdAtstring (date-time)Required

  • expiresAtstring (date-time)Required

  • failureReasonstring | nullRequired

    One ofCANCELLEDMETA_ERRORCONNECT_FAILEDPIN_ATTEMPTS_EXHAUSTEDNUMBER_UNAVAILABLEKEY_INVALIDNOT_ENTITLED

  • idstring (uuid)Required

  • registrationstring | nullRequired

    After the account connected: NOT_REQUIRED (already on the Cloud API), PIN_REQUIRED (waiting for the two-step PIN), REGISTERED, or NOT_REQUESTED (Meta reported no number).

    One ofNOT_REQUIREDPIN_REQUIREDREGISTEREDNOT_REQUESTED

  • returnUrlstring | nullRequired

  • statusstringRequired

    CREATED → OPENED → CONNECTED → REGISTERED, or FAILED; EXPIRED when it ran out of time first. CONNECTED is final when registration is NOT_REQUESTED.

    One ofCREATEDOPENEDCONNECTEDREGISTEREDFAILEDEXPIRED

Errors

Request
curl 'https://api.trovacast.com/v1/whatsapp/connect-sessions/SESSION_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "activeUntil": "2026-11-05T10:00:00.000Z",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "expiresAt": "2026-11-05T10:00:00.000Z",
  "failureReason": "CANCELLED",
  "id": "ID",
  "registration": "NOT_REQUIRED",
  "returnUrl": "RETURN_URL",
  "status": "CREATED"
}

List WhatsApp senders

get/v1/whatsapp/senders

Lists the WhatsApp numbers you can send from, with whether each can send now and Meta’s review, quality and tier.

Every number of the organization’s WhatsApp account, in one page, oldest first (nextCursor is always null): the id senderId takes on POST /v1/messages (channel whatsapp), WhatsApp’s phone_number_id, the display number and verified name, Meta’s display-name review (nameStatus), quality rating, messaging tier and throughput as Meta spells them, its status, whether it is the default, and canSend — true only while the number is active and the account is connected. Numbers join by connecting the account (POST /v1/whatsapp/connect-sessions) and Meta reviews them, so there is nothing to register here. An organization with no WhatsApp account gets an empty page. Refused with 403 ENTITLEMENT_MESSAGING_DISABLED when the organization does not have messaging.

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

Response 200PublicWhatsAppSenderPage

  • dataPublicWhatsAppSender[]Required

    Its fields are listed under Get WhatsApp sender

  • nextCursorstring | nullRequired

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

Errors

Request
curl 'https://api.trovacast.com/v1/whatsapp/senders' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "data": [
    {
      "canSend": true,
      "createdAt": "2026-11-05T10:00:00.000Z",
      "displayPhoneNumber": "+91 98765 43210",
      "id": "ID",
      "isDefault": true,
      "messagingTier": "TIER_1K",
      "nameStatus": "APPROVED",
      "object": "whatsapp_sender",
      "phoneNumberId": "PHONE_NUMBER_ID",
      "qualityRating": "GREEN",
      "status": "pending_verification",
      "throughput": "THROUGHPUT",
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "verifiedName": "VERIFIED_NAME"
    }
  ],
  "nextCursor": "NEXT_CURSOR"
}

Get WhatsApp sender

get/v1/whatsapp/senders/{senderId}

Reads one WhatsApp sender and whether it can send now.

One of the organization’s WhatsApp numbers, as GET /v1/whatsapp/senders lists it: the id senderId takes, WhatsApp’s phone_number_id, Meta’s display-name review, quality rating and tier, its status (restricted or disabled when Meta limited or banned the number), whether it is the default, and canSend (the number is active and the account connected). Refused with 404 NOT_FOUND for a number that is not yours, or when the organization has no WhatsApp account, and 403 ENTITLEMENT_MESSAGING_DISABLED when it does not have messaging.

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

Path parameters

  • senderIdstringRequired

Response 200PublicWhatsAppSender

Show the 14 fields
  • canSendbooleanRequired

    Whether a send from it can go now: the number is active and the WhatsApp account is connected.

  • createdAtstring (date-time)Required

  • displayPhoneNumberstring | nullRequired

  • idstring (uuid)Required

    What senderId takes on POST /v1/messages (WhatsApp).

  • isDefaultbooleanRequired

  • messagingTierstring | nullRequired

  • nameStatusstring | nullRequired

    Meta’s review of the display name (APPROVED, PENDING_REVIEW, DECLINED, …), as Meta spells it.

  • objectstringRequired

    One ofwhatsapp_sender

  • phoneNumberIdstringRequired

    WhatsApp’s phone_number_id.

  • qualityRatingstring | nullRequired

    Meta’s quality rating: GREEN, YELLOW, RED, UNKNOWN.

  • statusstringRequired

    restricted or disabled when Meta limited or banned the number (whatsapp.account.updated says when).

    One ofpending_verificationactiverestricteddisabled

  • throughputstring | nullRequired

  • updatedAtstring (date-time)Required

  • verifiedNamestring | nullRequired

Errors

Request
curl 'https://api.trovacast.com/v1/whatsapp/senders/SENDER_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "canSend": true,
  "createdAt": "2026-11-05T10:00:00.000Z",
  "displayPhoneNumber": "+91 98765 43210",
  "id": "ID",
  "isDefault": true,
  "messagingTier": "TIER_1K",
  "nameStatus": "APPROVED",
  "object": "whatsapp_sender",
  "phoneNumberId": "PHONE_NUMBER_ID",
  "qualityRating": "GREEN",
  "status": "pending_verification",
  "throughput": "THROUGHPUT",
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "verifiedName": "VERIFIED_NAME"
}