Skip to content

Pagination

All list endpoints support pagination.

Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
per_pageinteger25Items per page (max 100)

Response Structure

json
{
  "data": [
    { "id": 1, "email": "[email protected]" },
    { "id": 2, "email": "[email protected]" }
  ],
  "meta": {
    "total": 150,
    "count": 25,
    "per_page": 25,
    "current_page": 2,
    "last_page": 6
  },
  "links": {
    "first": "https://app.beeving.com/api/v1/contacts?page=1",
    "last": "https://app.beeving.com/api/v1/contacts?page=6",
    "prev": "https://app.beeving.com/api/v1/contacts?page=1",
    "next": "https://app.beeving.com/api/v1/contacts?page=3"
  }
}

Example

bash
# Page 2, 50 items per page
curl "https://app.beeving.com/api/v1/contacts?page=2&per_page=50" \
  -H "Authorization: Bearer YOUR_TOKEN"

Iterating All Pages

js
async function getAllContacts(token) {
  let page = 1
  let allContacts = []

  while (true) {
    const res = await fetch(
      `https://app.beeving.com/api/v1/contacts?page=${page}&per_page=100`,
      { headers: { Authorization: `Bearer ${token}` } }
    )
    const { data, meta } = await res.json()
    allContacts.push(...data)

    if (page >= meta.last_page) break
    page++
  }

  return allContacts
}

API v1.0