Contacts API
The Contacts API lets you manage the contact book of the active WhatsApp number: list, search, retrieve, create, update the nickname, block/unblock, and export contacts. With the introduction of the BSUID (Business-Scoped User ID) by Meta, each contact can now carry — in addition to the phone number (wa_id) — the fields user_id (BSUID), parent_user_id (parent BSUID), and username. This allows a contact to exist even without a phone number (for example, when the user has adopted a username). Learn the concept in BSUID and user identifiers.
The BSUID fields (
user_id, parent_user_id, username) are returned by every contact endpoint and appear populated when available or as null when absent. The wa_id field (phone) is still returned normally for backward compatibility.Authentication and base URL
Every endpoint on this page uses the production base URL and Bearer Token authentication:https://api.positus.global/v2
Headers
The list, retrieve, create, nickname, block, and unblock endpoints operate on the session’s active WhatsApp number (the number currently selected by the authenticated user). They do not take the number code (
chave) in the path. Only the export endpoint takes the number UUID in the path.List contacts
GET https://api.positus.global/v2/messenger/contacts
Lists the active number’s contacts, paginated (40 per page), ordered by the date of the last message. Supports text search and filters.
Headers
Query Parameters
Response
- 200
- 403
Returns
403 when there is no active WhatsApp number associated with the session.Retrieve a contact
GET https://api.positus.global/v2/messenger/contacts/{contact}
Returns a specific contact of the active number, identified by its UUID (id).
Path Parameters
Headers
Response
- 200
- 404
Create / update a contact
POST https://api.positus.global/v2/messenger/contacts
Creates a contact on the active number. If a contact with the same lookup identifier already exists, it is updated instead of duplicated (update-or-create behavior).
The contact can be identified by phone (phone) OR by BSUID (user_id) — you must provide at least one of the two. This allows creating contacts without a phone number, using only the BSUID.
Headers
Request Body
Lookup key (avoids duplication):
- If
user_idis provided, the contact is looked up/updated byuser_id(BSUID priority). Ifphoneis also present, the phone is stored inwa_id. - If only
phoneis provided, the contact is looked up/updated bywa_id.
username is not used as an identification key — it is populated by Meta’s webhooks.On-premises numbers: when creating a contact by
phone only (no user_id), the API validates the number against the WhatsApp API before storing — if the number does not exist, it returns 404. When creating by user_id only (no phone), this validation is skipped. On Cloud API numbers there is no prior validation.Request Body (traditional contact — by phone)
Request Body (contact by BSUID — no phone)
Request Body (BSUID + phone)
Response
- 200
- 404
- 422
The
recently_created field indicates whether the contact was created now (true) or an existing contact was updated (false).Update nickname
PUT https://api.positus.global/v2/messenger/contacts/{contact}/nickname
Updates the nickname (nickname) of an existing contact, identified by its UUID.
Path Parameters
Request Body
Response
- 200
Block a contact
POST https://api.positus.global/v2/messenger/contacts/{contact}/block
Blocks an existing contact.
Path Parameters
Request Body
Response
- 200
Unblock a contact
POST https://api.positus.global/v2/messenger/contacts/{contact}/unblock
Unblocks a blocked contact.
Path Parameters
Response
- 200
Export contacts
POST https://api.positus.global/v2/whatsapp/numbers/{number}/exports/contacts
Exports all contacts of a number (identified by its UUID in the path) as CSV or XLSX. The file includes dedicated columns for the BSUID fields (user_id, parent_user_id, username).
Path Parameters
Request Body
Response
- 200
- 422
Returns the binary file for download (CSV or XLSX) with the columns:
id, name, nickname, wa_id, user_id, parent_user_id, username, blocked, block_reason, blocked_at, created_at, updated_at.Contact object
Fields returned in the contact object (list, retrieve, and create endpoints):Search by user_id or username
The query parameter of the contact list performs a text search (via LIKE, partial match) over the following fields:
namenicknamewa_id(phone)user_id(BSUID)username
The
username is only a text search criterion — it is not a unique key. Do not use username to uniquely identify a contact; use the id (UUID) or the user_id (BSUID).