API documentation template
A free API documentation template: overview, authentication, quickstart, errors, pagination, rate limits, webhooks and an endpoint reference format with request and response examples.
- Best for
- SaaS teams with a public or partner API, platform teams documenting internal APIs
- Length
- A guide section plus one page per resource
- Sections
- 9
Good API docs have two layers. Guides explain concepts and get someone to their first successful request. Reference lists every endpoint, parameter and response so nobody has to guess.
This template gives you both. The examples use a fictional analytics API from Harbor Analytics; swap in your own resources.
Tip. Generate the endpoint reference from your OpenAPI file and write the guides by hand. Reference is what changes most; guides are what people read first.
01
Overview
What the API lets developers do, the base URL, the format (JSON over HTTPS) and the versioning scheme. Three or four sentences.
textBase URL: https://api.harbor-analytics.com/v2 Format: JSON over HTTPS, UTF-8 Version: set in the path; v1 is supported until 2027-06-3002
Authentication
How to get a key, where it goes in the request and how to keep it safe. Show the exact header. Say what scopes exist and what a 401 and a 403 mean.
bashcurl https://api.harbor-analytics.com/v2/projects \ -H "Authorization: Bearer $HARBOR_API_KEY"03
Quickstart
One complete task in five minutes or less: create a key, make a request, read the response. Use a real endpoint and show the real response, trimmed.
- Create an API key in Settings, then API keys
- Export it as an environment variable
- Call GET /projects and read the id of your first project
- Send one event to POST /events and see it in the dashboard
04
Errors
One error format used everywhere, a table of status codes and what to do about each, and a list of the error codes your API returns. Developers search this page more than any other.
json{ "error": { "code": "project_not_found", "message": "No project with id prj_8f2k exists in this workspace.", "request_id": "req_01HF3Z9Q" } }05
Pagination
Say which style you use (cursor or offset), the parameter names, the default and maximum page size, and how to tell that you reached the last page.
textGET /v2/events?limit=100&starting_after=evt_7Hk2 # response includes "has_more": true, "next_cursor": "evt_9Lp4"06
Rate limits
The limits per key, the headers that report usage, what happens when a client goes over (usually a 429 with Retry-After) and the recommended retry strategy.
- Requests per minute per key
- X-RateLimit-Remaining and X-RateLimit-Reset headers
- 429 responses include Retry-After in seconds
- Retry with exponential backoff and jitter
07
Webhooks
Which events you send, the payload shape, how to verify the signature, the retry schedule and how to replay a delivery. Include a verification snippet in at least one language.
08
Endpoint reference
One entry per endpoint with the same layout every time: method and path, a one-line description, parameters with types and whether they are required, an example request, an example response, and the errors it can return.
markdown## Create a project POST /v2/projects | Field | Type | Required | Description | |----------|--------|----------|------------------------| | name | string | yes | Shown in the dashboard | | timezone | string | no | IANA name, default UTC | Returns 201 with the project object. Errors: 400 invalid_timezone, 409 name_taken09
Changelog and deprecations
Dated entries for every change that a client might notice, with breaking changes marked clearly and a migration note. State your deprecation policy (for example, twelve months notice).
Mistakes to avoid
- Examples that do not run because they use a field that was renamed two versions ago.
- Errors documented as only a status code, with no error code or message format.
- Reference written by hand and slowly drifting away from the real API.
- Authentication explained after the endpoint reference, so new readers fail on the first call.
- No changelog, so integrators learn about breaking changes from their own alerts.
Questions about this template
- Should I write reference docs by hand?
- No. Generate them from an OpenAPI or similar spec so they change when the API changes. Spend the writing time on guides, examples and error explanations.
- Which languages should code examples cover?
- curl plus the two or three languages most of your customers use, often JavaScript and Python. Keep every example runnable and test them in CI if you can.
- Where do I document internal APIs?
- In the same tool as public ones, behind access control. Signcodify supports private pages and roles, so partner and internal reference can live next to public docs.
Last updated October 30, 2026
Suggest an editUse this template in Signcodify
It opens in the block editor with every section above in place. Sync it to your repository or publish it to your docs site.