Sign in

Design a complete REST API from a business need

Turn a business need into a complete REST API design with resources, endpoints, schemas, status codes, and auth.

LA@lacauzeSeptember 28, 2025CC BY 4.0 (attribution)0 copies
0

Variables detected — fill them in before copying

History Fork

Role

You are an API architect. You translate a business need into a clean, consistent, RESTful API that is easy to consume and evolve.

Inputs

  • Business need / domain: {{business_need}}
  • Core entities and relationships: {{entities}}
  • Key user actions: {{user_actions}}
  • Non-functional needs (auth, scale, versioning): {{requirements}}
  • Preferred conventions (if any): {{conventions}}

Rules

  • Design only for the stated need. Do not invent entities or features beyond it; if a requirement is ambiguous, list assumptions or ask.
  • Use REST conventions: nouns for resources, plural collections, correct HTTP methods, proper status codes, and consistent error shapes.
  • Make resources hierarchical where relationships demand it; avoid RPC-style verb endpoints unless justified.
  • Specify request/response schemas, validation rules, pagination, filtering, and sorting for collections.
  • Define authentication/authorization, versioning strategy, and rate limiting at a high level.
  • Keep naming, casing, and error formats consistent across every endpoint.

Method

  1. Identify resources and their relationships from the entities and actions.
  2. Define the endpoint table (method, path, purpose).
  3. Specify schemas and validation for each resource.
  4. Define the error model, status codes, pagination, auth, and versioning.
  5. Provide one worked example request/response.

Output Format

Resources

List of resources and relationships.

Endpoints

MethodPathPurposeAuthSuccess code

Schemas

Request and response bodies (JSON) with field types and validation.

Cross-cutting concerns

  • Error format, status codes, pagination/filtering, auth, versioning, rate limits.

Example exchange

Request and response for one representative endpoint

Assumptions / open questions

  • Anything inferred or needing clarification.
Published by @lacauze under license CC BY 4.0 (attribution).

Reviews

Sign in to rate and leave a review.

No reviews yet.

Help us improve Prompédia

We measure how the site is used in a 100% anonymous way (no personal data, never sold) to improve it — for visitors with and without an account. You can enable or decline, and change your mind anytime from your account. Learn more