Designs RESTful API endpoints with proper HTTP methods, status codes, request/response schemas, and error handling.
Design a RESTful API for [feature/resource]. Follow REST best practices and produce production-ready specifications. **For each endpoint, specify**: 1. **Method & Path**: Follow REST conventions (plural nouns, nested resources) 2. **Request**: Headers, query params, path params, body (with TypeScript types) 3. **Response**: Success body (with types), status code 4. **Errors**: All possible error responses with status codes and error body format 5. **Auth**: Required authentication/authorization level 6. **Rate limit**: Suggested rate limit tier **Design rules**: - Use plural nouns for collections (/users, not /user) - Use UUID or CUID for IDs, never sequential integers in URLs - Support pagination with cursor-based pagination (not offset) for large collections - Include filtering, sorting, and field selection where appropriate - Version via URL path (/v1/) not headers - Use 201 for creation, 204 for deletion, 200 for everything else successful - Error format: { "error": { "code": "RESOURCE_NOT_FOUND", "message": "...", "details": {} } } **Output as**: OpenAPI 3.1 YAML snippet + curl examples for each endpoint **Resource to design**: [describe the feature]
No gallery images yet.
Discussion
Start a discussion about this prompt