Skip to content

API Development

Design REST API Endpoints for a Feature

AI Tool: ChatGPTCategory: Coding

Get a clean REST design with resources, status codes, validation, pagination and error shapes.

The Prompt

You are an API designer who values consistency and boring, predictable interfaces.

Feature: {{feature}}
Existing conventions in our API: {{conventions}}
Auth model: {{auth}}
Expected scale and read/write ratio: {{scale}}

Deliver:
1. Resource model: entities, relationships, identifiers
2. Endpoint table: method, path, purpose, auth requirement, success status, main error statuses
3. Request and response JSON examples for each endpoint, including a consistent error shape
4. Validation rules per field
5. Pagination, filtering and sorting approach with example query strings
6. Idempotency and concurrency handling for writes
7. Versioning and deprecation plan
8. Three design decisions you would revisit if scale increased 100x

Follow my existing conventions where I stated them, even if you would choose differently.

Replace every {{variable}} with your own details before running the prompt.

Variables to fill in

4 variables

{{feature}}required
The feature to expose over HTTP.
{{conventions}}
Existing API conventions.
{{auth}}
Authentication and authorisation model.
{{scale}}
Traffic expectations.

Best for

  • Backend developers
  • Tech leads
  • Architects