Pagination, Filtering, and Errors

Pagination

Paginated endpoints accept:

ParameterDefaultNotes
page1Minimum value is 1.
limit50Maximum value is 100.

Responses include meta.total, meta.page, meta.limit, and meta.totalPages.

GET /customers also accepts includeCount=false to skip the total count. In that case meta.total and meta.totalPages are null and meta.hasNextPage tells you whether another page exists.

Common Filters

Services support filters such as date range, unscheduled inclusion, customer ID, customer email, and text search. The date range applies only when both startDate and endDate are supplied.

Customers support filters such as email, name, phone, text search, parent-customer status, and parent customer ID. Use include=services to include each customer's services.

Errors

Common error responses include:

StatusMeaning
400Required field, malformed date, or invalid request body.
401Missing or invalid API key.
403The organizationId you sent does not match the API key's organization ({"error":"Access denied to this organization"}), the resource belongs to another organization, or the authenticated user lacks the required permission.
404Resource not found or not visible to the authenticated organization.
409Conflict, such as a customer with the same email or number already existing, or archiving a customer that still has proposals (code is CUSTOMER_HAS_PROPOSALS).
500Unexpected server error.
503Authentication is temporarily unavailable: {"error":"Authentication service unavailable"}. Retry the request.

Error bodies usually include an error string and may include details for server-side diagnostics.

Market availability errors

/market-availability uses its own error shape, with a success flag:

{ "success": false, "error": "Invalid API key" }

It returns 400 for a missing address or date, a date that is not YYYY-MM-DD, an invalid slotDurationMinutes, or an address that cannot be geocoded. It returns 401 for a missing or invalid key and 503 when authentication is temporarily unavailable.