Skip to main content
All list endpoints return paginated results using offset-based pagination.

Parameters

ParameterTypeDefaultDescription
limitinteger50Items per page (1-100)
offsetinteger0Items to skip

Response format

{
  "data": [...],
  "meta": {
    "total": 1250,
    "limit": 50,
    "offset": 0,
    "has_more": true
  }
}
FieldDescription
totalTotal number of items matching the query
limitPage size used
offsetNumber of items skipped
has_moreWhether more items exist beyond this page

Iterating through all results

import requests

BASE_URL = "https://app.leonar.app/api/v1"
HEADERS = {"Authorization": "Bearer leo_your_api_key"}

def get_all_contacts():
    contacts = []
    offset = 0
    limit = 100

    while True:
        response = requests.get(
            f"{BASE_URL}/contacts",
            headers=HEADERS,
            params={"limit": limit, "offset": offset},
        )
        result = response.json()
        contacts.extend(result["data"])

        if not result["meta"]["has_more"]:
            break

        offset += limit

    return contacts

Filtering and sorting

Most list endpoints support filtering and sorting via query parameters. Filters use operator-based syntax:
OperatorExampleDescription
eq.value?global_status=eq.newEquals
neq.value?global_status=neq.archivedNot equals
gt.value?created_at=gt.2026-01-01Greater than
gte.value?created_at=gte.2026-01-01Greater than or equal
lt.value?amount=lt.50000Less than
lte.value?amount=lte.50000Less than or equal
like.%value%?first_name=like.%Sophie%Case-sensitive match
ilike.%value%?first_name=ilike.%sophie%Case-insensitive match
is.null?archived_at=is.nullIs null
is.not_null?archived_at=is.not_nullIs not null
Sorting uses a sort parameter with - prefix for descending order:
?sort=-created_at    # Newest first
?sort=last_name      # Alphabetical