By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
For aspiring technical writers, developers transitioning into writing, and current writers modernizing their skills
API reference documentation is the detailed, structured manual for developers using an API. It lists every endpoint (e.g., GET /users), describes parameters (e.g., ?limit=10), explains responses (e.g., 200 OK with a JSON payload), and provides runnable code samples (e.g., curl, Python, JavaScript). Without clear API docs, developers waste hours guessing how to integrate—imagine trying to use Stripe’s payment API without knowing which endpoint charges a credit card or what fields are required.
GET /users
?limit=10
200 OK
curl
Real-world example:Stripe’s API reference shows: - Endpoint: POST /v1/charges - Parameters: amount, currency, source - Response: 200 (success) or 402 (failed payment) - Code samples in 7 languages.
POST /v1/charges
amount
currency
source
200
402
OpenAPI (formerly Swagger): A machine-readable spec (YAML/JSON) that describes REST APIs. Tools like Swagger UI or ReDoc auto-generate interactive docs from it. Example: Petstore OpenAPI spec.
Docs-as-Code: Treating docs like code—stored in Git, written in Markdown/AsciiDoc, built with static site generators (e.g., Sphinx, Docusaurus), and reviewed via pull requests.
Endpoint: A URL path (e.g., /users/{id}) that performs an action (GET, POST, PUT, DELETE). Think of it as a "door" to a specific API feature.
/users/{id}
Parameters: Inputs passed to an endpoint (e.g., query params ?sort=asc, path params /users/{id}, headers Authorization: Bearer token, or request body JSON).
?sort=asc
Authorization: Bearer token
Response Schema: The structure of the API’s output (e.g., {"id": "123", "name": "Alice"}). Defined in JSON Schema or OpenAPI.
{"id": "123", "name": "Alice"}
Code Samples: Snippets in languages like curl, Python, JavaScript, or Go that show exactly how to call the API. Example: bash curl -X POST https://api.example.com/users \ -H "Authorization: Bearer token" \ -d '{"name": "Alice"}'
bash curl -X POST https://api.example.com/users \ -H "Authorization: Bearer token" \ -d '{"name": "Alice"}'
Status Codes: HTTP responses like 200 OK (success), 404 Not Found (missing resource), or 429 Too Many Requests (rate-limited). Always document these!
404 Not Found
429 Too Many Requests
Authentication: How users prove their identity (e.g., API keys, OAuth2, JWT). Example: Stripe uses Authorization: Bearer sk_test_....
Authorization: Bearer sk_test_...
SDKs (Software Development Kits): Language-specific libraries (e.g., stripe-python) that wrap API calls. Docs should link to SDKs if they exist.
stripe-python
Postman/Newman: Tools for testing APIs and auto-generating docs. Postman collections can export to OpenAPI.
DITA (Darwin Information Typing Architecture): An XML-based standard for modular docs (used in enterprise). Less common for APIs but useful for reusable content (e.g., error message tables).
Static Site Generators (SSGs): Tools like Docusaurus, MkDocs, or Sphinx that build fast, version-controlled docs from Markdown. Example: GitHub’s API docs use Docusaurus.
Follow this workflow to create accurate, usable API docs:
routes/users.js
Talk to developers: "What are the most common use cases? What errors do users hit?"
Test the endpoint manually
bash curl -X GET https://api.example.com/users/1
Verify responses match the spec. If not, file a bug or update the docs.
Draft the resource description
404
Use active voice and present tense (e.g., "Returns a user object" vs. "This endpoint will return...").
Document parameters and responses
id
"abc123"
Responses: Include status codes, schemas, and examples. Example: json { "id": "abc123", "name": "Alice", "email": "[email protected]" }
json { "id": "abc123", "name": "Alice", "email": "[email protected]" }
Add code samples
python import requests response = requests.get( "https://api.example.com/users/1", headers={"Authorization": "Bearer token"} ) print(response.json())
Use realistic values (e.g., "abc123" instead of "id").
"id"
Submit for developer review
Use GitHub/GitLab comments to discuss changes.
Automate (if possible)
POST /users
201 Created
status
401 Unauthorized
422 Unprocessable Entity
X-API-Key
A well-tested but ugly API doc beats a beautiful but wrong one. Show you verify endpoints (e.g., screenshots of Postman tests in your portfolio).
Distinguishing reference vs. guides
Tricky distinction: A tutorial teaches concepts by building (e.g., "Build a Weather App with Our API"), while a how-to solves a specific problem (e.g., "How to Handle Rate Limits").
Tool proficiency
Example: "I used Docusaurus for the doc site and Swagger UI for interactive API exploration."
Portfolio projects
/orders
main
Why: Manual updates are error-prone; automation ensures accuracy.
You’re documenting a POST /orders endpoint. The API returns 201 Created on success but the spec says 200 OK. What do you do?
POST /orders
201
Why: The code’s behavior is the source of truth, not the spec.
A junior writer asks: "Should I document every possible error response?" How do you respond?
422 Validation Failed
components/schemas
definitions
|---|---|
markdown | Param | Type | Required | |-------|--------|----------| | id | string | Yes |
400
401
403
429
500
try/catch
npm run start
"status: active | inactive | pending"
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.