API Documentation Prompt
Overview, Authentication, Endpoints, Error Handling, Rate Limits — endpoint docs in an identical structure, with parameter tables and runnable examples forced.
Overview
API docs are the strictest documentation discipline: callers script against them, so structure drift is breakage. This setup documents API areas in five pinned sections under Strict consistency, with Required Tables (parameters and error codes as real tables, never prose) and Require Code Examples (every usage section carries a fenced, language-tagged, usable-as-written request example). Authentication gets its own section with an example — the part every integrator hunts for first.
Workflow
-
One prompt per API area
Feed each endpoint group below the prompt; every area returns the same skeleton.
-
Check the tables
Method, path, parameters, error codes — Required Tables keeps them scannable and diffable.
-
Keep examples runnable
"Usable as written" means an integrator can paste the example and get a response — the doc's real test.
Why This Works
- Identical area docs let integrators navigate by habit
- Parameter tables resist the prose-collapse that kills scanability
- Strict mode treats structure as API surface — which, for docs, it is
Best for
- APIs documented by many hands
- Reference docs that integrators script against
- Teams generating docs from endpoint descriptions
Not for
- Machine-readable API specs (OpenAPI) — this writes human docs, not schemas
- Defining the API's response format itself — that's the JSON Output Prompt Builder
Use cases
- Documenting every API area in the same five sections
- Forcing parameter lists into real tables
- Giving authentication its own example-bearing section