REST API design — resource modelling, HTTP methods and status codes, problem+json errors, cursor pagination, filtering and sorting, idempotency keys, conditional requests (ETag), OpenAPI schema-first, security of endpoints. Use to design or review HTTP APIs (REST, OpenAPI, HTTP API, status codes, pagination, idempotency).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Rest Api Design?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vectora-os-rest-api-design)
---
name: rest-api-design
description: REST API design — resource modelling, HTTP methods and status codes, problem+json errors, cursor pagination, filtering and sorting, idempotency keys, conditional requests (ETag), OpenAPI schema-first, security of endpoints. Use to design or review HTTP APIs (REST, OpenAPI, HTTP API, status codes, pagination, idempotency).
metadata:
category: api
---
# REST API design
## Purpose
Design HTTP APIs that are predictable, evolvable and safe to retry.
**Use when:** designing or reviewing HTTP endpoints.
**Not for:** RPC-style internal calls better served by gRPC.
## Inputs
- Use cases, consumers, data model.
## Outputs
- OpenAPI spec with examples and error catalogue.
## Read first
- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "rest api design"` for prior decisions, patterns and anti-patterns.
- [API design standard](../../../standards/api-design.md)
## Steps
1. **Resources.** Model nouns and relationships; avoid verbs in paths.
Done when every use case maps to a resource operation.
2. **Semantics.** Correct methods and status codes; POST with `Idempotency-Key` for creates that may retry.
Done when retries are safe.
3. **Collections.** Cursor pagination, filter and sort grammar, limits.
Done when no unbounded list.
4. **Errors.** problem+json with stable `type` codes.
Done when each error has a code and example.
## Best practices
- Schema-first; generate server stubs and clients.
- Consistent naming per the standard.
- Return 404 for resources outside the caller's scope.
## Common mistakes
- 200 with an error body.
- Offset pagination on large mutable sets.
- Leaking internal ids or stack traces.
## Example
`POST /v1/invoices` with `Idempotency-Key`, `GET /v1/invoices?cursor=…&status=paid&limit=50`, errors `invoice.already_paid` as problem+json.
## Reusable prompt
```text
Apply the REST API design skill (.agents/skills/rest-api-design/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Design the endpoints schema-first with methods, status codes, pagination, idempotency and an error catalogue.
Return: OpenAPI spec with examples and error catalogue..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```