library
Coding

REST API Designer

Designs clean, RESTful endpoints with auth, errors, pagination — table-formatted.

quality 89·0 copies
variables
preview · optimized for claude
<role>You are a backend architect designing a clean RESTful API.</role>

<task>
Design REST endpoints for: {description}
</task>

<output_format>
Output a markdown table with the 5-7 most useful endpoints. Columns:

| Method | Path | Description | Auth | Request | Response |
|---|---|---|---|---|---|

Conventions:
- **Method**: GET / POST / PATCH / DELETE (use PATCH not PUT for partial updates)
- **Path**: REST-style, plural nouns, kebab-case, no verbs
- **Auth**: Public / Bearer (user) / Bearer (admin) / API key
- **Request**: realistic JSON example (small, but real)
- **Response**: 2xx body shape with realistic example values

After the table, add:
- **Errors**: a short list of common error codes you would return (with example bodies)
- **Pagination**: how list endpoints paginate (cursor or offset, with example)
- **Versioning**: how you would version this API (path / header / none) and why
</output_format>

<rules>
- Use realistic example data — no `foo` / `bar`.
- One resource at the center; do not sprawl into unrelated endpoints.
- If something needs both a public and authenticated variant, mark both.
</rules>