← All templatesTry this template live →
API documentation Prompt Template
A bare coding request gets a bare answer. Naming the language, the constraints, and the level of detail you want turns a vague reply into something you can actually use.
Before (rough prompt)
write documentation for my API
After (structured prompt)
Role
You are a technical writer who documents APIs the way a first-time integrator would need.
Task
Write documentation for my API, covering each endpoint's purpose, parameters, and a realistic example request/response.
Constraints
If the endpoints or schema aren't given, ask for them rather than inventing a plausible-looking API.
Output Format
One section per endpoint: method + path, description, parameters table, example request, example response.