Technical & ProductContent Creator

API documentation: a single-page reference for a small API

API documentation tells a developer which endpoints exist, what each one accepts and returns, how callers prove who they are, and what each error means. For a small API, one shareable page can cover all of that if every endpoint follows the same pattern and every example is one a developer could run as written. A larger API with many versions, a try-it console or a generated reference needs a dedicated docs platform.

Quality checklist

Check each endpoint before you share the page

  • Each endpoint shows its method, its full path and a one-line purpose that starts with a verb.
  • Every parameter lists its name, its type, whether it is required, and its allowed values or limits.
  • Each endpoint has at least one request example and one response example, taken from a real call made with fake data.
  • Error responses list the status code, the error code your API returns and what the caller should do next.
  • Keys, tokens and account identifiers in examples are placeholders such as YOUR_API_KEY, never live secrets.
  • The page names the base URL for each environment, so a sandbox call cannot be mistaken for a production one.
  • Each default, limit and date has been confirmed against the code or a test call on the day you publish.
Section outline

A repeatable layout for a small API page

  1. Overview

    Say what the API does, who it is for and the base URL for each environment. Keep it to a short paragraph a developer can read before making a first call.

    80 words
  2. Authentication

    Explain what a caller must send with each request and where to request credentials. Describe only what the caller does; leave out your internal key management.

    90 words
  3. Endpoint reference

    One section per endpoint, in the order developers use them: create, read, update, list, delete. Repeat the same four blocks in every section: purpose, parameters, example, responses.

    300 words
  4. Errors

    List the errors a caller will actually meet, each with its cause and one fix. Group validation errors together so a developer can find all of them at once.

    150 words
  5. Limits and change notes

    State request limits, pagination rules and the date of the last breaking change, so a caller knows what to expect before a build fails.

    100 words

Total: 720 words

Example excerpt

Worked example: one endpoint section

Sample section

Illustrative example. The API, its endpoints and every value below are fictional. Create a pickup window POST https://sandbox.orchard-example.test/v1/pickups Creates a pickup window for one confirmed order. A pending order cannot receive a window, so confirm the order first. Request parameters order_id (string, required): the identifier returned by the orders endpoint. window_start (string, required): a start time in ISO 8601 with its offset, such as 2026-10-20T09:00:00-05:00. window_minutes (integer, optional): one of 30, 60 or 120. The default is 60. Example request body Set order_id to ord_1042 and window_start to 2026-10-20T09:00:00-05:00. Send it with your sandbox key in the Authorization header. Example response, 201 Created The body returns pickup_id, order_id, window_start and status. A new window has status scheduled. The response carries no customer details, so read those from the orders endpoint instead. Errors 409 order_not_confirmed: the order is still pending. Confirm it, then retry the same request. 422 window_outside_hours: the start time falls outside 08:00 to 18:00 local pickup time. Choose another start time.

Format notes

Formatting choices that keep the page scannable

Use one endpoint section with the same four blocks

Every endpoint gets a heading, a parameter table, an example and a response list, in that order. A developer who learns the pattern on the first endpoint can skip straight to the detail they need on the next one.

Put parameters in a table, not in paragraphs

A table with name, type, required and description columns lets a developer find the one value that failed. Keep each description to one sentence and move longer rules into the overview.

Make every example run as written

Copy each example from a real call, using placeholder values and the line breaks a developer would type. One example that fails when pasted costs more trust than a missing example.

Put each base URL next to its environment label

Write the sandbox and production addresses on separate lines, each with its label on the same line. A reader who copies the first address they see should not reach production by accident.

Mistakes to avoid

Mistakes that make an API page unusable

Documenting only the success path

A developer who gets a 422 and finds nothing about it on the page will open a support ticket. Document every error the endpoint can return, including the ones caused by a missing field.

Putting a live key in an example

Examples get pasted into code and screenshots. Use YOUR_API_KEY as the placeholder and say where readers obtain their own credentials. If a live key has already appeared on a shared page, rotate it before anything else.

Leaving parameter limits out

A field that accepts one to fifty items, but does not say so, produces failures that look like bugs in your API. Put allowed ranges, formats and defaults in the parameter table.

Using two names for one field

If the request says window_start and the response says start_time, every reader has to check twice. Choose one name per concept and use it in both directions.

Frequently asked questions

Is one HTML page enough for API documentation?

For a small API with a handful of endpoints, yes. One page can hold the base URL, the way callers authenticate, each endpoint with an example, the error list and the limits. When the reference grows past what a reader can scan in one sitting, move it to a docs platform that supports versions and search.

Can I use an API documentation template for a REST API?

Yes. The layout suits a REST API that uses standard HTTP methods. Replace the sample endpoints with your own, keep the same blocks for each endpoint, and check every example against a sandbox before you share the link.

Does Attain OS Content Creator build API docs from an OpenAPI or Swagger file?

No. The page is written from the details you enter, not from a specification file. It does not run a try-it console, and it does not keep several versions of your reference side by side.

How do I document an API that is still changing?

Put the version and the date at the top of the page, mark beta endpoints clearly, and list every change that breaks existing calls in its own section. Publish a new page for each version and link the previous version near the top, so a developer can compare the two.

Browse by category

More references in Technical & Product

How to build it

  1. Follow the eight-step wizard: type, assets and description, images, branding, contact and call to action, Atty Suggestions, blueprint, and generate. Atty generates one HTML page in the background. Review it, then publish and share the page link or download the HTML file.

Attain OS BETA