Search docs

Docs search
Back to Rule Catalog
AP-API-010API Design

Missing pagination on collection endpoint

Flags collection endpoints that do not expose clear pagination or bounded result controls.

warningviolationNo auto-fix

How to fix

  1. Add limit/cursor or page parameters.
  2. Document defaults and maximum page size in the API contract.
  3. Return pagination metadata when clients need it.

What the rule validates

An API endpoint returns a collection without documented limit, cursor, or page controls.

Why it matters

Collection endpoints need bounded behavior for reliability and predictable client usage.

Common causes

  • A list endpoint was added as a simple array response.
  • Pagination exists in code but not in the contract.
  • A small collection grew into a high-cardinality resource.

Typical violation example

GET /repositories returns every repository in the organization with no limit parameter.

Typical compliant example

GET /repositories?limit=50&cursor=... returns a bounded page and next cursor.

Related rules

Adjacent categories

Related files/config

  • contracts/openapi.yaml
  • apps/api/src

Related CLI commands

  • archpilot validate
  • archpilot validate --ci
AP-API-010 - Missing pagination on collection endpoint | ArchPilot Docs