001-api-design.md markdown
39 lines 1.6 KB
Raw
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd feat(calendar): enforce agent context tiers in retrieval AP… Human minor ⚠ breaking 1 day ago

title: "ADR 001: Public API design — versioning and error model" project: engineering-team-template tags:

  • adr
  • api
  • design date: 2026-04-07

ADR 001: Public API design — versioning and error model

Status

Accepted (template example)

Context

We are exposing a customer-facing HTTP API for integrations. Mobile and server clients need predictable breaking-change policy, structured errors for programmatic handling, and observability-friendly request identifiers.

Constraints

  • Must support monthly releases; some customers upgrade slowly.
  • Error payloads must avoid PII and internal stack traces.
  • Rate limits and idempotency headers required for payment-adjacent endpoints.

Alternatives considered

  1. URL path versioning only (/v1/...) — simple; some clients cache aggressively and miss headers.
  2. Header-based negotiation only — flexible; poor ergonomics for curl and beginner integrators.
  3. Combined path major + header minor — more complex operations story.

Decision

Use /v1 path prefix for major breaking versions. Include X-Request-Id on all responses (echoed if provided). Errors use a stable JSON envelope: code, message, details (optional, non-sensitive), request_id.

Outcome & consequences

Clients pin major in the URL; we add fields in minors. Support traces request_id without leaking internals. Tradeoff: we must honor deprecation windows and ship real changelogs. Link OpenAPI from the repo; see runbooks/deploy-production.md for capacity under 503 load.

File History 2 commits
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd feat(calendar): enforce agent context tiers in retrieval AP… Human minor 1 day ago
sha256:9103f98c89257ed2b01c237cea895dabb3e85ea337dccb1161c175e4422355b6 docs: accept Calendar Events v0 spec with Phase 0 security … Human 1 day ago