Jump to

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

API reference

Introspection

How these fit together: the Authentication guide.

Get me

get/v1/me

Describes the API key making the request.

What the key is: its id, name, prefix and last four characters (never the secret), mode, expiry and scopes; for an organization key, the organization, the product lines it has (entitlements) and the integration that minted it, if any; for an integration key, the integration and the scopes delegated to it — and, sent with Trovacast-Organization, the organization it acts for (actingFor: the organization, its product lines and mode, and the scopes it holds there). The cheapest way to check a key before relying on it.

Access: any key, organization or integration.

Response 200MeResponse

Show the 9 fields
  • actingForMeActingFor

    INTEGRATION keys sent with Trovacast-Organization: the organization the key acts for, and what it holds there.

    4 fields of actingFor
    • entitlementsMeEntitlementsRequired

      2 fields of entitlements
      • callingbooleanRequired

        Whether the organization has calling.

      • messagingbooleanRequired

        Whether the organization has messaging.

    • livemodebooleanRequired

      False for a test organization (one a TEST integration key provisioned).

    • organizationMeOrganizationRequired

      2 fields of organization
      • idstring (uuid)Required

      • namestringRequired

    • scopesstring[]Required

      The scopes the key holds acting for it.

      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

  • entitlementsMeEntitlements

    ORG keys: the product lines the organization has.

    2 fields of entitlements
    • callingbooleanRequired

      Whether the organization has calling.

    • messagingbooleanRequired

      Whether the organization has messaging.

  • integrationMeIntegration

    INTEGRATION keys: the integration the key belongs to.

    4 fields of integration
    • delegatedScopesstring[]Required

      The ORG scopes the platform delegated to the integration: what a key holding organizations:act may do acting for one of its organizations (Trovacast-Organization). Empty unless the platform delegated any.

      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

    • idstring (uuid)Required

    • namestringRequired

    • slugstringRequired

  • keyApiKeyIdentityRequired

    6 fields of key
    • expiresAtstring (date-time) | nullRequired

    • idstring (uuid)Required

    • last4stringRequired

    • modestringRequired

      TEST keys (tc_test_…) reach only the sandboxes and are never billed.

      One ofLIVETEST

    • namestringRequired

    • prefixstringRequired

      The non-secret start of the key, as listed in the console.

  • kindstringRequired

    ORG: acts inside one organization. INTEGRATION: administers the organizations its integration provisioned.

    One ofORGINTEGRATION

  • livemodebooleanRequired

    False for a TEST key: the messages, calls and broadcasts it creates are livemode: false.

  • mintedByIntegrationMeMintedBy | null

    ORG keys: the integration that minted this key, if any.

    2 fields of mintedByIntegration
    • idstring (uuid)Required

    • slugstringRequired

  • organizationMeOrganization

    ORG keys: the organization the key acts in.

    2 fields of organization
    • idstring (uuid)Required

    • namestringRequired

  • 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:readorganizations:readorganizations:writeorganizations:eraseorganizations:data-subjectsapi-keys:writeorganizations:actorganizations:events

Errors

Request
curl 'https://api.trovacast.com/v1/me' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "actingFor": {
    "entitlements": {
      "calling": true,
      "messaging": true
    },
    "livemode": true,
    "organization": {
      "id": "ID",
      "name": "NAME"
    },
    "scopes": [
      "contacts:read"
    ]
  },
  "entitlements": {
    "calling": true,
    "messaging": true
  },
  "integration": {
    "delegatedScopes": [
      "contacts:read"
    ],
    "id": "ID",
    "name": "NAME",
    "slug": "shopify"
  },
  "key": {
    "expiresAt": "2026-11-05T10:00:00.000Z",
    "id": "ID",
    "last4": "x9Yz",
    "mode": "LIVE",
    "name": "NAME",
    "prefix": "tc_live_AbCd"
  },
  "kind": "ORG",
  "livemode": true,
  "mintedByIntegration": {
    "id": "ID",
    "slug": "shopify"
  },
  "organization": {
    "id": "ID",
    "name": "NAME"
  },
  "scopes": [
    "contacts:read"
  ]
}

List API key requests

get/v1/me/requests

Lists the requests this API key made in the last 7 days.

Newest first: method, route template, status, request id and latency of every request the key made once it authenticated (a request refused before the key was known — a bad key, the per-key rate limit — belongs to no key); an integration key sent with Trovacast-Organization, the requests it made acting for that organization. Never a body, a query string or the ids in a path. Rows appear a few seconds after the response and are kept 7 days.

Access: any key, organization or integration.

Query parameters

  • limitinteger

    How many items to return.

  • cursorstring

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

  • statusstring

    Only requests answered with a status in this class.

    One of2xx3xx4xx5xx

Response 200ApiRequestPage

  • dataApiRequest[]Required

    8 fields of data
    • createdAtstring (date-time)Required

    • durationMsintegerRequired

      Milliseconds from authentication to the response.

    • idstring (uuid)Required

    • methodstringRequired

    • objectstringRequired

      One ofapi_request

    • requestIdstring | nullRequired

      The X-Request-Id it was answered with (and requestId of an error body): quote it to support.

    • routestringRequired

      The route template the request matched — not its path.

    • statusintegerRequired

      The HTTP status it was answered.

  • nextCursorstring | nullRequired

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

Errors

Request
curl 'https://api.trovacast.com/v1/me/requests' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "data": [
    {
      "createdAt": "2026-11-05T10:00:00.000Z",
      "durationMs": 1,
      "id": "ID",
      "method": "POST",
      "object": "api_request",
      "requestId": "REQUEST_ID",
      "route": "/v1/contacts/:contactId",
      "status": 201
    }
  ],
  "nextCursor": "NEXT_CURSOR"
}

Rotate API key

post/v1/me/rotate

Rotates the API key making the request: a new secret now, this one valid for the overlap.

Needs the api-keys:rotate scope on the key itself (an integration key: api-keys:write, sent without Trovacast-Organization — 400 otherwise). The new key has the same name, scopes, mode and expiry; its secret is returned once. The calling key keeps working until previousKey.expiresAt (overlapHours, default 24, at most 168; 0 stops it now). A key already rotated answers 409 — rotate its replacement.

Access: any key, organization or integration.

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

  • overlapHoursinteger

    How long the old secret keeps working, in hours (0: it stops now). At most 168 (a week).

    0–168default 24

Response 201RotatedApiKey

Show the 17 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

  • previousKeyRotatedPreviousKeyRequired

    The key it replaces, which keeps working until expiresAt.

    4 fields of previousKey
    • expiresAtstring (date-time)Required

      When the old secret stops working.

    • idstring (uuid)Required

    • last4stringRequired

    • 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/me/rotate' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{}'
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",
  "previousKey": {
    "expiresAt": "2026-11-05T10:00:00.000Z",
    "id": "ID",
    "last4": "x9Qz",
    "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"
}