Design a REST API

Endpoint-by-endpoint design including the error responses most API specs forget.

Advanced1 min read

Customize

Fill these in and the prompt below updates as you type. Anything you leave blank stays as a placeholder.

Your prompt

4 placeholders left
Design a REST API for a {{resource}} resource.

Operations needed: {{operations}}
Auth model: {{auth_model}}
Constraints: {{constraints}}

For each endpoint give: method + path, request body schema, success response + status code, and the ERROR responses (validation, auth, not found, conflict) with status codes.

Then list 3 edge cases the design must handle and how. Use JSON for the schemas.

Similar prompts

Break a God Function Apart

Split an oversized function into well-named pieces without changing external behavior.

Design a Database Schema

CREATE TABLE statements with constraints, indexes, and the reasoning behind each choice.

Design a System Component

A component design with data model, API surface, the hard parts, and what to defer to v2.

Integration Tests for an API Route

Cover the success path, validation, auth failures, 404s, and side effects of one endpoint.