Pagination and filters
Paginated listings (GET /contacts, /conversations, /campaigns, timelines, notes, recipients and runs) always return the same envelope:
{
"data": [ … ],
"meta": { "page": 1, "pageSize": 20, "total": 318, "totalPages": 16 }
}| Parameter | Value |
|---|---|
page |
Starts at 1. Default 1 |
pageSize |
From 1 to 100. Default 20 |
The main listings add tabs (how many items are in each dashboard tab) and summary (the header figures), so you don't have to request each tab separately. GET /automations is not paginated: it returns data and summary.
Iterating through everything
async function* contacts(apiKey) {
for (let page = 1; ; page++) {
const res = await fetch(`https://micuenta.whatsmarketing.es/api/v1/contacts?page=${page}&pageSize=100`, {
headers: { Authorization: `Bearer ${apiKey}` },
});
const { data, meta } = await res.json();
yield* data;
if (page >= meta.totalPages) break;
}
}Listings are sorted by recent activity; if you create or modify records while iterating, an item may shift between pages. For continuous syncs, use webhooks instead of iterating.
Filters
Each listing has its own filters (see the reference). The most common ones:
q: free-text search by name, phone, email or company.taborfilter: the same tabs you see in the dashboard (leads,customers,unassigned,finished…).days: only items with activity in the last 7, 30 or 90 days.tag,lifecycleStageId,ownerId,channelType,status: one value per parameter.
Filters are combined with AND. An unknown parameter responds 400.