VocalDocscontracts 1.65.0

Find Contacts by an identity or an external id

POST /v1/contacts/lookup

PropertyValue
Operationlookup_contacts
GroupContacts
Scopecontacts:read
Route classread
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAn audited content read contacts.contact.lookup
Released in1.61.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Finds the active Contacts that hold a phone number, an email address or an external id, sent in the body, by exact keyed-hash equality (1.61.0): ids and statuses only. It reads the identity index, so it is an audited content read whose Audit event names the kind, never the value.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the contacts:read scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X POST "$VOCAL_API/v1/contacts/lookup" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "match": {
      "kind": "phone",
      "value": "+15555550100"
    }
  }'

Parameters

NameInTypeRequiredDescription
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Request body

Content type application/json, required: ContactLookupRequest.

FieldTypeRequiredDescription
matchContactMatchInputyes

Responses

StatusContent typeShapeError codes
200application/jsonContactLookup
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is ContactLookup.

FieldTypeRequiredDescription
contactsarray of ContactMatchyesThe active Contacts that hold it, at most 10 (a target); ids and statuses only.
object"contact_lookup"yes
resolutionone of "none", "matched", "ambiguous"yes