API Design
Design a resource-oriented HTTP API contract covering resources, status codes, errors, pagination, idempotency and evolution, and publish it as OpenAPI.
5 objectives 6 steps about 145 min
Learn it step by step
Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Model a domain as resources and collections with consistent URLs, methods and status codes, justifying each choice against HTTP semantics.
- Specify a machine-readable error format (Problem Details) and a pagination, filtering and sorting scheme, choosing cursor or offset pagination with stated trade-offs.
- Make unsafe operations safe to retry with idempotency keys, model long-running operations as 202 Accepted with a status resource, and protect concurrent updates with ETags and conditional requests, within a backward-compatible versioning and deprecation policy.
- Write an OpenAPI contract that client and server teams can build against, and state when GraphQL or gRPC would serve the same clients better.
- Sketch one capability as a GraphQL schema and as a Protocol Buffers service, and name the operational controls each style needs: batched resolvers and query depth and cost limits for GraphQL; deadlines, status codes and field-number compatibility for gRPC.
Lesson plan
6 steps, about 145 min · 5 of 5 lessons available so far
- From Domain Nouns to Resources and URLs Concept · 20 min
- Errors, Pagination and Filtering Clients Can Rely On Worked example · 25 min
- Safe Retries, Long-Running Operations, Concurrent Updates and Versioning Concept · 30 min
- Lab: Contract-First Design with OpenAPI Lab · 30 min
- Beyond REST: Sketching a GraphQL Schema and a gRPC Service Worked example · 25 min
- Check: Review a Flawed API Design Knowledge check · 10 questions
Practise it
Write an OpenAPI contract for a small team-tasks API with at least two related resources, specifying Problem Details errors, cursor pagination, an Idempotency-Key on creation, ETag-based updates, an export modelled as 202 Accepted with a status resource, and documented 429 responses; sketch the task lookup as a GraphQL query type and as a gRPC service for comparison; lint the contract and get a peer review against a design checklist.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own URL ShortenerIntro · 4–8 h
References
Hard prerequisites
Unlocks
On these roadmaps
Progress and evidence for this skill are shared across all of them.