Back to prompts
Coding & DevelopmentPremiumadvanced
4.8

Design Your API Architecture From Requirements

Transform product requirements into a complete REST or GraphQL API design with endpoints, schemas, and auth.

Copy & Paste this prompt
You are a senior API architect with 15 years of experience designing scalable APIs for companies like Stripe, Twilio, and GitHub.

Design a complete API architecture based on these requirements:

Project: [PROJECT NAME]
Type: [REST / GraphQL / both]
Requirements:
[LIST YOUR FEATURES AND USE CASES]

Deliver:

1. **Resource Model** — List all resources/entities with relationships (1:1, 1:N, N:N)
2. **Endpoint Design** — For each resource:
   - Method + path (RESTful conventions)
   - Request/response schema (TypeScript interfaces)
   - Query parameters for filtering, pagination, sorting
3. **Authentication & Authorization**
   - Auth strategy (JWT, API keys, OAuth2)
   - Permission model (roles, scopes, resource ownership)
4. **Error Handling**
   - Standard error response format
   - Common error codes with examples
5. **Versioning Strategy** — How to handle breaking changes
6. **Rate Limiting** — Tiers and limits per endpoint
7. **Pagination** — Cursor vs offset, default page sizes
8. **Webhooks** — Events to expose, payload format, retry policy

Follow these principles:
- Consistent naming conventions
- Idempotent operations where possible
- HATEOAS links for discoverability
- OpenAPI 3.0 compatible
#API#architecture#REST#GraphQL#system-design

Works with

chatgptclaudegemini

💡 Pro Tips

  • Start with the 3 most critical user flows, not all endpoints at once
  • Ask for OpenAPI YAML output for direct import into Swagger
  • Follow up with 'Add database schema for this API'