Template

API Documentation Template

A clear structure for documenting a REST API, with authentication, endpoints, parameters, example requests and responses, errors and rate limits.

Updated November 19, 2026In Web & DevelopmentFree download: Markdown, Word, PDF

Download this template free

No sign-up needed. Word and Excel files also open in Google Docs, Google Sheets and Apple Pages/Numbers. Letter size (8.5 × 11 in).

[API Name] Documentation

Version [v1] · Last updated [date]

Overview

[What the API does and who it is for.]

Base URL[https://api.example.com/v1]
FormatJSON
Support[email or link]

Authentication

[Describe how to get and use credentials, e.g. send your API key in the Authorization header.]

Authorization: Bearer [YOUR_API_KEY]

Endpoint: [List items]

GET /[items]

[Short description of what the endpoint returns.]

Query parameters
NameTypeRequiredDescription
limitintegerNo[Number of results to return (default 20, max 100)]
cursorstringNo[Cursor for the next page of results]

Example request

curl https://api.example.com/v1/[items]?limit=2 \
  -H "Authorization: Bearer [YOUR_API_KEY]"

Example response (200 OK)

{
  "data": [
    { "id": "itm_123", "name": "[Example]", "created_at": "2027-03-01T12:00:00Z" }
  ],
  "next_cursor": "[abc123]"
}

Endpoint: [Create item]

POST /[items]
Body parameters
NameTypeRequiredDescription
namestringYes[Description]

Errors

Status codeMeaningWhat to do
400Bad requestCheck required fields and formats
401UnauthorizedCheck your API key
403ForbiddenYour key lacks permission for this action
404Not foundCheck the resource ID or URL
429Too many requestsSlow down; retry after the time in the Retry-After header
500Server errorRetry later; contact support if it continues

Rate limits

[e.g. 100 requests per minute per API key. Limits are returned in X-RateLimit headers.]

Changelog

DateVersionChange

Preview of the template. Highlighted [brackets] show text to replace.

How to document your API

  1. Start with a quick overview of what the API does, plus the base URL.
  2. Explain authentication first. It is the first thing every developer needs.
  3. Document each endpoint consistently: method and path, description, parameters, an example request and an example response.
  4. Use realistic examples that developers can copy and run.
  5. List every error code with guidance on what to do.
  6. State rate limits and versioning clearly.
  7. Keep a changelog so integrators know what has changed.

Tips for great API docs

  • Show, don’t just tell. Copy-and-paste curl examples help developers get a first successful call in minutes.
  • Document edge cases, such as empty results, pagination and maximum values.
  • Be consistent in naming, date formats (ISO 8601) and response shapes.
  • Never include real API keys or customer data in examples.
  • Test your examples to make sure they actually work.

Pair your API docs with a clear README for the repository.

Frequently asked questions

What should API documentation include?

An overview, base URL, authentication instructions, a reference for each endpoint (method, path, parameters, example request and response), error codes, rate limits, versioning and a changelog. Quick-start guides and SDK examples are valuable extras.

Should I use OpenAPI instead of writing docs by hand?

For larger APIs, an OpenAPI (formerly Swagger) specification is the standard. It can generate interactive reference docs automatically. This template is ideal for small APIs, internal services or as a structure for the human-written guides that accompany an OpenAPI reference.

How do I keep API docs up to date?

Keep docs in the same repository as the code, update them in the same pull request as API changes, and record changes in a changelog.

Related templates and guides