Pagination & Filtering
All list endpoints in the Ever Gauzy API support pagination, sorting, filtering, and relation loading through query parameters.
Paginationβ
Parametersβ
| Parameter | Type | Default | Description |
|---|---|---|---|
take | number | 10 | Number of records to return (page size) |
skip | number | 0 | Number of records to skip (offset) |
Exampleβ
GET /api/employee?take=25&skip=50
Authorization: Bearer {token}
Returns records 51β75.
Response Formatβ
All paginated endpoints return:
{
"items": [...],
"total": 150
}
itemsβ array of entities for the requested pagetotalβ total count of matching records (for calculating page count)
Calculate Total Pagesβ
totalPages = Math.ceil(total / take)
currentPage = Math.floor(skip / take) + 1
Sortingβ
Order Parametersβ
Use order[field]=ASC|DESC:
GET /api/employee?order[createdAt]=DESC&order[firstName]=ASC
Multiple Sort Fieldsβ
Multiple sort fields are applied in order:
GET /api/tasks?order[priority]=ASC&order[dueDate]=ASC&order[title]=ASC
Filteringβ
Where Conditionsβ
Use where[field]=value for exact matches:
GET /api/employee?where[isActive]=true&where[organizationId]=org-uuid
Nested Filteringβ
For related entity fields:
GET /api/tasks?where[project][name]=Gauzy
Organization & Tenantβ
Most endpoints automatically filter by the current tenant. You can additionally filter by organization:
GET /api/employee?where[organizationId]=org-uuid
Relationsβ
Loading Relationsβ
Use relations[]=name to eager-load related entities:
GET /api/employee?relations[]=user&relations[]=organization&relations[]=tags
Nested Relationsβ
GET /api/employee?relations[]=user.role&relations[]=organization.contact
Common Relationsβ
| Entity | Available Relations |
|---|---|
| Employee | user, organization, tags, skills |
| Task | project, creator, members, teams, tags |
| Time Log | employee, project, task, timeSlots |
| Invoice | toContact, fromOrganization, invoiceItems |
| Candidate | user, source, interview, skills |
Date Range Filteringβ
Many endpoints support date range parameters:
GET /api/timesheet/time-log?startDate=2024-01-01&endDate=2024-01-31
| Parameter | Format | Description |
|---|---|---|
startDate | ISO 8601 | Start of date range |
endDate | ISO 8601 | End of date range |
Searchβ
Text Searchβ
Some endpoints support full-text search:
GET /api/employee?search=John
Tag Filteringβ
Filter by tags:
GET /api/tasks?tags[]=frontend&tags[]=urgent
Query Builder Syntaxβ
For complex queries, the API supports a query builder syntax via the request body on POST endpoints:
POST /api/employee/search
Authorization: Bearer {token}
Content-Type: application/json
{
"findInput": {
"where": {
"isActive": true,
"organizationId": "org-uuid"
},
"relations": ["user", "organization"],
"order": { "createdAt": "DESC" },
"take": 25,
"skip": 0
}
}
Limitationsβ
- Maximum
takevalue: 50 (configurable per endpoint) - Maximum relation depth: 3 levels
- Default
takewhen not specified: 10
Best Practicesβ
- Always paginate β never request all records without
take - Load only needed relations β reduce response payload
- Use server-side filtering β filter via query params, not client-side
- Cache page counts β
totalis expensive for large datasets - Use date ranges β for time-based data, always specify date boundaries