Jump to

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

API reference

Organizations

How these fit together: the Integration keys guide.

List organizations

get/v1/organizations

Finds the organization you provisioned for an externalReference (zero or one).

A lookup, not a listing: externalReference is required, and the page holds zero or one organization. Only organizations this integration provisioned are searched, so another integration’s organization with the same reference is never found.

Access: an integration key with the organizations:read scope.

Query parameters

  • externalReferencestringRequired

    The reference you provisioned the organization with (exact match). Only your own organizations are searched.

Response 200PublicOrganizationPage

  • dataPublicOrganization[]Required

    at most 1 items

    Its fields are listed under Get organization

  • nextCursorstring | nullRequired

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

Errors

Request
curl 'https://api.trovacast.com/v1/organizations?externalReference=acme.myshopify.com' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "data": [
    {
      "billing": {
        "payer": "organization",
        "spend": {
          "amountMinor": 182350,
          "periodEnd": "2026-11-05T10:00:00.000Z",
          "periodStart": "2026-11-05T10:00:00.000Z"
        },
        "spendCap": {
          "amountMinor": 500000,
          "period": "month"
        }
      },
      "country": "IN",
      "createdAt": "2026-11-05T10:00:00.000Z",
      "entitlements": {
        "calling": true,
        "messaging": true
      },
      "erasure": {
        "requestedAt": "2026-11-05T10:00:00.000Z",
        "status": "erasing"
      },
      "externalReference": "acme.myshopify.com",
      "id": "ID",
      "livemode": true,
      "name": "NAME",
      "object": "organization",
      "planId": "PLAN_ID",
      "slug": "SLUG",
      "status": "active",
      "suspendedAt": "2026-11-05T10:00:00.000Z",
      "suspendedBy": "integration",
      "whatsapp": {
        "status": "not_connected"
      }
    }
  ],
  "nextCursor": "NEXT_CURSOR"
}

Create organization

post/v1/organizations

Provisions an organization for a customer (idempotent on externalReference).

An organization with the product lines asked for (entitlements, messaging only by default), on the plan asked for (planId, your integration’s default plan by default) — each within your integration’s terms: its partner’s ceilings and plan list when the platform bound it to one, else messaging on the default plan (409 PRODUCT_LINE_NOT_OFFERED, 409 PLAN_NOT_OFFERED) — in country (the deployment’s home country by default), paid for as billing says (its own wallet by default; payer: integration debits your integration’s billing organization’s wallet instead, under an optional monthly spendCap — 409 BILLING_PAYER_NOT_CONFIGURED until the platform set that organization), with a first team and ownerEmail seated as an invited administrator — no invitation email is sent. When the platform requires your integration’s organizations to pass business verification, their live features wait for it, as a self-serve signup’s do. 201 when it was created; 200 with the existing organization when this integration already provisioned one for externalReference, whatever else the body says (concurrent requests make one). Audited against the key (organization.provisioned). Refused with 409 ORGANIZATION_ERASING while that organization is being erased (provision it again once the erasure finishes).

Access: an integration key with the organizations: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

  • billingPublicOrganizationBillingInput

    Who pays its charges, and the cap on what you pay for it. Default: its own wallet. A test organization keeps the setting and is never billed.

    2 fields of billing
    • payerstringRequired

      integration: its usage and fees debit your integration’s billing organization’s wallet (set by the platform — 409 BILLING_PAYER_NOT_CONFIGURED until it is), each attributed to it; organization: its own wallet, as before.

      One oforganizationintegration

    • spendCapPublicSpendCapInput | null

      With payer: integration only: the monthly cap on what you pay for it — a dial, send or number that would pass it is refused 402 BILLING_SPEND_CAP_REACHED (plan fees and number renewals are charged and count toward it). Omitted or null: no cap.

      2 fields of spendCap
      • amountMinorintegerRequired

        The most the organization’s usage and fees may take, net, from your billing organization’s wallet in a UTC calendar month (minor units).

        1–2000000000

      • periodstringRequired

        A UTC calendar month.

        One ofmonth

  • countrystring

    ISO 3166-1 alpha-2 country of the business: the default country of its business verification. Default: the deployment’s home country.

  • entitlementsPublicOrganizationEntitlementsInput

    The product lines it starts with, within your integration’s terms (its partner’s ceilings, or messaging only for an integration bound to no partner — else 409 PRODUCT_LINE_NOT_OFFERED). Default: messaging only.

    2 fields of entitlements
    • callingbooleanRequired

      Calls: numbers, inbound and /v1/calls.

    • messagingbooleanRequired

      Messages: WhatsApp, SMS and email.

  • externalReferencestringRequired

    Your id for the customer (the Shopify app: the shop’s myshopify domain). One organization per value.

    at most 255 characters

  • localestring

    default "en-IN"

  • namestringRequired

    2–120 characters

  • ownerEmailstringRequired

    Seated as an invited administrator. No email is sent until they claim the seat.

  • planIdstring (uuid)

    A plan your integration may give (on its partner’s list, or its default plan — else 409 PLAN_NOT_OFFERED). Default: your integration’s default plan.

  • timezonestringRequired

    IANA time zone.

Response 200PublicOrganization

Already provisioned for this externalReference.

Its fields are listed under Get organization.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/organizations' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Acme Store",
  "externalReference": "acme.myshopify.com",
  "ownerEmail": "owner@acme.example",
  "timezone": "Asia/Kolkata"
}'
Response 200 (json)
{
  "billing": {
    "payer": "organization",
    "spend": {
      "amountMinor": 182350,
      "periodEnd": "2026-11-05T10:00:00.000Z",
      "periodStart": "2026-11-05T10:00:00.000Z"
    },
    "spendCap": {
      "amountMinor": 500000,
      "period": "month"
    }
  },
  "country": "IN",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "entitlements": {
    "calling": true,
    "messaging": true
  },
  "erasure": {
    "requestedAt": "2026-11-05T10:00:00.000Z",
    "status": "erasing"
  },
  "externalReference": "acme.myshopify.com",
  "id": "ID",
  "livemode": true,
  "name": "NAME",
  "object": "organization",
  "planId": "PLAN_ID",
  "slug": "SLUG",
  "status": "active",
  "suspendedAt": "2026-11-05T10:00:00.000Z",
  "suspendedBy": "integration",
  "whatsapp": {
    "status": "not_connected"
  }
}

Get organization

get/v1/organizations/{organizationId}

An organization’s lifecycle, product lines and WhatsApp connection status.

Identity, status (and who holds a suspension: suspendedBy), product lines (entitlements), plan, country, whether WhatsApp is connected and, while one runs, the erasure’s state — never the organization’s own data. Once an erasure completes the organization is gone and this answers 404.

Access: an integration key with the organizations:read scope.

Path parameters

  • organizationIdstringRequired

Response 200PublicOrganization

Show the 16 fields
  • billingPublicOrganizationBillingRequired

    Who pays its usage and fees (payer): its own wallet, or your integration’s billing organization’s — with the monthly cap on what you pay for it and this month’s spend.

    3 fields of billing
    • payerstringRequired

      organization: its own wallet. integration: the wallet of the billing organization the platform set for the integration that provisioned it — each charge debits that wallet, attributed to this organization, and its own wallet is not spent.

      One oforganizationintegration

    • spendPublicSpend | nullRequired

      While the integration pays: what this month has taken from it so far; null otherwise.

      3 fields of spend
      • amountMinorintegerRequired

        Net: charges less what was credited back (a refunded message, a re-rated call), as posted this month.

      • periodEndstring (date-time)Required

        Exclusive.

      • periodStartstring (date-time)Required

        The month’s start (UTC).

    • spendCapPublicSpendCap | nullRequired

      While the integration pays: the monthly cap on what it pays (dials, sends and numbers past it are refused 402 BILLING_SPEND_CAP_REACHED); null for none.

      2 fields of spendCap
      • amountMinorintegerRequired

        The most its usage and fees may take, net, from the paying account in a month (minor units of the currency).

        at least 1

      • periodstringRequired

        A UTC calendar month.

        One ofmonth

  • countrystring | nullRequired

    ISO 3166-1 alpha-2: the country you provisioned it in (null for one provisioned before the field existed).

  • createdAtstring (date-time)Required

  • entitlementsPublicOrganizationEntitlementsRequired

    2 fields of entitlements
    • callingbooleanRequired

    • messagingbooleanRequired

  • erasurePublicOrganizationErasureState | nullRequired

    Set while DELETE /v1/organizations/{id} is in flight; a 404 afterwards means the erasure finished.

    2 fields of erasure
    • requestedAtstring (date-time)Required

    • statusstringRequired

      One oferasingfailed

  • externalReferencestring | nullRequired

  • idstring (uuid)Required

  • livemodebooleanRequired

    False for a test organization: one a TEST integration key provisioned, reached by your TEST keys only, never billed and never live.

  • namestringRequired

  • objectstringRequired

    One oforganization

  • planIdstring (uuid) | nullRequired

    The plan the organization is enrolled on (null only before it was ever enrolled).

  • slugstringRequired

  • statusstringRequired

    One ofactivesuspendedclosed

  • suspendedAtstring (date-time) | nullRequired

  • suspendedBystring | nullRequired

    Who holds the suspension. An integration may lift only its own (integration).

    One ofintegrationplatformpartner

  • whatsappPublicOrganizationWhatsAppRequired

    1 field of whatsapp
    • statusstringRequired

      One ofnot_connectedconnectedneeds_attentiondisconnected

Errors

Request
curl 'https://api.trovacast.com/v1/organizations/ORGANIZATION_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "billing": {
    "payer": "organization",
    "spend": {
      "amountMinor": 182350,
      "periodEnd": "2026-11-05T10:00:00.000Z",
      "periodStart": "2026-11-05T10:00:00.000Z"
    },
    "spendCap": {
      "amountMinor": 500000,
      "period": "month"
    }
  },
  "country": "IN",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "entitlements": {
    "calling": true,
    "messaging": true
  },
  "erasure": {
    "requestedAt": "2026-11-05T10:00:00.000Z",
    "status": "erasing"
  },
  "externalReference": "acme.myshopify.com",
  "id": "ID",
  "livemode": true,
  "name": "NAME",
  "object": "organization",
  "planId": "PLAN_ID",
  "slug": "SLUG",
  "status": "active",
  "suspendedAt": "2026-11-05T10:00:00.000Z",
  "suspendedBy": "integration",
  "whatsapp": {
    "status": "not_connected"
  }
}

Update organization

patch/v1/organizations/{organizationId}

Renames an organization, switches its product lines or moves its plan, within your terms.

Any of name, entitlements (both lines, as they should be), planId and billing (who pays, and the monthly cap on what your integration pays — from the next charge on; 409 BILLING_PAYER_NOT_CONFIGURED for payer: integration until the platform set your billing organization); at least one. Lines and plans must be within your integration’s terms — its partner’s ceilings and plan list when the platform bound it to one, else messaging on your default plan — checked for everything asked before anything changes (409 PRODUCT_LINE_NOT_OFFERED with line, 409 PLAN_NOT_OFFERED); switching a line off is always allowed. A new plan’s period starts now: its fee is charged and the unused share of the old one credited back. The same values again change nothing. Each change is audited against the key (organization.updated, organization.entitlements_changed, billing.subscription.plan_changed). A closed organization is 409 ORGANIZATION_CLOSED.

Access: an integration key with the organizations:write scope.

Path parameters

  • organizationIdstringRequired

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

  • billingPublicOrganizationBillingInput

    Who pays its charges, as it should be (payer, and spendCap — omitted or null for none). Takes effect for charges posted from then on: a refund or re-rating of an earlier charge goes back to the wallet that paid it. Moving to integration ends its own wallet’s say (a past-due plan fee no longer holds it; the integration’s standing does); moving back, its own wallet decides again.

    2 fields of billing
    • payerstringRequired

      integration: its usage and fees debit your integration’s billing organization’s wallet (set by the platform — 409 BILLING_PAYER_NOT_CONFIGURED until it is), each attributed to it; organization: its own wallet, as before.

      One oforganizationintegration

    • spendCapPublicSpendCapInput | null

      With payer: integration only: the monthly cap on what you pay for it — a dial, send or number that would pass it is refused 402 BILLING_SPEND_CAP_REACHED (plan fees and number renewals are charged and count toward it). Omitted or null: no cap.

      2 fields of spendCap
      • amountMinorintegerRequired

        The most the organization’s usage and fees may take, net, from your billing organization’s wallet in a UTC calendar month (minor units).

        1–2000000000

      • periodstringRequired

        A UTC calendar month.

        One ofmonth

  • entitlementsPublicOrganizationEntitlementsInput

    Both product lines, as they should be: switching one off is always allowed; one on must be within your integration’s terms (409 PRODUCT_LINE_NOT_OFFERED).

    2 fields of entitlements
    • callingbooleanRequired

      Calls: numbers, inbound and /v1/calls.

    • messagingbooleanRequired

      Messages: WhatsApp, SMS and email.

  • namestring

    2–120 characters

  • planIdstring (uuid)

    Moves it to a plan your integration may give (409 PLAN_NOT_OFFERED otherwise). The new plan’s period starts now: its fee is charged and the unused share of the old one credited back, as a plan change in the console is.

Response 200PublicOrganization

Its fields are listed under Get organization.

Errors

Request
curl -X PATCH 'https://api.trovacast.com/v1/organizations/ORGANIZATION_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Acme Store"
}'
Response 200 (json)
{
  "billing": {
    "payer": "organization",
    "spend": {
      "amountMinor": 182350,
      "periodEnd": "2026-11-05T10:00:00.000Z",
      "periodStart": "2026-11-05T10:00:00.000Z"
    },
    "spendCap": {
      "amountMinor": 500000,
      "period": "month"
    }
  },
  "country": "IN",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "entitlements": {
    "calling": true,
    "messaging": true
  },
  "erasure": {
    "requestedAt": "2026-11-05T10:00:00.000Z",
    "status": "erasing"
  },
  "externalReference": "acme.myshopify.com",
  "id": "ID",
  "livemode": true,
  "name": "NAME",
  "object": "organization",
  "planId": "PLAN_ID",
  "slug": "SLUG",
  "status": "active",
  "suspendedAt": "2026-11-05T10:00:00.000Z",
  "suspendedBy": "integration",
  "whatsapp": {
    "status": "not_connected"
  }
}

Erase organization

delete/v1/organizations/{organizationId}

Erases an organization the integration provisioned.

Closes the organization and revokes its API keys at once, then — in the background — disconnects WhatsApp, deletes stored credentials, media and recordings, erases every contact and deletes the organization. Idempotent while it runs (202 again); a repeat after a failed run starts it again. Once it completes the organization is gone and requests naming it answer 404.

Access: an integration key with the organizations:erase scope.

Path parameters

  • organizationIdstring (uuid)Required

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. This endpoint converges when run again, so a 5xx stores nothing either: a retry with the same key runs it again. 1–255 visible ASCII characters; kept for 24 hours.

Response 202OrganizationErasure

  • objectstringRequired

    One oforganization_erasure

  • organizationIdstring (uuid)Required

  • requestedAtstring (date-time)Required

    When the erasure was first requested.

  • statusstringRequired

    Always erasing: the work runs in the background. Once it completes the organization no longer exists, and every request naming it answers 404.

    One oferasing

Errors

Request
curl -X DELETE 'https://api.trovacast.com/v1/organizations/ORGANIZATION_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response 202 (json)
{
  "object": "organization_erasure",
  "organizationId": "ORGANIZATION_ID",
  "requestedAt": "2026-11-05T10:00:00.000Z",
  "status": "erasing"
}

Create organization API key

post/v1/organizations/{organizationId}/api-keys

Mints an organization API key; the secret is returned once.

A live key of the organization with the organization scopes you name, listed and revocable on its own Developers page as minted by this integration; secret is in this response only. With an Idempotency-Key, a retry within 24 hours replays the same key (stored encrypted) instead of minting another. Audited (api_key.created); refused with a 409 while the organization is not active or already holds 25 live keys.

Access: an integration key with the api-keys:write scope.

Path parameters

  • organizationIdstringRequired

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

  • expiresAtstring (date-time)

    When the key stops working (in the future). Omit for none.

  • namestringRequired

    1–120 characters

  • scopesstring[]Required

    One ofcontacts:readcontacts:writecontacts:exportconsent:writetemplates:readtemplates:writemessages:readmessages:writebroadcasts:readbroadcasts:writeconversations:readconversations:writewhatsapp:readwhatsapp:manageemail:reademail:managesms:readsms:managedlt:readdlt:writewebhooks:managecalls:readcalls:writerecordings:readrecordings:writetranscripts:readnumbers:readnumbers:writelookup:readapplications:readapplications:writecall-flows:readcall-flows:writequeues:readqueues:writevoice:clientagents:readagents:writebilling:readbilling:manageverifications:readverifications:writeapi-keys:rotatesettings:readsettings:writeverify:readverify:writesubaccounts:readsubaccounts:writeteams:readmembers:read

Response 201CreatedApiKey

Show the 16 fields
  • createdAtstring (date-time)Required

  • createdByApiKeyCreator | nullRequired

    4 fields of createdBy
    • displayNamestring

      The minting user (USER).

    • integrationIdstring

      The minting integration (INTEGRATION).

    • integrationNamestring

      The minting integration (INTEGRATION).

    • typestringRequired

      One ofUSERINTEGRATION

  • expiresAtstring (date-time) | nullRequired

  • idstringRequired

  • kindstringRequired

    One ofORGINTEGRATION

  • last4stringRequired

  • lastUsedAtstring (date-time) | nullRequired

  • modestringRequired

    TEST keys reach only the sandboxes.

    One ofLIVETEST

  • namestringRequired

  • prefixstringRequired

  • revokedAtstring (date-time) | nullRequired

  • rotatedAtstring (date-time) | nullRequired

    When the key was rotated. It keeps working until expiresAt (the overlap), then stops.

  • rotatedFromKeyIdstring (uuid) | nullRequired

    The key this one replaced, when a rotation minted it.

  • scopesstring[]Required

  • secretstringRequired

    The key itself. Returned only in this response and never stored — copy it now.

  • statusstringRequired

    One ofACTIVEEXPIREDREVOKED

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/organizations/ORGANIZATION_ID/api-keys' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Shopify app",
  "scopes": [
    "contacts:read"
  ]
}'
Response 201 (json)
{
  "createdAt": "2026-11-05T10:00:00.000Z",
  "createdBy": {
    "displayName": "DISPLAY_NAME",
    "integrationId": "INTEGRATION_ID",
    "integrationName": "INTEGRATION_NAME",
    "type": "USER"
  },
  "expiresAt": "2026-11-05T10:00:00.000Z",
  "id": "ID",
  "kind": "ORG",
  "last4": "x9Yz",
  "lastUsedAt": "2026-11-05T10:00:00.000Z",
  "mode": "LIVE",
  "name": "NAME",
  "prefix": "tc_live_AbCd",
  "revokedAt": "2026-11-05T10:00:00.000Z",
  "rotatedAt": "2026-11-05T10:00:00.000Z",
  "rotatedFromKeyId": "ROTATED_FROM_KEY_ID",
  "scopes": [
    "SCOPES"
  ],
  "secret": "tc_live_AbCd…",
  "status": "ACTIVE"
}

Revoke organization API key

delete/v1/organizations/{organizationId}/api-keys/{keyId}

Revokes an organization API key this integration minted (immediate, idempotent).

Only a key this integration minted — one the organization’s own administrators minted answers 404. The key stops authenticating at once, together with the rest of its rotation chain (the key it replaced and any key that replaced it). Revoking a revoked key answers it again; a revocation is audited (api_key.revoked).

Access: an integration key with the api-keys:write scope.

Path parameters

  • organizationIdstringRequired

  • keyIdstringRequired

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

Show the 15 fields
  • createdAtstring (date-time)Required

  • createdByApiKeyCreator | nullRequired

    4 fields of createdBy
    • displayNamestring

      The minting user (USER).

    • integrationIdstring

      The minting integration (INTEGRATION).

    • integrationNamestring

      The minting integration (INTEGRATION).

    • typestringRequired

      One ofUSERINTEGRATION

  • expiresAtstring (date-time) | nullRequired

  • idstringRequired

  • kindstringRequired

    One ofORGINTEGRATION

  • last4stringRequired

  • lastUsedAtstring (date-time) | nullRequired

  • modestringRequired

    TEST keys reach only the sandboxes.

    One ofLIVETEST

  • namestringRequired

  • prefixstringRequired

  • revokedAtstring (date-time) | nullRequired

  • rotatedAtstring (date-time) | nullRequired

    When the key was rotated. It keeps working until expiresAt (the overlap), then stops.

  • rotatedFromKeyIdstring (uuid) | nullRequired

    The key this one replaced, when a rotation minted it.

  • scopesstring[]Required

  • statusstringRequired

    One ofACTIVEEXPIREDREVOKED

Errors

Request
curl -X DELETE 'https://api.trovacast.com/v1/organizations/ORGANIZATION_ID/api-keys/KEY_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response 200 (json)
{
  "createdAt": "2026-11-05T10:00:00.000Z",
  "createdBy": {
    "displayName": "DISPLAY_NAME",
    "integrationId": "INTEGRATION_ID",
    "integrationName": "INTEGRATION_NAME",
    "type": "USER"
  },
  "expiresAt": "2026-11-05T10:00:00.000Z",
  "id": "ID",
  "kind": "ORG",
  "last4": "x9Yz",
  "lastUsedAt": "2026-11-05T10:00:00.000Z",
  "mode": "LIVE",
  "name": "NAME",
  "prefix": "tc_live_AbCd",
  "revokedAt": "2026-11-05T10:00:00.000Z",
  "rotatedAt": "2026-11-05T10:00:00.000Z",
  "rotatedFromKeyId": "ROTATED_FROM_KEY_ID",
  "scopes": [
    "SCOPES"
  ],
  "status": "ACTIVE"
}

Erase organization contact

delete/v1/organizations/{organizationId}/contacts/{contactId}

Erases a contact and everything held about them.

The same erasure as DELETE /v1/contacts/:id, for an organization the integration provisioned, whatever its status. Idempotent: an already-erased contact answers 204 again.

Access: an integration key with the organizations:data-subjects scope.

Path parameters

  • organizationIdstring (uuid)Required

  • contactIdstring (uuid)Required

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. This endpoint converges when run again, so a 5xx stores nothing either: a retry with the same key runs it again. 1–255 visible ASCII characters; kept for 24 hours.

Response 204

Erased (or already erased).

Errors

Request
curl -X DELETE 'https://api.trovacast.com/v1/organizations/ORGANIZATION_ID/contacts/CONTACT_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Answers 204 with no body.

Export organization contact

get/v1/organizations/{organizationId}/contacts/{contactId}/export

Exports everything held about a contact, for its data subject.

The same export as GET /v1/contacts/:id/export — the phone number and email in full — for an organization the integration provisioned, whatever its status. Each export is audited against the integration’s key.

Access: an integration key with the organizations:data-subjects scope.

Path parameters

  • organizationIdstring (uuid)Required

  • contactIdstring (uuid)Required

Response 200ContactExport

Show the 11 fields
  • attestationsContactExportAttestation[]Required

    8 fields of attestations
    • channelstringRequired

      One ofwhatsappemailsms

    • createdAtstring (date-time)Required

    • idstring (uuid)Required

    • optInAtstring (date-time) | nullRequired

    • originstringRequired

    • revokedAtstring (date-time) | nullRequired

    • sourcestringRequired

    • statusstringRequired

      One ofunknownopted_inopted_out

  • callsContactExportCall[]Required

    8 fields of calls
    • answeredAtstring (date-time) | nullRequired

    • directionstringRequired

      One ofinboundoutbound

    • durationSecondsinteger | nullRequired

    • endedAtstring (date-time) | nullRequired

    • extractionContactExportCallExtraction | nullRequired

      What the call’s AI agent extracted from the conversation with its extraction schema, unmasked; null when nothing was extracted.

      4 fields of extraction
      • dataobject | nullRequired

        The data, matching the agent’s schema. Null unless ready.

      • extractedAtstring (date-time)Required

      • failureCodestring | nullRequired

        One ofPROVIDER_FAILEDDECLINEDINVALID_OUTPUTUNREADABLE

      • statusstringRequired

        One ofreadyfailed

    • idstring (uuid)Required

    • queuedAtstring (date-time)Required

    • statusstringRequired

  • consentsContactExportConsent[]Required

    13 fields of consents
    • attestationIdstring (uuid) | nullRequired

    • capturedFromCallIdstring (uuid) | nullRequired

    • channelstringRequired

      One ofwhatsappemailsms

    • createdAtstring (date-time)Required

    • marketingstringRequired

      One ofunknownopted_inopted_out

    • marketingEvidencestring | nullRequired

    • marketingOptInAtstring (date-time) | nullRequired

    • marketingSourcestring | nullRequired

    • updatedAtstring (date-time)Required

    • updatesstringRequired

      One ofunknownopted_inopted_out

    • updatesEvidencestring | nullRequired

    • updatesOptInAtstring (date-time) | nullRequired

    • updatesSourcestring | nullRequired

  • contactContactExportContactRequired

    11 fields of contact
    • createdAtstring (date-time)Required

    • displayNamestringRequired

    • doNotContactbooleanRequired

    • externalReferencestring | nullRequired

    • idstring (uuid)Required

    • livemodebooleanRequired

    • objectstringRequired

      One ofcontact

    • phoneContactExportPhone | nullRequired

      2 fields of phone
      • countryCodestring | nullRequired

      • last4stringRequired

    • statusstringRequired

      One ofactiveblockedarchived

    • updatedAtstring (date-time)Required

    • whatsappContactExportWhatsAppIdentityRequired

      2 fields of whatsapp
      • bsuidstring | nullRequired

      • usernamestring | nullRequired

  • conversationsContactExportConversation[]Required

    14 fields of conversations
    • channelstringRequired

      One ofwhatsappemailsms

    • contactIdstring (uuid)Required

    • createdAtstring (date-time)Required

    • idstring (uuid)Required

    • lastInboundAtstring (date-time) | nullRequired

    • lastMessageAtstring (date-time) | nullRequired

    • lastOutboundAtstring (date-time) | nullRequired

    • livemodebooleanRequired

      False for a test thread (a test contact’s, or one on the platform’s test sender).

    • objectstringRequired

      One ofconversation

    • senderIdstring (uuid) | nullRequired

    • senderRefstringRequired

    • serviceWindowExpiresAtstring (date-time) | nullRequired

    • serviceWindowOpenbooleanRequired

    • statusstringRequired

      One ofopenresolved

  • exportedAtstring (date-time)Required

  • followUpsContactExportFollowUp[]Required

    6 fields of followUps
    • completedAtstring (date-time) | nullRequired

    • dueAtstring (date-time)Required

    • idstring (uuid)Required

    • notesstring | nullRequired

    • statusstringRequired

    • titlestringRequired

  • messagesContactExportMessage[]Required

    30 fields of messages
    • buttonContactExportMessageButton | nullRequired

      2 fields of button
      • payloadstringRequired

      • textstring | nullRequired

    • channelstringRequired

      One ofwhatsappemailsms

    • contactIdstring (uuid)Required

    • contactsContactExportSharedContact[] | nullRequired

      4 fields of contacts
      • emailsContactExportSharedContactEmail[]Required

        2 fields of emails
        • emailstringRequired

        • typestring | nullRequired

      • namestring | nullRequired

      • organizationstring | nullRequired

      • phonesContactExportSharedContactPhone[]Required

        2 fields of phones
        • phonestringRequired

        • typestring | nullRequired

    • contextContactExportMessageContext | nullRequired

      2 fields of context
      • messageIdstring (uuid) | nullRequired

      • providerMessageIdstringRequired

    • conversationIdstring (uuid)Required

    • createdAtstring (date-time)Required

    • deliveredAtstring (date-time) | nullRequired

    • directionstringRequired

      One ofinboundoutbound

    • emailContactExportMessageEmail | nullRequired

      6 fields of email
      • attachmentsContactExportMessageEmailAttachment[]Required

        What the email carried (the files are not kept).

        3 fields of attachments
        • contentTypestringRequired

        • filenamestringRequired

        • sizeintegerRequired

          Bytes, decoded.

      • bccstring[]Required

        Blind copies, masked.

      • ccstring[]Required

        Copies, masked.

      • fromstring | nullRequired

      • subjectstring | nullRequired

      • tostring | nullRequired

    • failedAtstring (date-time) | nullRequired

    • failureContactExportMessageFailure | nullRequired

      2 fields of failure
      • codestringRequired

      • reasonstringRequired

    • idstring (uuid)Required

    • livemodebooleanRequired

      False when a test-mode (tc_test_…) key created it: it went to a sandbox, never to a real provider, and was never billed.

    • locationContactExportMessageLocation | nullRequired

      5 fields of location
      • addressstring | nullRequired

      • latitudenumberRequired

      • longitudenumberRequired

      • namestring | nullRequired

      • urlstring | nullRequired

    • mediaContactExportMessageMedia | nullRequired

      6 fields of media
      • failureCodestring | nullRequired

      • fileNamestring | nullRequired

      • kindstringRequired

      • mimeTypestring | nullRequired

      • sizeBytesinteger | nullRequired

      • statusstringRequired

        One ofpendingreadyfailedrejected

    • metadataRecord<string, string>Required

    • objectstringRequired

      One ofmessage

    • orderContactExportMessageOrder | nullRequired

      3 fields of order
      • catalogIdstring | nullRequired

      • itemsContactExportMessageOrderItem[]Required

        4 fields of items
        • currencystring | nullRequired

        • itemPricenumber | nullRequired

        • productRetailerIdstringRequired

        • quantityintegerRequired

      • textstring | nullRequired

    • pricingContactExportMessagePricing | nullRequired

      4 fields of pricing
      • billableboolean | nullRequired

      • categorystring | nullRequired

      • modelstring | nullRequired

      • typestring | nullRequired

    • providerMessageIdstring | nullRequired

    • reactionContactExportMessageReaction | nullRequired

      1 field of reaction
      • emojistring | nullRequired

    • readAtstring (date-time) | nullRequired

    • sentAtstring (date-time) | nullRequired

    • smsContactExportMessageSms | nullRequired

      8 fields of sms
      • countrystring | nullRequired

      • encodingstringRequired

        One ofgsm7ucs2

      • expiresAtstring (date-time) | nullRequired

      • headerstringRequired

        The DLT header the SMS went out from.

      • keywordstring | nullRequired

        One ofstopstarthelp

      • priceContactExportMessageSmsPrice | nullRequired

        2 fields of price
        • amountstringRequired

        • currencystringRequired

          One ofUSD

      • segmentsintegerRequired

      • sendAfterstring (date-time) | nullRequired

    • statusstringRequired

      One ofqueuedsendingsentdeliveredreadfailedreceived

    • templateContactExportMessageTemplate | nullRequired

      3 fields of template
      • idstring (uuid)Required

      • languagestringRequired

      • namestringRequired

    • textstring | nullRequired

    • typestringRequired

    • updatedAtstring (date-time)Required

  • objectstringRequired

    One ofcontact_export

  • personalDataContactExportPersonalDataRequired

    16 fields of personalData
    • alternatePhonestring | nullRequired

    • archivedAtstring (date-time) | nullRequired

    • citystring | nullRequired

    • companystring | nullRequired

    • contactConsentContactExportContactConsentRequired

      4 fields of contactConsent
      • evidencestring | nullRequired

      • sourcestring | nullRequired

      • statusstringRequired

      • updatedAtstring (date-time) | nullRequired

    • customFieldsobject | nullRequired

    • emailstring | nullRequired

    • jobTitlestring | nullRequired

    • leadSourcestring | nullRequired

    • lifecycleStagestringRequired

    • notesstring | nullRequired

    • phonestring | nullRequired

      The full number (E.164). The one place the API returns it: it is the subject’s own data.

    • preferredLanguagestring | nullRequired

    • statestring | nullRequired

    • tagsstring[]Required

    • undecryptableFieldsstring[]Required

      Fields reported as null because no configured key could decrypt them.

  • verificationsContactExportVerification[]Required

    One-time-code verifications (/v1/verify) sent to the contact’s phone, alternate phone or email — matched by blind index, in this organization, test mode included. Kept 30 days after the code expired; erased with the contact.

    11 fields of verifications
    • approvedAtstring (date-time) | nullRequired

    • channelstringRequired

      One ofsmswhatsappvoiceemail

    • createdAtstring (date-time)Required

    • endedAtstring (date-time) | nullRequired

    • expiresAtstring (date-time)Required

    • idstring (uuid)Required

    • livemodebooleanRequired

    • metadataRecord<string, string> | nullRequired

    • sendCountintegerRequired

    • statusstringRequired

    • tostring | nullRequired

      The phone number or email it was sent to, in full; null when it can no longer be decrypted.

Errors

Request
curl 'https://api.trovacast.com/v1/organizations/ORGANIZATION_ID/contacts/CONTACT_ID/export' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "attestations": [
    {
      "channel": "whatsapp",
      "createdAt": "2026-11-05T10:00:00.000Z",
      "id": "ID",
      "optInAt": "2026-11-05T10:00:00.000Z",
      "origin": "BULK",
      "revokedAt": "2026-11-05T10:00:00.000Z",
      "source": "SOURCE",
      "status": "unknown"
    }
  ],
  "calls": [
    {
      "answeredAt": "2026-11-05T10:00:00.000Z",
      "direction": "inbound",
      "durationSeconds": 1,
      "endedAt": "2026-11-05T10:00:00.000Z",
      "extraction": {
        "data": {
          "callbackRequested": true,
          "preferredDate": "2026-11-07"
        },
        "extractedAt": "2026-11-05T10:00:00.000Z",
        "failureCode": "PROVIDER_FAILED",
        "status": "ready"
      },
      "id": "ID",
      "queuedAt": "2026-11-05T10:00:00.000Z",
      "status": "completed"
    }
  ],
  "consents": [
    {
      "attestationId": "ATTESTATION_ID",
      "capturedFromCallId": "CAPTURED_FROM_CALL_ID",
      "channel": "whatsapp",
      "createdAt": "2026-11-05T10:00:00.000Z",
      "marketing": "unknown",
      "marketingEvidence": "MARKETING_EVIDENCE",
      "marketingOptInAt": "2026-11-05T10:00:00.000Z",
      "marketingSource": "MARKETING_SOURCE",
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "updates": "unknown",
      "updatesEvidence": "UPDATES_EVIDENCE",
      "updatesOptInAt": "2026-11-05T10:00:00.000Z",
      "updatesSource": "UPDATES_SOURCE"
    }
  ],
  "contact": {
    "createdAt": "2026-11-05T10:00:00.000Z",
    "displayName": "DISPLAY_NAME",
    "doNotContact": true,
    "externalReference": "EXTERNAL_REFERENCE",
    "id": "ID",
    "livemode": true,
    "object": "contact",
    "phone": {
      "countryCode": "COUNTRY_CODE",
      "last4": "3210"
    },
    "status": "active",
    "updatedAt": "2026-11-05T10:00:00.000Z",
    "whatsapp": {
      "bsuid": "BSUID",
      "username": "USERNAME"
    }
  },
  "conversations": [
    {
      "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",
      "senderId": "SENDER_ID",
      "senderRef": "SENDER_REF",
      "serviceWindowExpiresAt": "2026-11-05T10:00:00.000Z",
      "serviceWindowOpen": true,
      "status": "open"
    }
  ],
  "exportedAt": "2026-11-05T10:00:00.000Z",
  "followUps": [
    {
      "completedAt": "2026-11-05T10:00:00.000Z",
      "dueAt": "2026-11-05T10:00:00.000Z",
      "id": "ID",
      "notes": "NOTES",
      "status": "open",
      "title": "TITLE"
    }
  ],
  "messages": [
    {
      "button": {
        "payload": "PAYLOAD",
        "text": "TEXT"
      },
      "channel": "whatsapp",
      "contactId": "CONTACT_ID",
      "contacts": [
        {
          "emails": [
            {
              "email": "EMAIL",
              "type": "TYPE"
            }
          ],
          "name": "NAME",
          "organization": "ORGANIZATION",
          "phones": [
            {
              "phone": "PHONE",
              "type": "TYPE"
            }
          ]
        }
      ],
      "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": "CONTENT_TYPE",
            "filename": "FILENAME",
            "size": 1
          }
        ],
        "bcc": [
          "BCC"
        ],
        "cc": [
          "CC"
        ],
        "from": "FROM",
        "subject": "SUBJECT",
        "to": "TO"
      },
      "failedAt": "2026-11-05T10:00:00.000Z",
      "failure": {
        "code": "CODE",
        "reason": "REASON"
      },
      "id": "ID",
      "livemode": true,
      "location": {
        "address": "ADDRESS",
        "latitude": 1,
        "longitude": 1,
        "name": "NAME",
        "url": "URL"
      },
      "media": {
        "failureCode": "FAILURE_CODE",
        "fileName": "FILE_NAME",
        "kind": "image",
        "mimeType": "MIME_TYPE",
        "sizeBytes": 1,
        "status": "pending"
      },
      "metadata": {},
      "object": "message",
      "order": {
        "catalogId": "CATALOG_ID",
        "items": [
          {
            "currency": "CURRENCY",
            "itemPrice": 1,
            "productRetailerId": "PRODUCT_RETAILER_ID",
            "quantity": 1
          }
        ],
        "text": "TEXT"
      },
      "pricing": {
        "billable": true,
        "category": "CATEGORY",
        "model": "MODEL",
        "type": "TYPE"
      },
      "providerMessageId": "PROVIDER_MESSAGE_ID",
      "reaction": {
        "emoji": "EMOJI"
      },
      "readAt": "2026-11-05T10:00:00.000Z",
      "sentAt": "2026-11-05T10:00:00.000Z",
      "sms": {
        "country": "COUNTRY",
        "encoding": "gsm7",
        "expiresAt": "2026-11-05T10:00:00.000Z",
        "header": "HEADER",
        "keyword": "stop",
        "price": {
          "amount": "0.002780",
          "currency": "USD"
        },
        "segments": 1,
        "sendAfter": "2026-11-05T10:00:00.000Z"
      },
      "status": "queued",
      "template": {
        "id": "ID",
        "language": "LANGUAGE",
        "name": "NAME"
      },
      "text": "TEXT",
      "type": "template",
      "updatedAt": "2026-11-05T10:00:00.000Z"
    }
  ],
  "object": "contact_export",
  "personalData": {
    "alternatePhone": "ALTERNATE_PHONE",
    "archivedAt": "2026-11-05T10:00:00.000Z",
    "city": "CITY",
    "company": "COMPANY",
    "contactConsent": {
      "evidence": "EVIDENCE",
      "source": "SOURCE",
      "status": "opted_in",
      "updatedAt": "2026-11-05T10:00:00.000Z"
    },
    "customFields": {},
    "email": "EMAIL",
    "jobTitle": "JOB_TITLE",
    "leadSource": "LEAD_SOURCE",
    "lifecycleStage": "new",
    "notes": "NOTES",
    "phone": "+919876543210",
    "preferredLanguage": "PREFERRED_LANGUAGE",
    "state": "STATE",
    "tags": [
      "TAGS"
    ],
    "undecryptableFields": [
      "UNDECRYPTABLE_FIELDS"
    ]
  },
  "verifications": [
    {
      "approvedAt": "2026-11-05T10:00:00.000Z",
      "channel": "sms",
      "createdAt": "2026-11-05T10:00:00.000Z",
      "endedAt": "2026-11-05T10:00:00.000Z",
      "expiresAt": "2026-11-05T10:00:00.000Z",
      "id": "ID",
      "livemode": true,
      "metadata": {},
      "sendCount": 1,
      "status": "approved",
      "to": "TO"
    }
  ]
}

Search organization data subjects

post/v1/organizations/{organizationId}/data-subjects/search

Finds the contacts that hold a data subject’s phone number.

Ids of every contact of the organization with this number, a contact deleted in the console included (erasure must reach it). A POST so the number stays out of URLs and logs.

Access: an integration key with the organizations:data-subjects scope.

Path parameters

  • organizationIdstring (uuid)Required

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. This endpoint converges when run again, so a 5xx stores nothing either: a retry with the same key runs it again. 1–255 visible ASCII characters; kept for 24 hours.

Request body

  • phonestringRequired

    The data subject’s phone number in international format. Matched through the same normalization and blind index as GET /v1/contacts?phone=.

Response 200DataSubjectSearchResult

  • dataDataSubjectContact[]Required

    The organization’s contact with this number (a number is unique within an organization, so zero or one) — a contact deleted in the console (and so kept for its history) included, because erasure must reach it too. Ids only.

    2 fields of data
    • idstring (uuid)Required

    • objectstringRequired

      One ofdata_subject_contact

  • objectstringRequired

    One oflist

  • verificationsintegerRequired

    How many of the organization’s one-time-code verifications (/v1/verify) were sent to the number — a code can reach a number no contact holds. They are listed in the contact’s export, erased with that contact, and purged 30 days after their code expired.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/organizations/ORGANIZATION_ID/data-subjects/search' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "phone": "+919876543210"
}'
Response 200 (json)
{
  "data": [
    {
      "id": "ID",
      "object": "data_subject_contact"
    }
  ],
  "object": "list",
  "verifications": 1
}

Reactivate organization

post/v1/organizations/{organizationId}/reactivate

Lifts this integration’s suspension; idempotent.

Lifts a suspension this integration placed: the organization’s keys work again, but sessions are not restored — everyone signs in again. An organization already active is answered unchanged. Refused with 409 ORGANIZATION_SUSPENDED_BY_PLATFORM when the platform or a partner holds the suspension, and 409 ORGANIZATION_CLOSED for a closed organization.

Access: an integration key with the organizations:write scope.

Path parameters

  • organizationIdstringRequired

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

  • reasonstring

    Kept on the audit log.

    at most 500 characters

Response 200PublicOrganization

Its fields are listed under Get organization.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/organizations/ORGANIZATION_ID/reactivate' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{}'
Response 200 (json)
{
  "billing": {
    "payer": "organization",
    "spend": {
      "amountMinor": 182350,
      "periodEnd": "2026-11-05T10:00:00.000Z",
      "periodStart": "2026-11-05T10:00:00.000Z"
    },
    "spendCap": {
      "amountMinor": 500000,
      "period": "month"
    }
  },
  "country": "IN",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "entitlements": {
    "calling": true,
    "messaging": true
  },
  "erasure": {
    "requestedAt": "2026-11-05T10:00:00.000Z",
    "status": "erasing"
  },
  "externalReference": "acme.myshopify.com",
  "id": "ID",
  "livemode": true,
  "name": "NAME",
  "object": "organization",
  "planId": "PLAN_ID",
  "slug": "SLUG",
  "status": "active",
  "suspendedAt": "2026-11-05T10:00:00.000Z",
  "suspendedBy": "integration",
  "whatsapp": {
    "status": "not_connected"
  }
}

Suspend organization

post/v1/organizations/{organizationId}/suspend

Suspends an organization (its keys and sign-ins stop working); idempotent.

The organization’s API keys stop authenticating and its members are signed out at once, and suspendedBy reads integration — a suspension only this integration (or the platform) lifts. An organization already suspended, by anyone, is answered unchanged. Refused with 409 ORGANIZATION_CLOSED for a closed organization.

Access: an integration key with the organizations:write scope.

Path parameters

  • organizationIdstringRequired

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

  • reasonstringRequired

    Why; kept on the audit log.

    3–500 characters

Response 200PublicOrganization

Its fields are listed under Get organization.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/organizations/ORGANIZATION_ID/suspend' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "reason": "App uninstalled"
}'
Response 200 (json)
{
  "billing": {
    "payer": "organization",
    "spend": {
      "amountMinor": 182350,
      "periodEnd": "2026-11-05T10:00:00.000Z",
      "periodStart": "2026-11-05T10:00:00.000Z"
    },
    "spendCap": {
      "amountMinor": 500000,
      "period": "month"
    }
  },
  "country": "IN",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "entitlements": {
    "calling": true,
    "messaging": true
  },
  "erasure": {
    "requestedAt": "2026-11-05T10:00:00.000Z",
    "status": "erasing"
  },
  "externalReference": "acme.myshopify.com",
  "id": "ID",
  "livemode": true,
  "name": "NAME",
  "object": "organization",
  "planId": "PLAN_ID",
  "slug": "SLUG",
  "status": "active",
  "suspendedAt": "2026-11-05T10:00:00.000Z",
  "suspendedBy": "integration",
  "whatsapp": {
    "status": "not_connected"
  }
}

Get organization usage

get/v1/organizations/{organizationId}/usage

Lists one organization’s spend per UTC day, channel and destination (at most 90 days).

The rows its own GET /v1/usage answers — calls, messages, number and plan fees, whoever’s wallet paid them (yours, when it bills to your integration) — over [from, to), by default the last 30 UTC days, naming the organization (organizationId). Counts and money only; a test organization’s traffic is never rated, so it has none. Reconcile it against your own metering, and against your billing organization’s statements (paidFor) and GET /v1/usage?breakdown=organization.

Access: an integration key with the organizations:read scope.

Path parameters

  • organizationIdstringRequired

Query parameters

  • fromstring (date-time)

    Inclusive start (an ISO 8601 date — midnight UTC — or date-time). Default: the start of the UTC day 29 days before to.

  • tostring (date-time)

    Exclusive end. Default: now. At most 90 days after from.

  • channelstring

    Only this channel’s rows.

    One ofvoicesmswhatsappemailnumbersplan

Response 200PublicUsage

  • breakdownstring

    P4: organization when the rows are broken down by organization.

    One oforganization

  • dataPublicUsageRow[]Required

    One row per UTC day × channel × destination × currency with any usage, oldest day first. Days with none are absent.

    10 fields of data
    • amountMinorintegerRequired

      Spent, in minor units of currency. A credit back (a plan change) is negative.

    • billedUnitsintegerRequired

      Minutes billed (whole minutes, one minimum once answered), SMS segments, messages, or fees.

    • channelstringRequired

      numbers: number setup fees and monthly rentals; plan: the plan’s monthly fee (net of the credit back a plan change gives).

      One ofvoicesmswhatsappemailnumbersplan

    • countintegerRequired

      Voice: calls rated (answered or not). Messages: messages charged. Numbers and plan: ledger entries.

    • currencystringRequired

    • datestringRequired

      The UTC day.

    • destinationstring | nullRequired

      Voice: the rate cell’s destination that priced the calls — an ISO country or a + prefix of up to six digits; SMS: the destination country. Null when the every-destination cell priced it, on WhatsApp, email, numbers and the plan, and for a message erased since.

    • includedUnitsintegerRequired

      Voice minutes the plan’s included bundle covered (not charged); 0 on every other channel.

    • organizationIdstring (uuid)

      P4: whose spend the row is — only when the read is broken down by organization (breakdown=organization).

    • unitstringRequired

      One ofminutesegmentmessagefee

  • fromstring (date-time)Required

    Inclusive.

  • objectstringRequired

    One ofusage

  • organizationIdstring (uuid)

    P4: the organization whose spend this is, on an integration’s read of one of its organizations.

  • subaccountIdstring (uuid) | nullRequired

    The subaccount whose spend this is (subaccountId was asked); null for your own.

  • tostring (date-time)Required

    Exclusive.

Errors

Request
curl 'https://api.trovacast.com/v1/organizations/ORGANIZATION_ID/usage' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "breakdown": "organization",
  "data": [
    {
      "amountMinor": 1,
      "billedUnits": 1,
      "channel": "voice",
      "count": 1,
      "currency": "INR",
      "date": "2026-11-04",
      "destination": "GB",
      "includedUnits": 1,
      "organizationId": "ORGANIZATION_ID",
      "unit": "minute"
    }
  ],
  "from": "2026-11-05T10:00:00.000Z",
  "object": "usage",
  "organizationId": "ORGANIZATION_ID",
  "subaccountId": "SUBACCOUNT_ID",
  "to": "2026-11-05T10:00:00.000Z"
}