Back to prompts
Coding & DevelopmentPremiumadvanced
4.8

RESTful API Design Architect

Design a complete, production-ready API from scratch — endpoints, auth, error handling, versioning, and documentation.

Copy & Paste this prompt
You are an API architect who has designed APIs serving millions of requests. Design a complete RESTful API for my project.

Project: [WHAT THE APP DOES]
Main resources: [LIST YOUR ENTITIES — e.g., users, products, orders]
Auth requirement: [PUBLIC / API KEY / JWT / OAUTH]
Scale expectation: [SMALL / MEDIUM / LARGE]

Design:

1. **RESOURCE MAPPING**
   - List all resources and their relationships
   - For each: CRUD operations needed
   - Nested vs flat resource structure decision

2. **ENDPOINT DESIGN**
   - Every endpoint with method, path, description
   - Request body schema (with types and validation rules)
   - Response body schema (with example JSON)
   - Query parameters for filtering, sorting, pagination
   - Follow REST conventions strictly

3. **AUTHENTICATION & AUTHORIZATION**
   - Auth flow diagram
   - Role-based access matrix (who can do what)
   - Token management (expiry, refresh, revocation)

4. **ERROR HANDLING**
   - Standard error response format
   - Error codes catalog (with HTTP status + custom codes)
   - Validation error format

5. **PRODUCTION CONSIDERATIONS**
   - Rate limiting strategy
   - Versioning approach (URL vs header)
   - Pagination strategy (cursor vs offset)
   - Caching headers
   - OpenAPI/Swagger spec skeleton

Output should be copy-paste ready for implementation.
#api-design#rest#backend#architecture#endpoints

Works with

chatgptclaudegemini

💡 Pro Tips

  • Start with 3-5 core resources, expand later
  • Always design error responses FIRST — clients depend on consistency
  • Use cursor-based pagination for large datasets

🧠 Why This Works

Well-designed REST APIs follow consistent conventions that make them intuitive to consume. This prompt applies REST maturity model principles, proper HTTP semantics, and real-world API design patterns to produce endpoints that developers love using.

📅 When to Use This Prompt

Use when designing a new REST API from scratch, when you need to standardize inconsistent endpoints across your service, or when building a public API and want to follow industry best practices like those of Stripe or GitHub.

🎯 What You'll Get

You'll receive a complete REST API specification with resource naming, HTTP method mapping, status code usage, pagination design, filtering/sorting parameters, authentication flow, and versioning strategy—with OpenAPI-compatible documentation.

🔗 Related Prompts

Coding & DevelopmentPremium

Database Schema Designer

Design a normalized, scalable database schema from a project description — tables, relationships, indexes, and queries.

databaseschema-designsql
4.8
advanced
Coding & DevelopmentPremium

System Design Interview Simulator

Practice system design interviews with a realistic AI interviewer — get architecture feedback, follow-up questions, and…

system-designinterviewarchitecture
4.9
advanced