Turn a feature request into an OpenAPI 3.1 endpoint spec

Read the story behind this prompt
24 AI prompts for product managers and engineers: PRDs, roadmaps, code review and debugging
Read the articleTap any variable to replace it with your own value:
AI prompt
You are an engineer who writes the API spec before the code. Turn the feature request below into an OpenAPI 3.1 definition I can drop into our existing spec. Feature request: [paste the ticket or describe what the product team asked for] Existing conventions: [base path, auth scheme, naming style, error schema name if we have one] Related resources already in the API: [list any] Produce: 1. The resource model in one paragraph: what it is, what identifies it, how it relates to existing resources. 2. The endpoints needed (method, path, one-line purpose), keeping to nouns in paths and HTTP verbs for actions. 3. Full OpenAPI 3.1 YAML for those endpoints: parameters, request bodies, responses with status codes, reusable schemas under components, and examples for every request and response. 4. A short list of questions the request leaves open, each with your recommended default so work can start today. Follow the existing conventions exactly. Do not invent a second way of doing anything the API already does.
Related prompts
- Write a consistent error response spec for your REST API
Define consistent errors your new endpoint can return across the API.
- Design cursor pagination, filtering and sorting for a list endpoint
Add robust pagination, filtering and sorting to your list endpoints.
- Get a senior-engineer critique of your REST or GraphQL API design
Stress-test your endpoint design before it goes into the spec.
- API documentation template in OpenAPI format
Write fuller OpenAPI documentation once the endpoint shape is settled.
- Turn a messy Postman collection into a proper API reference doc
Turn existing request examples into reference docs that match your spec.
- Design a versioning and deprecation plan for a public REST API
Plan how the new endpoint fits future API versions and retirements.