Pagination & Sorting

All list endpoints in the Rekord API return paginated results with a consistent response structure.

Pagination

List endpoints accept standard pagination parameters:

Parameter
Description
Default

page

Page number (1-indexed)

1

pageSize

Number of items per page

25

GET /records?page=2&pageSize=50

Response structure

Paginated responses include metadata alongside the results:

{
  "data": [...],
  "pagination": {
    "page": 2,
    "pageSize": 50,
    "totalItems": 342,
    "totalPages": 7
  }
}
circle-info

For large result sets, prefer filtering to narrow results rather than paginating through all pages. Filtering on indexed fields like contextId, modelId, and status is efficient.

Sorting

Use the sortBy parameter to control result ordering:

Direction
Description

asc

Ascending (oldest first, A-Z, lowest first)

desc

Descending (newest first, Z-A, highest first)

Examples

Default sorting

When no sortBy parameter is provided, results are sorted by createdAt:desc (newest first).

Combining pagination and sorting

Pagination and sorting work together:

This returns the 25 most recently updated records for a specific model.

Last updated