How to Write technical documentations with examples

Emmanuel Mumba

Emmanuel Mumba

9 June 2025

How to Write technical documentations with examples

Think of technical docs as the handshake between the people building the product and the folks using it. Whether you’re writing API guides, user manuals, or onboarding instructions for new team members, keeping things clear and simple makes life way easier for everyone involved. Nobody wants to dig through confusing or incomplete docs when they just want to get stuff done. These days, good documentation isn’t just a nice-to-have — it’s basically a must-have if you want your product to actually get used and loved.

💡
Pro Tip: Before you dive into writing docs manually, try tools like Apidog. It auto-generates interactive API documentation from your OpenAPI/Swagger specs, helps you mock endpoints, and even validates your API responses — making technical writing faster and smarter.
button

In this guide, we’ll cover everything you need to write excellent technical documentation, even if you’re not a professional writer. We’ll also show you examples and templates to help you get started.


Why Technical Documentation Matters

Technical documentation serves multiple audiences — developers, designers, testers, users, stakeholders — and performs a range of functions:

A well-documented project doesn't just help users—it attracts contributors. In fact, GitHub data shows that projects with clear, thorough documentation receive significantly more engagement and pull requests from the developer community.

Types of Technical Documentation

There are different forms of technical documentation depending on the audience and use case:

1. API Documentation

Used by developers to understand how to integrate and interact with APIs. These documents include endpoints, parameters, response formats, status codes, examples, and usage notes.

Example: Stripe API documentation showcases endpoints for payments, responses with sample JSON, and real-time code samples in multiple languages.

2. User Manuals

Used by end-users to understand how to operate software or hardware products. These may be printed, digital, or embedded into the product.

Example: A desktop app might include a built-in help guide for first-time users that explains how to navigate the interface.

3. Developer Guides

These documents explain setup, configuration, and architecture to help engineers understand how the system works internally.

Example: Onboarding docs for new developers that include repo structure, CI/CD processes, and common development workflows.

4. System Architecture Docs

These are internal documents outlining how different systems interact. They include diagrams, protocols, and third-party service details.

Example: A document showing how microservices communicate over Kafka and which team owns each part.

5. Release Notes & Changelogs

Short descriptions of updates, fixes, and features shipped in each release. These are crucial for users and internal QA teams.

Example: “Version 1.2.3 – Added dark mode, fixed login issue on Safari, and deprecated v1/login endpoint.”


How to Write Great Technical Documentation

Follow these steps to ensure clarity and usability:

1. Understand the Audience

Before writing anything, define who you're writing for. Developers? End-users? Non-technical stakeholders? Tailoring tone and structure to the audience increases effectiveness.

Do:

Don't:

2. Set the Scope and Goals

What should the reader be able to do after reading your doc? Are you explaining a feature or walking through an integration?

Example: “By the end of this guide, you’ll know how to authenticate users using OAuth2.”

3. Outline Before Writing

Start with a simple outline. Break it into sections:

This helps you maintain structure and avoid repeating content.

4. Write With Clarity and Brevity

Use simple, concise language. Avoid long paragraphs. Break complex ideas into bullet points or steps.

Tip: Write like you’re explaining it to your future self after 6 months away from the project.

5. Add Examples and Use Cases

Don’t just describe — show. Add copy-pasteable code, screenshots, and real-world scenarios.

Example:

curl -X POST <https://api.example.com/v1/user> \\
  -H 'Authorization: Bearer <token>' \\
  -d '{"name": "Jane Doe"}'

6. Use Consistent Formatting

Use consistent headings, fonts, code block styles, and link behavior. Markdown or doc platforms like Mintlify or ReadMe can help enforce this.

Tool tip: Use linters like Vale to enforce style guides.

7. Test Everything

Follow your documentation as if you were a new user. Confirm commands, links, and code samples actually work.

Don't: Publish without test-running all commands.

8. Include Troubleshooting Sections

Help readers solve common issues without contacting support.

Example:

Problem: Receiving a 401 Unauthorized error.
Fix: Check if your API token is expired or missing the Bearer prefix.

Common Mistakes in Technical Documentation (with examples)

Outdated Content:

Example:

# DON'T DO THIS: Old API endpoint
POST /v1/login

Instead, update to:

POST /v2/auth/login

Too Much Jargon:

Instead of:

"Authenticate users via OAuth 2.0 using implicit grant flow."

Write:

"Authenticate users by letting them log in using their existing accounts (like Google or Facebook). This uses OAuth 2.0, a secure way to allow access without sharing passwords."

No Examples:

Include code snippets:

curl -X POST <https://api.example.com/login> \\
     -H "Content-Type: application/json" \\
     -d '{"email": "user@example.com", "password": "mypassword"}'

Messy Formatting:

Use bullet points, headings, and code blocks to break text up.

Ignoring User Feedback:

Add a feedback section or link:

“Found a typo or want to suggest an improvement? Submit feedback here”

Best Practices for Technical Docs

Know Your Tools

Use documentation platforms that support versioning, feedback, and live previews. Popular options include:

Use Diagrams and Visuals

Sometimes a single diagram explains more than a page of text.

Keep It Up to Date

Outdated documentation is worse than no documentation. Make updates part of your release cycle.

Version Your Docs

For APIs or systems that change, document changes by version. Tools like Apidog or Bump help automate this.

Collaboration and Workflow Tips for Docs (with examples)

Version Control:

Use GitHub for docs:

git clone <https://github.com/yourproject/docs.git>
git checkout -b feature/update-auth-docs
# Make edits, commit, and create a pull request for review

Peer Reviews:

Include a checklist for reviewers:

Regular Updates:

Add this reminder in your project management tool:

“Docs update due for v1.3 release.”

Integrate Docs with Dev:

Use issue templates that prompt for doc updates when code changes:

### Does this PR require documentation updates?
- [ ] Yes
- [ ] No


More Examples: Error Messages and Troubleshooting

Explain the Error:

### Error: 401 Unauthorized
This error occurs when your API token is missing or invalid.

Provide Solutions:

### Fix
1. Check if your API token is expired.
2. Include the token in your request headers as:
   `Authorization: Bearer YOUR_TOKEN_HERE`

Step-by-Step Guide:

### Troubleshooting 401 Error
1. Verify your token is correctly copied.
2. Confirm your token has not expired (tokens last 24 hours).
3. Ensure your request includes the header:
   `Authorization: Bearer YOUR_TOKEN`
4. Retry the request.

Real-World Example: Documenting an OpenAPI Spec

Let’s say you’ve built a RESTful API for a basic authentication system with three endpoints: /login, /register, and /getUser. Below is an expanded and developer-friendly snippet of how great documentation might look.


🔹 Endpoint: POST /login

Description: Authenticates a user using email and password. Returns a JWT token if successful.

Request Headers:

Content-Type: application/json

Request Body:

{
  "email": "user@example.com",
  "password": "securePassword123"
}

Success Response:

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expires_in": 3600
}

Error Responses:

Example cURL Request:

curl -X POST <https://api.example.com/login> \\
  -H "Content-Type: application/json" \\
  -d '{"email": "user@example.com", "password": "securePassword123"}'


🔹 Endpoint: POST /register

Description: Registers a new user in the system.

Request Body:

{
  "email": "newuser@example.com",
  "password": "newUserPassword",
  "confirm_password": "newUserPassword"
}

Response:

{
  "message": "User registered successfully.",
  "user_id": "12345"
}

Errors:

Example cURL Request:

curl -X POST <https://api.example.com/register> \\
  -H "Content-Type: application/json" \\
  -d '{"email": "newuser@example.com", "password": "newUserPassword", "confirm_password": "newUserPassword"}'


🔹 Endpoint: GET /getUser

Description: Retrieves the current user’s profile using the auth token.

Headers:

Authorization: Bearer <your_token_here>

Response:

{
  "id": "12345",
  "email": "user@example.com",
  "created_at": "2025-06-01T12:34:56Z"
}

Errors:

Example cURL Request:

curl -X GET <https://api.example.com/getUser> \\
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."


Tools for Writing and Hosting Technical Docs


Conclusion

Writing excellent technical documentation is both an art and a science. By understanding your audience, following a structured process, and using real-world examples, you can create documentation that not only supports your users but enhances your product.

Clear docs reduce friction, build trust, and improve collaboration. Whether you're a developer, product manager, or technical writer, investing time into writing docs will pay dividends.

Explore more

REST API Pagination: An In-Depth Guide

REST API Pagination: An In-Depth Guide

In the world of modern application development, REST APIs serve as the fundamental communication layer, enabling disparate systems to exchange data seamlessly. As applications grow in scale and complexity, so does the volume of data they handle. Requesting an entire dataset, potentially containing millions or even billions of records, in a single API call is inefficient, unreliable, and a significant performance bottleneck. This is where a crucial technique in API design and development comes in

7 June 2025

How to Use the new Gemini 2.5 06-05 Pro API

How to Use the new Gemini 2.5 06-05 Pro API

Learn how to use the Gemini 2.5 06-05 Pro API in this technical guide. Set up, authenticate, and explore multimodal and coding features of Google’s powerful AI model. Perfect for developers building advanced apps!

6 June 2025

How to Use Deepseek R1 Locally with Cursor

How to Use Deepseek R1 Locally with Cursor

Learn how to set up and configure local DeepSeek R1 with Cursor IDE for private, cost-effective AI coding assistance.

4 June 2025

Practice API Design-first in Apidog

Discover an easier way to build and use APIs