Browse all guides

Pagination, Filtering & Sorting

Every list endpoint (GET /api/restify/{resource}) shares the same query conventions. The API Reference documents the exact filters, sort fields and relationships available per endpoint.

The Growee API is built on the open-source Laravel Restify framework - its documentation is a great companion for the full query language behind filters, search, sorting and pagination.

Pagination

Parameter Description
page Page number, starting at 1.
perPage Results per page.
curl ".../api/restify/timesheets?page=2&perPage=50" -H "Authorization: Bearer <key>"

Responses carry a meta block (current_page, last_page, total, …) and links (first, prev, next). Iterate until links.next is null.

Filtering (matches)

Endpoints expose typed filter parameters (called matches) that filter on specific columns. Pass them straight in the query string:

# Active employees only
curl ".../api/restify/employees?status=active"

# Timesheets of one employee on one project
curl ".../api/restify/timesheets?employee_id=01j2xw...&project_id=01j2xx..."

The same conventions apply to every match parameter:

Pattern Meaning
?status=active Exact match on the column.
?start_date=2026-07-01,2026-07-31 Date/range filters accept a comma-separated pair and match between the two values.
?start_date=2026-07-01 A single date matches that day exactly.
?-status=active Prefix the parameter name with - to negate the filter (everything except active).
?termination_date=null The literal string null matches records where the column is empty (?-field=null for not-empty).
?tags=design,backend List-type filters accept comma-separated values and match any of them.
# Employees without a termination date, outside a given project
curl ".../api/restify/employees?termination_date=null&-project_id=01j2xx..."

# Holidays in a date range with a given status
curl ".../api/restify/holidays?status=pending&start_date=2026-07-01,2026-07-31"

Each endpoint’s match parameters, with their types and accepted values, are listed under its query parameters in the reference - for example holidays filter by status and range, leads by stage, invoices by client. See the Laravel Restify filtering docs for the underlying mechanics.

search runs a text search over the endpoint’s searchable fields (also listed per endpoint in the reference):

curl ".../api/restify/employees?search=sarah"

Sorting

Pass a field name to sort; prefix with - for descending:

curl ".../api/restify/timesheets?sort=-date"

Relationships

Eager-load related records with related (comma-separated):

curl ".../api/restify/timesheets?related=employee,project"

Related records appear under data[].relationships:

{
  "id": "01j2xw...",
  "type": "timesheets",
  "attributes": { "worked_minutes": 90 },
  "relationships": {
    "employee": { "id": "01j2aa...", "type": "employees", "attributes": { "first_name": "Sarah" } },
    "project": { "id": "01j2bb...", "type": "projects", "attributes": { "name": "Website Redesign" } }
  }
}

Aggregated reports (grouping)

The timesheets endpoint doubles as a reporting API. Pass group to receive aggregated rows instead of individual entries:

# Hours per project in July
curl ".../api/restify/timesheets?group=project_id&date=2026-07-01,2026-07-31"

# Hours per employee, restricted to one client
curl ".../api/restify/timesheets?group=employee_id&group_client_id=01j2cc...&date=2026-07-01,2026-07-31"

Grouped rows include totals such as total_worked_minutes and total_worked_hours; users with payroll permissions also receive billing and profitability figures.

Getters and actions

Beyond CRUD, endpoints expose two extra route types (all documented in the reference):

  • Getters - read-only computed payloads: GET /api/restify/{resource}/getters/{getter}
  • Actions - operations with side effects: POST /api/restify/{resource}/actions?action={action} (or /{id}/actions for a single record). Collection-level actions take a repositories array of IDs in the body.
# Stop a running timer
curl -X POST ".../api/restify/timesheets/01j2xw.../actions?action=stop-timesheet-timer" \
  -H "Authorization: Bearer <key>"

Questions about the API? Contact support or email support@growee.net.