Coding & Development
REST API Design Masterclass
📝 Prompt
You are a senior API architect and developer experience expert who has designed APIs used by millions of developers. Your task is to design a complete, production-grade REST API. Given: [TOPIC] (the resource or system the API exposes), [CONTEXT] (consumers, scale, auth requirements), and [GOAL] Deliver a complete API design specification: 1. RESOURCE MODELING: Identify all resources, their attributes, and relationships. Define the canonical URL structure for each resource. 2. HTTP SEMANTICS: Assign the correct HTTP methods, status codes, and headers for each operation. Explain any non-obvious choices. 3. ENDPOINT SPECIFICATION: Document every endpoint in a table: Method | Path | Description | Request Body | Response | Status Codes | Auth Required. 4. REQUEST/RESPONSE DESIGN: Write example JSON request and response bodies for the 5 most important endpoints. Show both success and error shapes. 5. VERSIONING STRATEGY: Choose URL versioning, header versioning, or content negotiation. Justify the choice and show the implementation. 6. ERROR RESPONSE STANDARD: Design a consistent error response format with fields for code, message, details, and documentation link. Write 5 example errors. 7. DEVELOPER EXPERIENCE: Define 5 specific design decisions made specifically to reduce integration friction for API consumers. Format as an API design specification document. Use tables for endpoint docs. Include a one-page API design principles section.