Core Concepts
Pagination, Filtering & Sorting
All list endpoints in the FairePlace API support pagination, filtering, and sorting with a consistent interface.
Pagination
Request parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number (1-based) |
per_page | integer | 20 | Items per page (max 100) |
Code
Response format
Every paginated response includes a meta.pagination object:
Code
| Field | Description |
|---|---|
current_page | The current page number |
per_page | Number of items per page |
total | Total number of items across all pages |
total_pages | Total number of pages |
has_next | Whether there are more pages after this one |
has_prev | Whether there are pages before this one |
Iterating through all pages
Code
Filtering
Filter results using query parameters. Available filters vary by resource.
Code
Common filters
| Resource | Filters |
|---|---|
| Leases | status, estate_id, start_date_from, start_date_to |
| Places | owner_id, postal_code, city, place_category |
| Estates | area_min, area_max, floor, number_of_room |
| Lessees | search, category |
| Owners | search, owner_category |
| Contacts | search, type |
Date range filtering
Use _from and _to suffixes for date ranges:
Code
Sorting
Sort results using the sort parameter. Prefix with - for descending order.
Code
Sortable fields
Most resources support sorting on:
created_at/-created_atupdated_at/-updated_at- Resource-specific fields (e.g.,
rent_amount,last_name,area)
Combining parameters
Pagination, filtering, and sorting can be combined:
Code
Rate limits
List endpoints are subject to the standard rate limit of 1,000 requests per hour per tenant. Large per_page values do not count as multiple requests.
Rate limit headers are included in every response:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests per hour |
X-RateLimit-Remaining | Requests remaining in the window |
X-RateLimit-Reset | Unix timestamp when the limit resets |
Related
- Error Handling — Error codes and troubleshooting
- Authentication — JWT tokens and permissions
- Multi-tenancy — Data isolation
Last modified on