← ClaudeAtlas

api-contractslisted

API design and contract engineering — REST resource modelling, error envelopes, pagination, filtering, idempotency, versioning and deprecation, rate limiting, webhooks, OpenAPI, GraphQL schema and N+1 defence, and contract testing. Use when designing, reviewing or documenting an endpoint or integration; when the user says "API design", "REST", "GraphQL", "endpoint", "OpenAPI", "Swagger", "versioning", "pagination", "rate limit", "webhook", "idempotency", "status code", "API contract", "breaking change" or "integrate with"; and as a pass in any project audit that finds a public or internal API. By Devleck.
Kin9Zeus/senior-engineer-skills · ★ 3 · API & Backend · score 77
Install: claude install-skill Kin9Zeus/senior-engineer-skills
# API Contracts An API is a promise you cannot take back. Internal APIs can be refactored; anything a second party consumes becomes a compatibility obligation the moment the first integration ships. Design for the consumer who is not in the room, does not read your changelog, and will retry on failure. --- ## The seven properties of a good endpoint Every endpoint should be: 1. **Predictable** — its shape is inferable from the others. 2. **Authorised** — per object, not merely authenticated. 3. **Validated** — with a schema, at the boundary, rejecting unknown fields. 4. **Idempotent where it can be** — safe to retry. 5. **Bounded** — pagination capped, payload size capped, response time bounded. 6. **Observable** — logged with a correlation id, latency and error rate measured. 7. **Documented** — from the code, so it cannot drift. An endpoint missing any of these is a finding, whatever it returns. --- ## REST essentials **Resources are nouns; HTTP verbs are the operations.** ``` GET /v1/invoices list POST /v1/invoices create GET /v1/invoices/{id} read PATCH /v1/invoices/{id} partial update DELETE /v1/invoices/{id} delete POST /v1/invoices/{id}/void a state transition that is not CRUD ``` Actions that are genuinely not CRUD get a sub-resource with `POST`. Do not contort them into `PATCH` with a magic `status` field, and do not invent `/getInvoices`. **Status codes people actually need to