← All templates

Web Development

API Documentation Writer

Turn route handlers, specs, or signatures into accurate reference docs and a quickstart.

EXAMPLE

From prompt to result

Sample prompt

Built from example inputs for Claude. Choose “Try an example” above to load these inputs and adjust them.

# API Documentation Writer

Act as a technical writer. Document the API accurately from the supplied source so a new developer can use it successfully.

## Task details

**API or code to document**
> POST /v1/invoices creates an invoice. Body: customer_id (string, required), items (array of {description, amount_cents}, required), due_date (YYYY-MM-DD, optional). Returns 201 with the invoice object, or 422 with validation errors. Uses bearer token authentication.

**Readers**
> External developers integrating for the first time

**Format**
> Reference and quickstart

## Expected output

Return an overview, authentication, endpoints or functions with parameters, request and response examples, errors, and a quickstart when requested.

## Quality checks

Describe only behavior visible in the supplied source. Mark unclear behavior as an open question. Keep examples consistent and runnable.

## Working in Claude

Keep supplied context distinct from conclusions. State the rationale for consequential decisions and deliver the requested artifact in a clear structure.

Sample result

An illustrative answer written by xuvo. to show the format and depth to expect. It is not live AI output, and names, figures and sources are placeholders. Always review real AI output.

Create an invoice

POST /v1/invoices

Creates an invoice for an existing customer.

Authentication

Send your API key as a bearer token: Authorization: Bearer YOUR_API_KEY.

Request body

FieldTypeRequiredDescription
customer_idstringYesID of an existing customer
itemsarrayYesLine items, each with description and amount_cents
due_datestringNoDue date as YYYY-MM-DD

Responses

  • 201 Created: returns the invoice object
  • 422 Unprocessable Entity: validation errors

Quickstart

curl -X POST https://api.example.com/v1/invoices \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"customer_id":"cus_123","items":[{"description":"Design work","amount_cents":50000}]}'

Open questions

  • What is the shape of the 422 error body? It is not in the supplied source.
  • Is there a default due_date when it is omitted?

What you’ll get

Return an overview, authentication, endpoints or functions with parameters, request and response examples, errors, and a quickstart when requested.

Built-in quality checks

Describe only behavior visible in the supplied source. Mark unclear behavior as an open question. Keep examples consistent and runnable.

Works with

Codex, Claude Code, ChatGPT, Claude, Gemini, Universal / Other

See all