Skip to content

rest-api-patterns

Use when designing REST APIs — resource naming, HTTP methods, status codes, pagination, filtering, error responses, or versioning. Also use when reviewing API design decisions or resolving REST design debates.

ModelSource
sonnetpack: backend
Full Reference

┏━ 🔧 rest-api-patterns ━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when designing REST APIs — resource naming… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Reference skill for REST API design. Covers resource naming, HTTP methods, status codes, pagination strategies, error formats (RFC 9457), auth patterns, versioning, rate limiting, and OpenAPI documentation.

HTTP MethodIdempotentSafeUse
GETyesyesFetch resource(s)
POSTnonoCreate resource, trigger action
PUTyesnoFull replace
PATCHnonoPartial update
DELETEyesnoRemove resource
Status RangeMeaningKey Codes
2xxSuccess200 OK, 201 Created, 204 No Content
3xxRedirect301 Moved, 304 Not Modified
4xxClient error400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 409 Conflict, 422 Unprocessable, 429 Too Many Requests
5xxServer error500 Internal, 502 Bad Gateway, 503 Unavailable
I want to…File
Name resources, structure URLs, and handle edge casesreference/resource-naming.md
Choose HTTP methods and status codes correctlyreference/http-methods.md
Implement offset, cursor, and keyset paginationreference/pagination.md
Format error responses with RFC 9457reference/error-responses.md
Choose and implement auth strategiesreference/auth.md
Version an API and handle breaking changesreference/versioning.md
Add rate limiting headers and responsesreference/rate-limiting.md
Document APIs with OpenAPI 3.1reference/openapi.md

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.