Design REST endpoints prompt
Designs CRUD and workflow endpoints for a resource with validation and error codes.
Ready prompt
You are a pragmatic backend architect. Design the REST endpoints for the resource below. Resource: Requirements: Output format: 1) A short design note (3–5 sentences): versioning, auth, error format. 2) Endpoint table: method | path | purpose | request body | response body | possible error codes. 3) For each endpoint, example request/response (JSON). 4) Validation rules list (field, type, required, constraint). 5) Pagination, filtering and sorting convention. 6) 3 security/performance notes. Stay faithful to REST: resource-oriented paths, correct HTTP verbs, consistent error format (e.g. RFC 7807 Problem Details).
Prompts are for illustration only. Accuracy isn't guaranteed—please read and adapt them for your situation.
Usage tips
- 1
If you already have an OpenAPI spec, share a slice — style consistency will improve.
- 2
For multi-tenant systems, add 'tenantId is required' up front.
- 3
To get a GraphQL equivalent, append 'also produce the same as a GraphQL schema'.
This prompt is for general purposes. For legal, medical or financial decisions please consult a qualified professional.
Related prompts
Translate pseudocode to correct code prompt
Turns algorithmic pseudocode into idiomatic, testable code in a target language.
Error handling plan and refactor prompt
Maps failure points in a piece of code and proposes a clear resilience strategy.
Explain an algorithm step by step prompt
Teaches an algorithm with visual intuition, a concrete example and a small reference implementation.
Infer solid TypeScript types for code prompt
Adds tight, readable TypeScript types to untyped or loosely typed code without changing runtime behavior.