API Contract Design
Core Workflow
- Identify API consumers, use cases, resource model, auth context, and compatibility constraints.
- Define endpoints or methods with request fields, response fields, status codes, errors, pagination, filtering, sorting, and idempotency.
- Specify validation rules, defaults, field ownership, and backward-compatible evolution rules.
- Separate public contract from implementation detail.
- Include examples and edge cases that clients can test against.
- Flag open decisions and review needs before implementation.
Safety Rules
- Do not invent production behavior, security guarantees, rate limits, or auth scopes not present in source material.
- Do not expose internal-only fields, private identifiers, secrets, or customer data in examples.
- Require review for contracts affecting billing, auth, customer data, public APIs, or backward compatibility.
Deliverable Shape
For API contracts, provide:
- Consumer and use case
- Resource model
- Endpoint or method table
- Request and response schemas
- Error and status-code contract
- Idempotency, pagination, filtering, and versioning notes
- Examples and edge cases
- Open decisions and review gates
References
- Read
references/api-contract-design-checklist.mdwhen designing or reviewing an API contract.