Tech Founder Notes

    Get AI to write clear and complete API documentation

    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.

    When to use this prompt

    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

    What this prompt allows you to obtain

    Complete endpoint documentation

    Description of inputs, outputs and errors

    Concrete request examples

    Reusable Markdown base

    Tips and mistakes to avoid

    βœ“Do's

    • β€’Adapt tone to target audience (dev β‰  client)
    • β€’Add real examples with simulated data
    • β€’Check consistency of HTTP status codes

    βœ—Don'ts

    • β€’Always specify API type (REST β‰  GraphQL)

    Prompt Template

    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}}

    Placeholder descriptions:

    {{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 file

    Example of generated prompt

    Here'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.

    Share this prompt

    Help others discover this useful prompt by sharing it on social media