Skip to content
O Opemipo Jokotagba
API Documentation Technical Writing Developer Experience

Writing API Documentation That Developers Actually Read

Most API docs are technically complete but practically useless. Here's the framework I use to write reference documentation that developers trust and return to.

O

Opemipo Jokotagba

2 min read

Most API documentation is written for an imaginary reader: a developer who arrives already knowing what they want to do, who has unlimited patience for scrolling, and who doesn’t mind if half the code examples don’t actually run.

Real developers are different. They’re in the middle of something. They’re debugging. They’re trying to make one specific thing work before their next meeting. They need documentation that gets out of the way and gives them what they need — fast.

Here’s the framework I’ve developed for writing API documentation that earns that trust.

Start with the task, not the endpoint

The most common failure mode in API documentation is organizing everything around the API’s structure — endpoints grouped by resource type, documented in alphabetical order — rather than around what a developer is trying to accomplish.

The internal architecture of an API is the least interesting thing about it to the person integrating with it.

Before I write a single endpoint, I ask:

  1. What are the 3–5 things most developers will do first? These become your quickstart guide.
  2. What are the 3–5 things that trip people up? These become your troubleshooting section and your error reference.
  3. What does a successful integration actually look like? This becomes your end-to-end tutorial.

The reference documentation — the endpoint-by-endpoint detail — comes after this foundation, not before.

Every code sample must run

This sounds obvious. It isn’t practiced nearly enough.

Code samples are load-bearing. A developer who finds your “Create an account” example and copies it into their project is making an implicit contract with you: that what’s in the docs reflects what the API actually does. Break that contract once — with an outdated parameter name, a missing required field, a response shape that changed six months ago — and you’ve lost them.

My rule: every code sample I publish has been run against the actual API. Not mocked. Not eyeballed. Actually run, with actual credentials, producing actual output.

For a banking API like Woodcore, this means building real test integrations. It adds time. It surfaces bugs. It’s non-negotiable.

When you test your own examples, two things happen: you find the ones that are wrong (and there are always some), and you write significantly better error-handling examples because you’ve actually seen the errors.

Write the unhappy path

Most API docs cover the happy path thoroughly and the unhappy path barely at all. This is backwards from what developers actually need.

When an integration is working, developers don’t read the docs — they’re coding. They read the docs when something breaks. So the documentation that gets the most use under the most stress is the error reference, the debugging guide, and the edge case notes.

For each endpoint, I document:

  • What success looks like — the 200 response with a real example payload, not a schema diagram
  • What the common errors mean — not just the status code and message, but why this error happens and how to fix it
  • What the silent failures look like — the 200 responses that technically succeed but indicate something the developer might not have intended

That last category is the hardest to write and the most valuable. It requires actually understanding the domain, not just transcribing the spec.

Use real values in your examples

Placeholder values in code samples are a subtle form of documentation debt.

{
  "account_id": "string",
  "amount": 0,
  "currency": "string"
}

This is a schema, not an example. When a developer looks at this, they have to mentally translate it into real values before they can use it. That translation introduces friction and mistakes.

Compare:

{
  "account_id": "acct_01HXYZ9K3MBNQ7V2T8A",
  "amount": 5000,
  "currency": "NGN"
}

Now they can copy this directly, change the values they care about, and move on. The example communicates the format, the type, and the conventions all at once — without a word of prose.

Use realistic-looking IDs (matching the actual format your API generates), realistic amounts, real currency codes. The closer the example looks to what a developer will actually see, the less cognitive overhead they carry.

Put context before syntax

Every endpoint reference page should answer one question before it shows any code: why would I call this?

Not every developer arrives at an endpoint knowing what it’s for. Even developers who do know might not know when to use it versus a related endpoint. A single sentence of context — “Use this endpoint to create a new ledger account within an existing wallet. To create a wallet first, see [Create wallet].” — saves a lot of trial-and-error navigation.

The sequence I follow for every endpoint:

  1. One-sentence description of what this endpoint does and why you’d use it
  2. Note any prerequisites, side effects, or ordering requirements
  3. Request example (with real values, as above)
  4. Response example
  5. Parameter reference (with type, required/optional, and a sentence on what each one means)
  6. Error reference for the errors specific to this endpoint
  7. Links to related endpoints

This is more structure than most API docs have. The structure is the point — it makes every page predictable, so developers stop reading and start scanning.

The trust flywheel

Good API documentation is self-reinforcing. When developers trust the docs — because the examples run, because the errors are explained, because the content is accurate — they use the docs more. They refer colleagues to the docs. They report issues when something is wrong instead of giving up.

When they don’t trust the docs, they ask the support team. They post in the community forum. They copy someone else’s workaround from Stack Overflow and don’t understand why it works.

The difference between those two outcomes is almost entirely a documentation quality question.

Writing API documentation that developers actually read isn’t about writing more — it’s about writing the right things, in the right order, with verified examples. The signal that you’ve gotten it right isn’t “developers are reading the docs.” It’s “developers are succeeding with the product.”

Back to Blog
Share:

Related Posts

Why I Test Every Code Sample I Publish

Untested code samples are a liability disguised as documentation. Here's the process I use to make sure every example in my docs actually runs.

O Opemipo Jokotagba
2 min read
Technical Writing Code Quality Developer Experience

How I Built My Portfolio: Every Decision, Every Change

A full breakdown of how I took an Astro 6 template and turned it into a production portfolio — covering identity, content, tooling, SVG banners, deployment, and the AI-augmented workflow behind it.

O Opemipo Jokotagba
2 min read
Docs Engineering Astro Developer Experience

What Does a Docs Engineer Actually Do?

The role sits between writing and software engineering — here's what that looks like in practice, and why it matters for developer-facing products.

O Opemipo Jokotagba
2 min read
Docs Engineering Career Technical Writing

Follow along

Stay in the loop — new articles, thoughts, and updates.