documentationintermediate520 tokens
API Documentation (Complete Reference)
Create complete API documentation that developers can actually use
api-documentationtechnical-writingdeveloper-docs
Prompt Template
You are a technical writer specializing in API documentation. Create comprehensive, developer-friendly documentation for the following API.
**API Context:**
- API Name: {api_name}
- Purpose: {api_purpose}
- Base URL: {base_url}
- Authentication: {auth_type}
**Endpoint to Document:**
```
{endpoint_spec}
```
Create documentation following industry standards:
**1. Endpoint Overview:**
```
{METHOD} {path}
```
**Description:**
One paragraph explaining what this endpoint does and when to use it.
**2. Authentication:**
- Auth type required: [Bearer Token / API Key / OAuth 2.0]
- Header format: `Authorization: Bearer <token>`
- How to obtain credentials: [link or instructions]
**3. Request:**
**Path Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | User ID |
**Query Parameters:**
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `limit` | integer | No | 10 | Results per page (max 100) |
**Request Body:**
```json
{
"field": "type - description"
}
```
**4. Response:**
**Success Response (200):**
```json
{
"data": {},
"meta": {}
}
```
**Response Fields:**
| Field | Type | Description |
|-------|------|-------------|
**5. Error Responses:**
| Status | Code | Description | Resolution |
|--------|------|-------------|------------|
| 400 | `INVALID_INPUT` | ... | ... |
| 401 | `UNAUTHORIZED` | ... | ... |
| 429 | `RATE_LIMIT` | ... | ... |
**6. Code Examples:**
**cURL:**
```bash
curl -X GET "{base_url}/endpoint" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"
```
**JavaScript (fetch):**
```javascript
const response = await fetch('{base_url}/endpoint', {
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
});
const data = await response.json();
```
**Python (requests):**
```python
import requests
response = requests.get(
'{base_url}/endpoint',
headers={'Authorization': 'Bearer YOUR_TOKEN'}
)
data = response.json()
```
**7. Rate Limiting:**
- Rate limit: {rate_limit}
- Headers: `X-RateLimit-Remaining`, `X-RateLimit-Reset`
**8. Changelog:**
- v1.2.0 (2025-01-15): [changes]
Format with proper markdown, tables, and syntax highlighting.Variables to Replace
{api_name}{api_purpose}{base_url}{auth_type}{endpoint_spec}{rate_limit}Pro Tips
Providing example request/response helps the LLM generate accurate code examples.
Related Prompts
Need More Prompts?
Explore our full library of 60+ professional AI prompt templates
Browse All Prompts →