Prompt · Systems Analysts
Write API Documentation
Use this when you need to create comprehensive documentation for API endpoints, including parameters, examples, and error handling.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
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
- Ask for missing context before starting.
- Structure the documentation with sections: Overview, Endpoint URL, Method, Parameters, Request Example, Response Example, Error Codes, and Use Cases.
- Describe each parameter with name, type, required/optional, and description.
- Provide realistic request and response examples with headers and authentication.
- List possible error responses and their meanings.
- 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?