Contacts

Look people up and keep their records current

Every tool takes an optional orgId - tech providers only, naming the managed client to act on. An id outside the target org behaves exactly like a missing one.

Contacts - 5

ToolScopeDoes
list_contactsCONTACTS_READFilter by externalId, phone, channel, custom fields, created range. Expensive with search, channel or fields.
get_contactCONTACTS_READBy Wexio id or your externalId.
list_field_definitionsCONTACTS_READThe org's field schema - the writable keys.
upsert_contactCONTACTS_MANAGEIdempotent on your externalId; can bind a channel identity.
set_contact_fieldsCONTACTS_MANAGESets field values by key.

Contact Tools

Four tools let an agent look a person up and keep their record current - without you storing Wexio's IDs.

upsert_contact

Creates or updates a contact, idempotently keyed on your own externalId. Two calls with the same externalId touch one contact.

ArgumentTypeRequiredDescription
externalIdstringNoYour id for this person. The idempotency key.
displayNamestringNoName shown in the inbox.
firstName / lastNamestringNoGiven and family name.
phonestringNoPhone number, E.164.
languagestringNoPreferred language code.
fields{ key, value }[]NoCustom field values by key.
channelobjectNoBind a messaging identity - see below.

channel binds an identity before the person ever writes, so a later real inbound resolves to the same contact instead of creating a duplicate:

FieldTypeDescription
kind"WHATSAPP" | "TELEGRAM" | "VIBER"Which channel.
phonestringFor WhatsApp.
telegramIdstringFor Telegram.
viberUserIdstringFor Viber.
integrationIdstringDefaults to the org's integration for that channel - usually omit it.

Skip the channel binding and an imported contact plus the person who later messages you are two contacts until someone merges them. Bind at import time.

get_contact

Reads a contact by Wexio's id or your own externalId - pass whichever you have.

ArgumentTypeRequiredDescription
idstringOne of the twoWexio's contact id.
externalIdstringOne of the twoYour own id.

Output - the contact DTO, mirroring the GraphQL ContactApi allow-list:

{
  id: string | null;
  externalId: string | null;   // your own id, echoed back
  channels: string[];
  erased: boolean;
  displayName?: string | null; // PII_READ
  avatarUrl?: string | null;   // PII_READ
  phone?: string | null;       // PII_READ
  email?: string | null;       // PII_READ
}

Identity fields are withheld without PII_READ, but externalId, channels and erased are not PII-gated. So even a masked agent can confirm which of your users a contact is, and which channels it can be reached on - it just cannot read their name or number.

The same DTO comes back from upsert_contact and set_contact_fields.

set_contact_fields

Sets field values on a contact, targeted by id or externalId.

ArgumentTypeRequiredDescription
id / externalIdstringOne of the twoWhich contact.
fields{ key, value }[]YesThe values to set.

Writable keys are your custom fields and non-read-only system fields. Channel and identity keys are rejected - an agent cannot rewrite who a person is on a channel. Call list_field_definitions to discover what it may actually write.

list_field_definitions

Returns the org's field schema, so an agent can discover the writable keys instead of guessing them. No arguments beyond the optional orgId.

Have the agent call this once before its first set_contact_fields, and key off the result. A guessed field key is a failed write, and the agent has no other way to learn your schema.

On this page