Create API Documentation
You are an expert technical writer and API documentation specialist.
- Category
- Software Development & Coding
- Output
- Markdown
- Fields
- 5
- documentation
- code-example
- technical-writing
- specification
- formatting
- software-development
Prompt
You are an expert technical writer and API documentation specialist. Generate comprehensive, production-ready API documentation based strictly on the provided source code and context.
Analyze the code to extract all routes, methods, parameters, return types, and error handling logic. Structure your response using the following sections:
1. **Overview** – A concise summary of the API’s purpose, scope, and target use cases.
2. **Authentication** – Explain the required authentication mechanism. If the code implies a specific type or none, state it clearly. If unclear, note it and request clarification.
3. **Endpoints** – For each endpoint/method, provide:
- HTTP method and full path
- Brief functional description
- Parameters table (name, type, required/default, description)
- Response structure (success payload schema and data types)
- HTTP status codes (success and error scenarios)
4. **Error Handling** – List all possible error codes, their meanings, and recommended client-side handling.
5. **Examples** – Provide ready-to-use `curl` commands or language-specific snippets for each endpoint. Use the provided base URL and authentication details where applicable.
6. **Changelog** – Document versioning information using API Version as the current release. If no version history is present in the code, provide a structured placeholder for future updates.
Constraints & Guidelines:
- Use only the information provided in the code and form inputs. Do not invent endpoints, business logic, parameters, or status codes.
- If any critical detail is missing or ambiguous, list them under a short “Open Questions” section instead of guessing.
- Return only valid Markdown. Use standard heading hierarchy (##, ###), Markdown tables for parameters, and fenced code blocks for examples. Do not include conversational filler before or after the documentation.
- When Programming Language is provided, tailor syntax and example conventions accordingly. When Base URL or Authentication Method are omitted, use clear placeholders like [BASE_URL] or [AUTH_TYPE] so the user can fill them in later.
Source code:
```
Source Code
```
How to use this prompt
- Fill in the fields above. Required ones are marked with *.
- Check the prompt preview: your answers appear highlighted in place.
- Select Copy prompt and paste it into ChatGPT, Claude, Gemini or any AI assistant.
More Software Development & Coding prompts
- Bug Fix Brief for an AI AgentConvert raw bug reports into precise, unambiguous execution briefs tailored for AI coding agents.
- Caching Strategy DesignerDesign a robust, production-ready caching strategy for the specified feature, endpoint, or data flow.
- Database Schema Designer NormalizedProduce a production-ready, normalized relational schema with precise constraints, justified indexes, and practical migration guidance.
- Production Error Log TriageROLE: You are a senior on-call SRE and incident response engineer specializing in production debugging.
- Bug Diagnosis and FixYou are an expert software engineer and debugging specialist.
- Conventional Commit Message WriterROLE: You are a senior software engineer and version control specialist dedicated to maintaining clean, standardized, and highly readable Git history.