REST API design with versioning and OpenAPI documentation
Design a robust REST API with naming conventions, versioning, pagination, and Swagger documentation.
Create a professional, well-documented REST API that follows industry best practices and facilitates integration by frontend teams and external partners.
At a glance
Access
Free prompt
Open to copy without upgrading.
Prompt objective
Create a professional, well-documented REST API that follows industry best practices and facilitates integration by frontend teams and external partners.
Real use case
The logtech EnviaJΓ‘ is building a public API so marketplaces can integrate their shipping service. They need an API that supports 500 req/s, is easy to integrate, and has clear documentation for the 30 partners who will consume it.
Customize these fields first
Replace the placeholders with your own context before you run the prompt. That usually improves the first output more than adding more instructions later.
Prompt
Design a complete REST API for [PROJECT NAME], a [TYPE: SaaS/marketplace/fintech] built with [NODE.JS + EXPRESS/FASTIFY/NESTJS] and [POSTGRESQL/MYSQL].\\\\\\\\n\\\\\\\\n**Context:**\\\\\\\\n- Main resources: [LIST OF ENTITIES: users, orders, products, etc.]\\\\\\\\n- Consumers: [FRONTEND SPA, MOBILE APP, EXTERNAL PARTNERS]\\\\\\\\n- Expected volume: [NUMBER] requests/second\\\\\\\\n- Authentication: [JWT/API KEY/OAUTH2]\\\\\\\\n\\\\\\\\n**1) Conventions and Naming:**\\\\\\\\n- URL structure (plural, kebab-case, hierarchy)\\\\\\\\n- HTTP methods per operation (GET, POST, PUT, PATCH, DELETE)\\\\\\\\n- Standardized status codes (success, client error, server error)\\\\\\\\n- Standard response format: \\\\\\\\\\\\\\\\\\\\\\\`{ data, meta, errors }\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\n- Error envelope: \\\\\\\\\\\\\\\\\\\\\\\`{ code, message, details, timestamp }\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\n\\\\\\\\n**2) Versioning:**\\\\\\\\n- Strategy: URL path (/v1/) vs. header vs. query param β recommend and justify\\\\\\\\n- Deprecation policy (timeline, warning headers)\\\\\\\\n- Backward compatibility maintenance\\\\\\\\n\\\\\\\\n**3) Pagination, Filtering, and Sorting:**\\\\\\\\n- Cursor-based pagination (for feeds) vs. offset (for tables)\\\\\\\\n- Filters via query params: \\\\\\\\\\\\\\\\\\\\\\\`?status=active&created_after=2026-01-01\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\n- Sorting: \\\\\\\\\\\\\\\\\\\\\\\`?sort=-created_at,name\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\n- Partial fields: \\\\\\\\\\\\\\\\\\\\\\\`?fields=id,name,email\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\n- Meta response: \\\\\\\\\\\\\\\\\\\\\\\`{ total, page, per_page, next_cursor }\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\n\\\\\\\\n**4) Authentication and Authorization:**\\\\\\\\n- JWT authentication flow (access + refresh tokens)\\\\\\\\n- Role-based authorization middleware (admin, user, partner)\\\\\\\\n- Rate limiting by API key (tiers: free, pro, enterprise)\\\\\\\\n- CORS configuration per environment\\\\\\\\n\\\\\\\\n**5) OpenAPI 3.1 Documentation:**\\\\\\\\n- Schema for each endpoint with examples\\\\\\\\n- Typed request/response models\\\\\\\\n- Documented authentication (securitySchemes)\\\\\\\\n- Auto-generation with Swagger UI\\\\\\\\n- Exported Postman collection\\\\\\\\n\\\\\\\\nInclude complete examples for [MAIN RESOURCE] endpoints (CRUD + search + custom actions).Open directly in an AI β the text is pre-filled:
How to use this prompt
- 1Replace the key placeholders first: PROJECT NAME, TYPE: SaaS/marketplace/fintech, NODE.JS + EXPRESS/FASTIFY/NESTJS, POSTGRESQL/MYSQL.
- 2Replace any bracketed placeholders like [this] with your own context.
- 3Add extra background information when you want more tailored results.
- 4Combine multiple prompts in one conversation when you need a richer output.
- 5Save your best-performing prompts so they are easy to reuse later.
Next best step
Open the guide first, then branch only if you still need more.
A guide for technical builders choosing between prompts, coding workflows, and agent-based implementation.
If this prompt is close but not quite right, generate variants next. If the job is recurring, move into the course library after the guide.
Related prompts
View allPostgreSQL Query Optimization and Indexing Strategy
Database performance diagnosis with slow query analysis and index planning.
Best for
Identify and resolve PostgreSQL performance bottlenecks through query plan analysis, strategic index creation, and query refactoring.
Complete Authentication System with JWT, Refresh Tokens, and RBAC
Secure authentication and authorization implementation with rotating tokens and role-based access control.
Best for
Build a robust authentication and authorization system that protects the API against common attacks and implements granular permission control.
Monolith to Microservices Migration with Event-Driven Architecture
Decomposition strategy for a Node.js monolith into microservices with asynchronous message-based communication.
Best for
Plan and execute a gradual migration from monolith to microservices without service interruption, using asynchronous communication patterns with message queues.
Multi-Layer Caching Strategy with Redis and CDN
Multi-layer cache implementation to reduce latency and infrastructure costs.
Best for
Design a caching strategy that reduces database load by 80%+ and improves API response time to under 50ms on the most accessed endpoints.
Explore other prompt categories
Move sideways into adjacent libraries when the current category is not the full answer.
Free browsing stays open. Premium prompts unlock the reusable workflow layer.
Use the guides and role paths to validate the job first. Upgrade when you want the full prompt text, editable premium prompts, and the surrounding course paths in one place.
Free access
- Browse guides, role paths, and category pages.
- Preview prompts before you decide to upgrade.
- Find the right starting point without friction.
Membership access
- Unlock premium prompts and the full copy text.
- See more workflow paths and course connections.
- Keep the reusable templates in one place.