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 as0if omitted or negative) andsize(records per page; defaults to50if omitted or non-positive, silently clamped to a maximum of100if a larger value is supplied). - Cursor-based: provide
startAfterIdto page forward orendAtIdto page backward, using the contract's server-assignedidfield (notdocumentId) from a previous response. If either cursor parameter is supplied, it takes precedence overpageeven if both are sent. If none ofpage,startAfterId, orendAtIdare supplied, the first page is returned in cursor mode, ordered ascending byid.
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
- 200
- 400
- 401
- 403
Paginated list of contracts for the tenant, in the order determined by the pagination mode used (see description).
Reserved for invalid filter criteria. This endpoint does not currently expose a filter query parameter, so in practice this status is not triggered by any input to this operation today.
Unauthorized - Authentication required
Forbidden - Insufficient permissions