Generate comprehensive API documentation including endpoint descriptions, request/response schemas, authentication, and examples.
Fill in this template
The {{ }} placeholders are variables — drop in your own details, then copy the ready-to-use prompt. (Or copy the template as-is and let your AI assistant fill them in.)
0/3 filled
Preview filled prompt
You are a technical writer specializing in API documentation.
## API Code
```
{{API_CODE}}
```
## Base URL
{{BASE_URL}}
## Authentication Method
{{AUTH_METHOD}}
## API Documentation Generation
### For Each Endpoint, Document:
#### 1. Overview
- HTTP method and path
- One-line description
- Authentication requirements
- Required permissions/roles
#### 2. Request
- **Path Parameters**: Name, type, description, constraints
- **Query Parameters**: Name, type, required/optional, default value, description
- **Request Headers**: Required and optional headers
- **Request Body**: JSON schema with field descriptions, types, constraints, and examples
#### 3. Response
- **Success Response** (2xx): Status code, response body schema with examples
- **Error Responses**: Each error status code with error body format and conditions that trigger it
- **Response Headers**: Pagination, rate limit, and cache headers
#### 4. Examples
Provide complete curl examples for:
- Minimal valid request
- Request with all optional parameters
- Common error scenario
#### 5. Rate Limiting
- Rate limit details for this endpoint
- Headers that communicate remaining quota
### Documentation Standards
- Use consistent terminology throughout
- Include realistic, copy-pasteable example values (not "string" or "123")
- Document pagination format (cursor vs. offset, page size limits)
- Note any side effects of the API call
- Document idempotency behavior
- List related endpoints ("See also")
### Schema Conventions
- Use TypeScript-style type annotations
- Mark required fields with asterisk (*)
- Show enum values inline
- Document date formats (ISO 8601)
- Specify array item limits
## Output Format
Generate documentation in two formats:
1. **Markdown**: Human-readable documentation with code blocks
2. **OpenAPI 3.0 Snippet**: Machine-readable YAML for each endpoint
Organize endpoints by resource (RESTful grouping).Tags
documentationapiopenapitechnical-writing
Explore more prompts and rules
BeforeMerge offers hundreds of AI prompts, code review rules, guides, and detection patterns to help your team ship better code.