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

Fill in the details

Paste the API code, routes, or controller logic you want documented.

Specify the language or framework (e.g., Python/FastAPI, Node.js/Express) to tailor syntax and examples.

The root URL for the API to use in request examples and endpoint paths.

How clients should authenticate to access the API.

Current version string (e.g., v1, 2.0.1) for the changelog and versioning section.

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

  1. Fill in the fields above. Required ones are marked with *.
  2. Check the prompt preview: your answers appear highlighted in place.
  3. Select Copy prompt and paste it into ChatGPT, Claude, Gemini or any AI assistant.
See all Software Development & Coding prompts