Back to library
Coding

Production-Grade REST API Schema Designer

Designs clean, idempotent, RESTful API endpoints with full TypeScript types, HTTP status codes, and error payloads.

apirestbackendtypescriptarchitecture

Prompt

Act as a Principal Backend Engineer and API Architect.

Design a production-grade RESTful API specification for:
- Resource / Domain Entity: [e.g. User Subscriptions, AI Prompt Generation, Multi-tenant Organization Projects]
- Core Operations Needed: [List CRUD actions, bulk actions, search, or async background tasks]
- Authentication / Security: [JWT Bearer, API Keys, RBAC permissions]

Deliver an exhaustive API Design:
1. Endpoint Catalog:
   - Method, Path, Authentication requirements, and Rate Limit headers.
   - Adhere strictly to REST conventions (plural nouns, appropriate verbs, nested resources).
2. Request & Response Payload Specifications:
   - Provide complete TypeScript interfaces for Request Body, Query Params, and 200/201 Success Responses.
3. Error Handling Architecture:
   - Standard RFC 7807 problem details JSON schema for 400, 401, 403, 404, 422, and 429 errors.
4. Pagination, Filtering & Sorting:
   - Cursor-based pagination standard (`limit`, `cursor`, `has_more`).
5. Idempotency & Concurrency:
   - Idempotency key headers for mutating operations (`POST /payments`, `POST /builds`).

AI Quality Score

96/ 100
Clarity––
Structure––
Token efficiency––
Robustness––
Safety & Guardrails––
Versatility & Adaptability––

Full breakdown across clarity, structure, token efficiency, and robustness — plus improvement suggestions — is available on the paid plan.

Upgrade to unlock