Phone lookup and contact conflicts in integrations

System Admin

Last updated on Nov 15, 2026

Overview

VL2A Chat integrations should search for and reuse the existing record before creating another person. Numeric lookup supplements text search: it checks recognized international phone variants, WhatsApp canonical phone and personal inbox addresses, even when the profile phone differs.

It does not merge contacts, rewrite the display phone or transfer another patient's or customer's link.

Prerequisites

  • A credential allowed to access the account, contacts and intended inbox.
  • An international phone with country and area codes; do not infer Brazil from a local number.
  • For MCP, an active profile, admitted tool and the operation's required authority/approval.

Step by step

  1. Call GET /api/v1/accounts/{account_id}/contacts/search?q={phone} and follow the response pagination.
  2. For a WhatsApp people projection that excludes technical identities, also use directory=whatsapp_contact when suitable. Default search and this projection are not identical lists.
  3. Check the returned record and links. Recognized Brazilian mobile spellings with and without the ninth digit are compared within the same account; landlines and foreign numbers do not acquire it.
  4. Reuse the authorized contact. If it needs an inbox link, create that link for the contact; do not create another person merely for a spelling difference.
  5. On 422 with error: contact_exists, preserve the current owner. contact_id and inbox_id appear only when both are readable; their absence is not permission to guess the owner.
  6. After a lost response or ambiguous result, read the current state before another operation. Do not loop contact creation.

Settings & options

  • Default lookup retains name, email, identifier and phone text matching, with 15 results per page.
  • Additional phone comparison requires a phone-shaped query. It does not grant cross-account or inbox access.
  • Repeated creation of the same contact's same link can reuse the native link. A different owner is a conflict, not permission to rename the old address.
  • Local contact creation refused by validation or inbox conflict must not leave a new unlinked contact. In MCP, an error response also rolls back the admitted replay's local writes.

Use cases

  • Find a patient whose legacy profile and WhatsApp address use different mobile spellings.
  • Prevent integration retries from accumulating unlinked contacts.
  • Expose an actionable conflict without revealing ids the credential cannot read.

Tips, limits & best practices

  • Local rollback does not undo a payment, send or other action already accepted by an external provider. Financial tools and operations have their own exclusions, approvals and unknown-outcome protocols.
  • Do not ignore identity conflicts, remove the ninth digit to force a send or delete history to free an address.
  • This fix does not retroactively clean, bulk-merge or automatically repair old contacts. Cleanup requires reviewing links and the corresponding authority.

Troubleshooting

  • No search result: check country/area code, authority, pagination and the distinction between default search and the people directory.
  • Conflict without ids: the credential was not authorized to read the owner or inbox; ask an administrator to review it.
  • Repeated create error: stop retrying and inspect the existing record. Confirm the installed version before assuming the corrected contract.
  • Unknown external result: reconcile through the operation's native receipt; local rollback is not evidence of remote non-execution.

See also