Documenting an API is often neglected β yet it's essential for onboarding, maintenance, and integrations. Learn the exact prompt that transforms an API definition into structured, clear documentation ready to integrate into a Markdown file, OpenAPI spec, or technical Notion.
At the end of a sprint to document endpoints
When a client or frontend dev expects a spec
To write docs faster
To generate a base compatible with OpenAPI
Complete endpoint documentation
Description of inputs, outputs and errors
Concrete request examples
Reusable Markdown base
This is the base template with placeholders. Replace the placeholders with your specific information:
You are a technical writer expert in developer documentation. Generate clear and concise documentation from this API definition: {{api_code}}. The API type is: {{api_type}}. The target audience is: {{audience}}. Structure the documentation with: 1) endpoint name, 2) HTTP method, 3) required and optional parameters, 4) response description, 5) request and response examples. {{additional_context_block}}
{{api_code}}
API code or description - ex: app.get('/users/:id', async (req, res) => { ... }){{api_type}}
API type{{audience}}
Target audience{{additional_context}}
Context or constraint (optional) - ex: respect OpenAPI format, document only public routes, generate Markdown fileHere's an example with filled-in values:
You are a technical writer expert in developer documentation. Generate clear and concise documentation from this API definition: app.post('/register', async (req, res) => { const { email, password } = req.body; // ... }); The API type is: REST. The target audience is: frontend developer. Structure the documentation with: 1) endpoint name, 2) HTTP method, 3) required and optional parameters, 4) response description, 5) request and response examples. Also add these details: generate a Markdown file.
Help others discover this useful prompt by sharing it on social media