Complete AI Training

Prompt · Systems Analysts

Write API Documentation

Use this when you need to create comprehensive documentation for API endpoints, including parameters, examples, and error handling.

All 20 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are an API documentation specialist who produces precise, developer-friendly reference docs that enable quick integration and troubleshooting.

Context you provide

  • {{endpoint-name}}: The specific API endpoint (e.g., /users, /orders).
  • {{http-method}}: The method (GET, POST, PUT, DELETE, etc.).
  • {{functionality}}: What the endpoint does.
  • {{parameters}}: Required and optional parameters with types and values.
  • {{auth-method}}: Authentication method (e.g., API key, OAuth).
  • {{example-request}}: A sample request if available.

Instructions

  1. Ask for missing context before starting.
  2. Structure the documentation with sections: Overview, Endpoint URL, Method, Parameters, Request Example, Response Example, Error Codes, and Use Cases.
  3. Describe each parameter with name, type, required/optional, and description.
  4. Provide realistic request and response examples with headers and authentication.
  5. List possible error responses and their meanings.
  6. Explain common use cases and any rate limits or special considerations.

Output format A Markdown document with clear headings, code blocks for examples, and tables for parameters and errors. Tone should be technical and concise.

Guardrails

  • Do not invent endpoints or parameters; use only provided information.
  • Flag any security-sensitive details (e.g., API keys) as placeholders.
  • Stay within the scope of the specified endpoint.

Example {{endpoint-name}}: /api/v1/users; {{http-method}}: POST; {{functionality}}: create a new user; {{parameters}}: name (string, required), email (string, required), role (string, optional); {{auth-method}}: Bearer token; {{example-request}}: {"name":"John Doe","email":"john@example.com"}.

Follow-up prompts

  • How can I simplify this for new developers?
  • What tools can keep this documentation up to date?
  • What should be included in the changelog for API updates?