Turn a Feature Description into a REST API Endpoint Spec
Paste a feature description and get a REST API spec with a route table, request and response fields, status codes, exact validation rules, and open questions on auth and pagination.
You getSummary table, one section per endpoint and shared error response shape
Prompt
You are a senior backend engineer who writes API specs that frontend and QA teams can build against.
Job: I will paste a feature description right after this prompt. Turn it into a REST API endpoint spec. If the description is too thin to name the resources, ask me up to 3 short numbered questions in one message and wait for my answers.
Rules:
1. Use plural nouns for resources and standard methods (GET, POST, PATCH, DELETE). No verbs in paths.
2. Every route lists its success code plus at least two error codes, each with the exact condition that triggers it.
3. Show request and response bodies as field lists with field name, type, required or optional, and an example value.
4. Every validation rule must be checkable: give exact limits (max length, allowed values, formats), never just "must be valid".
5. Do not decide auth or pagination silently. State the default you used and list it as an open question.
Output format:
1. Summary table: Route | Method | Purpose | Success code | Error codes
2. One section per endpoint: request fields, response fields, validation rules
3. Shared error response shape
4. Open questions: auth, pagination, rate limits, anything else unclear
End with one line naming the biggest assumption you made and what breaks if it is wrong.Example output
Tips and common edits
Why this works
- Requiring two error codes with trigger conditions per route forces the edge cases QA would otherwise find late.
- Exact validation limits replace vague 'must be valid' rules, so the spec can be turned straight into tests.
- Making auth and pagination explicit open questions stops the model from quietly baking in choices you never made.
Use before writing backend code or a ticket. Have a short feature description ready, even a few sentences from a product doc. Works in ChatGPT, Claude or Gemini; paste the description right after the prompt.
Common edits
- Ask for an OpenAPI 3.0 YAML version of the spec after the tables.
- Swap rule 1 for your team's conventions, such as snake_case paths or versioned routes like /v1.
Make it repeatable
Keep using this prompt without pasting it in every time.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Create safe user error messages with correlation IDs
Turn internal backend exceptions into secure, user-facing error payloads paired with traceable request correlation IDs. Use it to build clean API error contracts.
Design Cursor-Based Pagination Logic for High-Volume APIs
Get a complete implementation plan for cursor-based pagination including SQL queries, cursor encoding logic, and strategies for handling record deletions.
Design Standardized REST API Error Contracts Using RFC 7807
Generate a comprehensive, machine-readable API error schema that follows the RFC 7807 Problem Details standard for consistent, client-side error handling.
Generate complete API documentation from route code
Generate clear request, response, and error documentation directly from backend handler code. Use it to prepare API docs for frontend developers.
Design a Scalable API Rate Limiting Architecture
Get a complete technical blueprint for implementing API rate limiting using Redis, including data structures, tiered limit logic, and standard response headers.
Build and verify a cron schedule expression
Convert your desired job schedule into an exact cron expression with clear plain-English breakdown and upcoming run dates.