WhatsApp Gateway
API referenceContacts

List a session's contacts (found users)

GET
/api/v1/sessions/{session}/contacts

Returns contacts from stored data for one session.

Optional filters: source, group, and q.

Requires read. Errors: not_found for bad session ownership, validation_error for bad query values.

Authorization

AuthorizationBearer <token>

Send Authorization: Bearer <token>. The token can be a login JWT from the frontend or an api-key for a script. JWT access comes from the person's organization role. Api-key access comes from the permissions saved on the key.

In: header

Path Parameters

session*string

WhatsApp session id. Must belong to the caller organization.

Example"sess_01HZX"

Query Parameters

source?string

Optional source filter: dm or group. Omit for all.

Example"dm"

Value in

  • "dm"
  • "group"
group?string

Optional group JID filter.

Example"12345-67890@g.us"
q?string

Case-insensitive search over contact name and number.

Example"alice"
limit?integer

Maximum contacts to return. Defaults to 50. Clamped to 1-200.

Formatint64
Example50
cursor?string

Opaque pagination cursor from previous page.

Example"eyJpZCI6MTAwfQ"

Response Body

application/json

application/json

curl -X GET "https://example.com/api/v1/sessions/sess_01HZX/contacts"
{  "data": [    {      "businessName": "Acme Corp",      "lid": "205227043110953@lid",      "name": "Alice",      "phoneNumber": "6281234567890",      "source": "dm"    }  ],  "nextCursor": "string"}
{  "error": {    "code": "not_found",    "details": {      "property1": null,      "property2": null    },    "message": "session not found"  }}