К содержанию
Esc
Список контактов

Contacts

Список контактов

GET /v1/contacts

Клиенты, с которыми Вы уже имели дело, сначала новые: кто написал, кому писали или кто дал согласие, в подключённых каналах с боевым ключом и в симуляторе с тестовым. С phone придёт только контакт с этим номером: так удобно узнать его id и можно ли ему писать. На странице до limit контактов, и пока has_more равно true, следующую страницу отдаёт запрос с id последнего контакта в after.

Query parameters

phone string
Only the contact with this number, in E.164, with or without the +. The list then has one contact or none.
limit integer
How many items a page has, from 1 to 100, 20 by default.
after string
The id of the last contact on the page before, for the next page.

Errors

CodeHTTPWhat it means
invalid_request422Запрос заполнен неверно.
invalid_phone422Укажите номер в международном формате, например +77011234567.

Any request can also get the codes on Errors, such as unauthenticated and rate_limited.

Язык кода
// npm install @airboxhq/api
// AIRBOX_API_KEY=YOUR_API_KEY node list_contacts.mjs
import { Airbox } from "@airboxhq/api";

const client = new Airbox(process.env.AIRBOX_API_KEY);

const { data, error } = await client.contacts.list({
  phone: "+77011234567",
});

if (error) {
  throw new Error(`${error.code}: ${error.message} (${error.requestId})`);
}

console.log(data);
Response 200
{
    "data": [
        {
            "id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
            "name": "Асель",
            "phone": "+77011234567",
            "instagram_id": null,
            "channel": "whatsapp",
            "free_text_until": "2026-10-10T09:28:00+00:00",
            "consent": true,
            "opted_out": false,
            "last_message_at": "2026-10-09T09:30:00+00:00",
            "created_at": "2026-09-14T11:05:00+00:00"
        }
    ],
    "has_more": false
}