Skip to content

Pagination

All list endpoints in the Adva API support pagination through limit and offset query parameters. Responses include the total count of matching records so you can calculate page numbers or detect when you have reached the end.

ParameterTypeDefaultRangeDescription
limitinteger501 — 100Maximum number of records to return
offsetinteger00+Number of records to skip

Fetch the first page of customers (default: 50 records):

Terminal window
curl -X GET "https://api.getadva.ai/api/v1/core/customers" \
-H "Authorization: Bearer $TOKEN"

Fetch the second page:

Terminal window
curl -X GET "https://api.getadva.ai/api/v1/core/customers?limit=50&offset=50" \
-H "Authorization: Bearer $TOKEN"

Fetch a smaller page (10 records):

Terminal window
curl -X GET "https://api.getadva.ai/api/v1/core/customers?limit=10&offset=0" \
-H "Authorization: Bearer $TOKEN"

Every list endpoint returns a consistent envelope:

{
"customers": [
{ "contact_id": "...", "display_name": "John Smith", ... },
{ "contact_id": "...", "display_name": "Jane Doe", ... }
],
"total": 142,
"limit": 50,
"offset": 0
}
FieldTypeDescription
<resource>arrayThe array of records (key name matches the resource, e.g., customers, proposals, jobs)
totalintegerTotal number of records matching the current filters (before pagination)
limitintegerThe limit that was applied
offsetintegerThe offset that was applied
async function fetchAllCustomers(token) {
const limit = 100;
let offset = 0;
let allCustomers = [];
while (true) {
const response = await fetch(
`https://api.getadva.ai/api/v1/core/customers?limit=${limit}&offset=${offset}`,
{ headers: { Authorization: `Bearer ${token}` } },
);
const data = await response.json();
allCustomers = allCustomers.concat(data.customers);
if (allCustomers.length >= data.total) break;
offset += limit;
}
return allCustomers;
}

Most list endpoints support sorting through sort_by and sort_order query parameters:

ParameterTypeDefaultDescription
sort_bystringvaries by endpointField to sort by
sort_orderasc or descvaries by endpointSort direction

Sort customers by name, descending:

Terminal window
curl -X GET "https://api.getadva.ai/api/v1/core/customers?sort_by=display_name&sort_order=desc" \
-H "Authorization: Bearer $TOKEN"

Sort proposals by creation date:

Terminal window
curl -X GET "https://api.getadva.ai/api/v1/sales/proposals?sort_by=created_at&sort_order=asc" \
-H "Authorization: Bearer $TOKEN"

List endpoints support domain-specific filters as query parameters. Filters vary by resource. Here are common patterns:

ParameterTypeDescription
lifecycle_statusstringFilter by status (e.g., active, lead, prospect)
territory_idUUIDFilter by territory
assigned_rep_idUUIDFilter by assigned sales rep
searchstringFull-text search across customer fields
Terminal window
curl -X GET "https://api.getadva.ai/api/v1/core/customers?lifecycle_status=active&search=smith" \
-H "Authorization: Bearer $TOKEN"
ParameterTypeDescription
deal_idUUIDFilter by deal
customer_role_idUUIDFilter by customer role
statusstringFilter by status (scheduled, completed, cancelled, no_show, rescheduled)
searchstringSearch across appointment fields
ParameterTypeDescription
equipment_idUUIDFilter by specific equipment
crew_idUUIDFilter crew equipment by crew
job_idUUIDFilter job equipment by job
maintenance_typestringFilter maintenance logs by type
activebooleanFilter crew equipment by active status

All filters, sorting, and pagination parameters can be combined:

Terminal window
curl -X GET "https://api.getadva.ai/api/v1/core/customers?lifecycle_status=active&territory_id=550e8400-e29b-41d4-a716-446655440000&sort_by=display_name&sort_order=asc&limit=25&offset=0" \
-H "Authorization: Bearer $TOKEN"