Skip to main content

List contracts with pagination

GET 

/contracts

Returns a paginated list of contracts for the tenant identified by the tenant-id header.

When to use: Use this endpoint to browse or page through the contract catalogue. For a single known contract, prefer GET /contracts/{id} to avoid scanning a page of results.

Preconditions: Requires the READ_CONTRACT permission.

Pagination: Two modes are supported and should not be combined:

  • Offset-based: provide page (0-based; treated as 0 if omitted or negative) and size (records per page; defaults to 50 if omitted or non-positive, silently clamped to a maximum of 100 if a larger value is supplied).
  • Cursor-based: provide startAfterId to page forward or endAtId to page backward, using the contract's server-assigned id field (not documentId) from a previous response. If either cursor parameter is supplied, it takes precedence over page even if both are sent. If none of page, startAfterId, or endAtId are supplied, the first page is returned in cursor mode, ordered ascending by id.

Filtering: This operation does not currently accept a filter query parameter - every call returns the full unfiltered set of contracts for the tenant, paginated. (The underlying data layer supports filtering by planId/networkId/documentId, but this endpoint does not yet forward a filter to it.)

Response: A paginated envelope containing a data array of Contract objects, a links object with self/next/prev navigation URLs (next/prev are null when there is no further page in that direction), and a totalCount of matching records. No state is changed; this operation is safe and idempotent.

Request​

Responses​

Paginated list of contracts for the tenant, in the order determined by the pagination mode used (see description).