Jump to

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

API reference

Contacts

How these fit together: the Contacts guide.

List contacts

get/v1/contacts

Lists contacts newest first (filter by exact phone or reference), or — with updatedAfter — every contact or consent change since, oldest first.

Archived contacts are not listed, and a number comes back as its last four digits only. phone (international format) and externalReference match exactly. With updatedAfter, neither filter may be sent, each item adds changedAt and its consent on every channel (null for a project without messaging), and changes from the last 3 minutes are held back: page until nextCursor is null, then resume from the last changedAt and deduplicate on id + changedAt. A test key reads live contacts with their names masked.

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

Query parameters

  • limitinteger

    How many items to return.

  • cursorstring

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

  • phonestring

    An exact phone number in international format (URL-encode the + as %2B). Matched through the same normalization and blind index the console uses; at most one contact.

  • externalReferencestring

    Your own id for the contact (exact match).

  • updatedAfterstring (date-time)

    Reconciliation: every live contact whose own record OR whose consent on any channel changed at or after this instant, OLDEST change first (by changedAt, then id), each with changedAt and its consent on every channel — so a STOP or an unsubscribe your webhook missed is found here. Changes from the last 3 minutes are held back until no earlier-stamped change can still commit. Page with nextCursor until it is null (a page may hold fewer than limit items, even none, while it is not); then resume later from the last changedAt you saw and dedupe by id + changedAt. Not combinable with phone or externalReference.

Response 200PublicContactPage

  • dataPublicContact[]Required

    Its fields are listed under Get contact

  • nextCursorstring | nullRequired

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

Errors

Request
curl 'https://api.trovacast.com/v1/contacts?phone=%2B919876543210' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "data": [
    {
      "changedAt": "2026-11-05T10:00:00.000Z",
      "consent": {
        "email": {
          "contactId": "CONTACT_ID",
          "marketing": "unknown",
          "marketingSource": "MARKETING_SOURCE",
          "object": "whatsapp_consent",
          "updatedAt": "2026-11-05T10:00:00.000Z",
          "updates": "unknown",
          "updatesSource": "UPDATES_SOURCE"
        },
        "sms": {
          "contactId": "CONTACT_ID",
          "marketing": "unknown",
          "marketingSource": "MARKETING_SOURCE",
          "object": "whatsapp_consent",
          "updatedAt": "2026-11-05T10:00:00.000Z",
          "updates": "unknown",
          "updatesSource": "UPDATES_SOURCE"
        },
        "whatsapp": {
          "contactId": "CONTACT_ID",
          "marketing": "unknown",
          "marketingSource": "MARKETING_SOURCE",
          "object": "whatsapp_consent",
          "updatedAt": "2026-11-05T10:00:00.000Z",
          "updates": "unknown",
          "updatesSource": "UPDATES_SOURCE"
        }
      },
      "createdAt": "2026-11-05T10:00:00.000Z",
      "displayName": "Aarav Shah",
      "doNotContact": true,
      "externalReference": "EXTERNAL_REFERENCE",
      "id": "ID",
      "livemode": true,
      "object": "contact",
      "phone": {
        "countryCode": "IN",
        "last4": "3210"
      },
      "status": "active",
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "whatsapp": {
        "bsuid": "BSUID",
        "username": "USERNAME"
      }
    }
  ],
  "nextCursor": "NEXT_CURSOR"
}

Upsert contact

post/v1/contacts

Creates or updates a contact by phone number.

Matched by the number, and by externalReference when sent; the two may not point at different contacts, and a reference already set is never changed here (409 CONFLICT either way — PATCH /v1/contacts/{contactId} changes it). Answers 200 when the contact existed — only the fields sent are written, attributes merged (at most 30) — and 201 when it was created, or when an archived contact holding the number was revived with its old opt-ins reset. A test key creates test contacts but cannot change an existing contact or revive an archived one (422 TEST_MODE_UNSUPPORTED). Audited against the key.

Access: an organization key with the contacts: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

  • attributesobject

    Custom attributes, merged into what the contact already carries (at most 30). Never returned by the API.

  • displayNamestring

    at most 120 characters

  • emailstring

    Stored encrypted; never returned by the API.

  • externalReferencestring

    Your own id for this contact. It may not point at a contact with a different number (409).

    at most 160 characters

  • phonestringRequired

    International format. The contact’s identity: an existing contact with this number is updated, otherwise one is created.

Response 200PublicContact

A contact with this number existed and was updated.

Its fields are listed under Get contact.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/contacts' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "phone": "+919876543210",
  "displayName": "Aarav Shah",
  "externalReference": "customer-1001"
}'
Response 200 (json)
{
  "changedAt": "2026-11-05T10:00:00.000Z",
  "consent": {
    "email": {
      "contactId": "CONTACT_ID",
      "marketing": "unknown",
      "marketingSource": "MARKETING_SOURCE",
      "object": "whatsapp_consent",
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "updates": "unknown",
      "updatesSource": "UPDATES_SOURCE"
    },
    "sms": {
      "contactId": "CONTACT_ID",
      "marketing": "unknown",
      "marketingSource": "MARKETING_SOURCE",
      "object": "whatsapp_consent",
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "updates": "unknown",
      "updatesSource": "UPDATES_SOURCE"
    },
    "whatsapp": {
      "contactId": "CONTACT_ID",
      "marketing": "unknown",
      "marketingSource": "MARKETING_SOURCE",
      "object": "whatsapp_consent",
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "updates": "unknown",
      "updatesSource": "UPDATES_SOURCE"
    }
  },
  "createdAt": "2026-11-05T10:00:00.000Z",
  "displayName": "Aarav Shah",
  "doNotContact": true,
  "externalReference": "EXTERNAL_REFERENCE",
  "id": "ID",
  "livemode": true,
  "object": "contact",
  "phone": {
    "countryCode": "IN",
    "last4": "3210"
  },
  "status": "active",
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "whatsapp": {
    "bsuid": "BSUID",
    "username": "USERNAME"
  }
}

Get contact

get/v1/contacts/{contactId}

Retrieves a contact.

The number comes back as its last four digits and country code; the email address and custom attributes not at all (GET /v1/contacts/{contactId}/export answers everything held, for a data subject). An archived contact is not found. A test key reads a live contact’s name masked.

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

Path parameters

  • contactIdstringRequired

Response 200PublicContact

Show the 13 fields
  • changedAtstring (date-time)

    Only in the ?updatedAfter= reconciliation read: the latest of the contact’s own updatedAt and its consents’ updatedAt — its place in that read, and what to resume from.

  • consentPublicContactConsents | null

    Only in the ?updatedAfter= reconciliation read: the contact’s consent on each channel, as GET /v1/contacts/{contactId}/consent/{channel} answers it; null when the organization does not have messaging.

    3 fields of consent
  • createdAtstring (date-time)Required

  • displayNamestringRequired

    The contact’s name. A test key reads it masked (each word’s first letter, A••• S•••), and gets no WhatsApp username: contacts are shared by both modes, and a test key never reads a live person’s details.

  • doNotContactbooleanRequired

    The contact opted out of all contact (or asked not to be contacted). Outranks every channel consent.

  • externalReferencestring | nullRequired

    Your own id for this contact, unique in the organization.

  • idstring (uuid)Required

  • livemodebooleanRequired

    false for a test contact — one a test key (tc_test_…) created. A test key records consent on test contacts only; that consent never authorizes a live send, and the first live upsert or consent capture makes the contact live, clearing the opt-ins recorded in test mode.

  • objectstringRequired

    One ofcontact

  • phonePublicContactPhone | nullRequired

    Never the full number: find a contact by number with GET /v1/contacts?phone=.

    2 fields of phone
    • countryCodestring | nullRequired

      The ISO 3166-1 country the number belongs to.

    • last4stringRequired

      The last four digits only.

  • statusstringRequired

    One ofactiveblockedarchived

  • updatedAtstring (date-time)Required

  • whatsappPublicContactWhatsAppRequired

    2 fields of whatsapp
    • bsuidstring | nullRequired

      The contact’s WhatsApp business-scoped user id, once known.

    • usernamestring | nullRequired

Errors

Request
curl 'https://api.trovacast.com/v1/contacts/CONTACT_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "changedAt": "2026-11-05T10:00:00.000Z",
  "consent": {
    "email": {
      "contactId": "CONTACT_ID",
      "marketing": "unknown",
      "marketingSource": "MARKETING_SOURCE",
      "object": "whatsapp_consent",
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "updates": "unknown",
      "updatesSource": "UPDATES_SOURCE"
    },
    "sms": {
      "contactId": "CONTACT_ID",
      "marketing": "unknown",
      "marketingSource": "MARKETING_SOURCE",
      "object": "whatsapp_consent",
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "updates": "unknown",
      "updatesSource": "UPDATES_SOURCE"
    },
    "whatsapp": {
      "contactId": "CONTACT_ID",
      "marketing": "unknown",
      "marketingSource": "MARKETING_SOURCE",
      "object": "whatsapp_consent",
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "updates": "unknown",
      "updatesSource": "UPDATES_SOURCE"
    }
  },
  "createdAt": "2026-11-05T10:00:00.000Z",
  "displayName": "Aarav Shah",
  "doNotContact": true,
  "externalReference": "EXTERNAL_REFERENCE",
  "id": "ID",
  "livemode": true,
  "object": "contact",
  "phone": {
    "countryCode": "IN",
    "last4": "3210"
  },
  "status": "active",
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "whatsapp": {
    "bsuid": "BSUID",
    "username": "USERNAME"
  }
}

Update contact

patch/v1/contacts/{contactId}

Renames a contact or changes its externalReference.

Only displayName and externalReference (null clears it): the number and consent never change here — a new number is a new contact. Sending neither is refused; a value already held changes nothing. Refused with 409 CONFLICT when another contact holds the externalReference, or when a concurrent edit wins twice. Audited against the key.

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

Path parameters

  • contactIdstringRequired

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

  • displayNamestring

    at most 120 characters

  • externalReferencestring | null

    Your own id for this contact; null clears it. Another contact holding it is a 409.

    at most 160 characters

Response 200PublicContact

Its fields are listed under Get contact.

Errors

Request
curl -X PATCH 'https://api.trovacast.com/v1/contacts/CONTACT_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "displayName": "Aarav Shah"
}'
Response 200 (json)
{
  "changedAt": "2026-11-05T10:00:00.000Z",
  "consent": {
    "email": {
      "contactId": "CONTACT_ID",
      "marketing": "unknown",
      "marketingSource": "MARKETING_SOURCE",
      "object": "whatsapp_consent",
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "updates": "unknown",
      "updatesSource": "UPDATES_SOURCE"
    },
    "sms": {
      "contactId": "CONTACT_ID",
      "marketing": "unknown",
      "marketingSource": "MARKETING_SOURCE",
      "object": "whatsapp_consent",
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "updates": "unknown",
      "updatesSource": "UPDATES_SOURCE"
    },
    "whatsapp": {
      "contactId": "CONTACT_ID",
      "marketing": "unknown",
      "marketingSource": "MARKETING_SOURCE",
      "object": "whatsapp_consent",
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "updates": "unknown",
      "updatesSource": "UPDATES_SOURCE"
    }
  },
  "createdAt": "2026-11-05T10:00:00.000Z",
  "displayName": "Aarav Shah",
  "doNotContact": true,
  "externalReference": "EXTERNAL_REFERENCE",
  "id": "ID",
  "livemode": true,
  "object": "contact",
  "phone": {
    "countryCode": "IN",
    "last4": "3210"
  },
  "status": "active",
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "whatsapp": {
    "bsuid": "BSUID",
    "username": "USERNAME"
  }
}

Erase contact

delete/v1/contacts/{contactId}

Erases a contact and everything held about them.

Hard-deletes the contact, its conversations, messages, media, consents and follow-ups, purges the stored webhook payloads and cached API responses that mention it, and detaches (and strips) its call history. Idempotent: erasing an already-erased contact answers 204 again. 409 CONTACT_CALL_IN_PROGRESS while the contact is on a live call; 409 CONTACT_EVENT_IN_PROGRESS while a message or status about the contact is being applied (the contact was not erased; retry shortly); 503 ERASURE_STORAGE_UNAVAILABLE when stored media could not be deleted (retry).

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

Path parameters

  • 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/contacts/CONTACT_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Answers 204 with no body.

Export contact

get/v1/contacts/{contactId}/export

Exports everything held about a contact.

For a data subject access request. Unlike every other read, the phone number and email address are returned in full — they are the subject’s own data — so it needs its own scope, contacts:export (contacts:read alone is refused with 403 API_KEY_SCOPE_MISSING). Each export is audited. A TEST key exports test contacts only — the ones its own test traffic created (a simulated inbound call’s or message’s caller, a test send by number), whose number it gave — and a live contact is 422 TEST_MODE_UNSUPPORTED to it.

Access: an organization key with the contacts:export scope.

Path parameters

  • 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/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"
    }
  ]
}