API
Filtering
Filter API responses to retrieve only the data you need.
Overview
Most list endpoints support filtering via query parameters. You can filter by specific field values, date ranges, and status values to narrow down results.
Basic Filtering
Pass field names as query parameters with the desired value:
bash
# Filter customers by status
curl "https://www.pxb.app/api/public/v1/customers?status=active"
# Filter by multiple fields
curl "https://www.pxb.app/api/public/v1/customers?status=active&type=premium"Common Filter Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by resource status (e.g., active, archived). |
search | string | Full-text search across relevant fields. |
createdAfter | ISO 8601 | Filter resources created after this date. |
createdBefore | ISO 8601 | Filter resources created before this date. |
updatedAfter | ISO 8601 | Filter resources updated after this date. |
Date Range Filtering
Filter by date ranges using ISO 8601 formatted dates:
bash
# Get customers created in January 2024
curl "https://www.pxb.app/api/public/v1/customers?createdAfter=2024-01-01T00:00:00Z&createdBefore=2024-02-01T00:00:00Z"
# Get recently updated records
curl "https://www.pxb.app/api/public/v1/customers?updatedAfter=2024-03-01T00:00:00Z"Text Search
Use the search parameter for full-text search across relevant fields:
bash
# Search customers by name or email
curl "https://www.pxb.app/api/public/v1/customers?search=smith"The search parameter typically searches across name, email, and other relevant text fields. Check individual endpoint documentation for specific searchable fields.
Combining Filters
Filters can be combined with pagination and sorting:
bash
curl "https://www.pxb.app/api/public/v1/customers?status=active&search=enterprise&sortBy=createdAt&sortOrder=desc&limit=20"Response Example
Filtered responses include only matching records:
json
{
"message": "Customers retrieved successfully!",
"content": {
"customers": [
{
"id": "cust_abc123",
"firstName": "Jane",
"lastName": "Smith",
"status": "active",
"createdAt": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"total": 1,
"limit": 20,
"offset": 0,
"hasMore": false
}
}
}Notes
- The
searchparameter is case-insensitive. Status-style filters are matched exactly. - Available filters vary by endpoint — check the endpoint reference for the exact set of supported query parameters.
- Invalid filter values are ignored and the unfiltered set is returned.
- The
totalin pagination reflects the filtered count, not the total records.