Skip to main content
Notra uses offset-based pagination for list endpoints. Each response includes a pagination object so you can build paging controls in your UI.

How Pagination Works

When you request a list of posts, the response includes pagination metadata so you can:
  • Control how many items each request returns
  • Move between pages
  • Know how many total items exist
  • Build clear pagination controls

Query Parameters

limit
integer
default:"10"
The maximum number of items to return per page. Range: 1-100 items per page
page
integer
default:"1"
The page number to retrieve. Pages start at 1. Minimum: 1

Pagination Response

Every paginated response includes a pagination object:
pagination
object
Metadata about the current page and navigation options.

Request Examples

Fetch the first page with the default limit (10):

Building Pagination Controls

Use the pagination object to build navigation controls:

Best Practices

  • Use a distinct cache key for each combination of page, limit, sort, status, and contentType.
  • Invalidate paginated list caches after post updates, deletes, and completed generation jobs.
  • For a fuller strategy, see Caching.
Performance: Use smaller page sizes (5-20 items), especially for mobile clients.
Empty states: Always handle posts: [] in your UI.
Navigation: Use nextPage and previousPage to enable or disable buttons. These values are null when movement is not possible.
UI state: pagination already contains everything you need for page state: current page, total pages, next, and previous.

Error Handling

If you request a page that does not exist, the API returns an error response:
Check for an error field before reading pagination values.
  • Values below 1 default to 1
  • Values above 100 are capped at 100
  • Non-numeric values default to 10
When there are no items, totalPages is 0, totalItems is 0, and posts is an empty array.
Last modified on July 6, 2026