Skip to content
Hoursmith Docs
API

Filtering and sorting

Filter and sort Hoursmith API list endpoints with search, field filters, date and number ranges, and the sort parameter.

List endpoints support rich filtering and sorting through query parameters. All filters combine with AND.

Sorting

Use sort with a field name. Prefix with - for descending (Stripe-style):

GET /api/v1/invoices?sort=-issueDate
GET /api/v1/clients?sort=name
  • The default sort is -createdAt (newest first).
  • Each resource allows a specific set of sort fields (e.g. invoices allow number, status, issueDate, dueDate, total, amountPaid, createdAt, and more).
  • id is always allowed as a tiebreaker. Nullable columns sort nulls last (descending) or first (ascending).

search does a case-insensitive match across a resource's main text fields (up to 200 characters):

GET /api/v1/clients?search=globex

Field filters

Exact-match filters use the field name:

GET /api/v1/projects?clientId=...&status=active
GET /api/v1/tasks?projectId=...&priority=high
GET /api/v1/time-entries?userId=...&billable=true

Booleans accept true/false, 1/0, or yes/no. Some resources also support relation filters like clientName.

Date ranges

Append From / To to a date column. Use YYYY-MM-DD (interpreted as UTC) or a full ISO timestamp:

GET /api/v1/time-entries?entryDateFrom=2026-06-01&entryDateTo=2026-06-30
GET /api/v1/invoices?paidAtFrom=2026-01-01

Number ranges

Append Min / Max to a numeric column:

GET /api/v1/time-entries?durationSecondsMin=3600
GET /api/v1/invoices?totalMax=1000

Putting it together

GET /api/v1/time-entries?projectId=...&billable=true&entryDateFrom=2026-06-01&sort=-entryDate&limit=200

Combine filters with pagination to export large datasets efficiently — filter to exactly what you need, then page with limit=200.

The exact filterable and sortable fields for each resource are documented per endpoint in the API reference.

Was this page helpful?

On this page