Backend · Claude Prompt

API Designer

Designs RESTful APIs with proper resource naming, status codes, and error handling patterns.

What it does

The API Designer prompt turns a domain description into a complete API design: resource model, endpoint list, request/response schemas, status codes, pagination conventions, and versioning strategy.

What it solves

Most APIs ship with inconsistent error envelopes, verbs in URLs, and status codes chosen by vibes. This prompt enforces RESTful conventions up front so you never have to introduce a "/v2" to fix a naming mistake.

How to install

Which tool are you using?

Not sure? Claude.ai is the website. Claude Code is the command-line tool you install separately. Cursor is a code editor that reads .cursorrules.

  1. 01

    Copy the prompt

    Click the Copy button on the code block below to grab the full prompt text.

  2. 02

    Paste into a new Claude chat

    Open claude.ai or Claude Code and paste the prompt as the first message.

  3. 03

    Fill in the bracketed placeholder

    Replace [PASTE YOUR ... HERE] with your actual input before sending.

  4. 04

    Iterate on the output

    Claude's first response is usually 80% there. Ask for specific refinements — "make section 4 more concrete", "shorten section 7" — instead of regenerating from scratch.

The claude prompt file

Copy the full contents below, or download the file directly.

api-designer.txt
api-designer.txt
You are a RESTful API designer who prioritizes long-term maintainability over short-term convenience. When I describe a domain, design the API for it. Deliver:1. Resource model — nouns, relationships, IDs2. Endpoint list — method, path, purpose, auth3. Request / response schemas for every endpoint4. Status codes per endpoint (including errors)5. Pagination / filtering / sorting conventions6. Versioning strategy7. Rate limiting and auth headers Rules:- Plural nouns, lowercase, hyphen-separated- No verbs in paths (use HTTP methods)- Consistent error envelope: { code, message, details? }- All timestamps ISO 8601 UTC- IDs are strings Domain to design:[DESCRIBE YOUR DOMAIN HERE]

Example output

What Claude does before and after you install this claude prompt.

Without this claude prompt

Claude returns a mix of POST /createUser, GET /getUserById, with inconsistent error shapes. Unmaintainable.

With this claude prompt

Claude returns POST /users, GET /users/{id}, PATCH /users/{id}, with consistent { code, message } errors, cursor pagination, and a clear versioning policy.

Customization tips

For GraphQL, swap the endpoint list for queries, mutations, and subscriptions and update the conventions section. For internal-only APIs, drop the versioning section and add an "Internal stability" note. Teams that use a specific error taxonomy (e.g. Problem+JSON) should edit the error envelope rule.

Related resources

Frequently asked questions

Does it cover GraphQL?

By default it is REST. Edit the prompt for GraphQL specifics.

Does it do authentication design?

It references auth headers and scopes but not the full auth flow.

Can it import my existing API?

Paste your current endpoints and ask for a refactor proposal.

Does it enforce OpenAPI?

Not directly, but the output is compatible with OpenAPI.

Does it design the database too?

No — it stays at the API layer. Pair with the Tech Stack Advisor for schema design.

Want more like this?

Browse the full RohanKit library — free resources for Claude and Cursor.

Back to RohanKit