Skip to main content
coding intermediate

Write Professional API Documentation

Generate comprehensive API documentation with clear endpoints, parameters, and examples. Perfect for developers and technical writers.

Works with: chatgptclaudegemini

Prompt Template

You are a technical documentation specialist tasked with creating comprehensive API documentation for [API_NAME]. Create professional, developer-friendly documentation that follows industry best practices. **API Details:** - API Name: [API_NAME] - Base URL: [BASE_URL] - Authentication Method: [AUTH_METHOD] - Primary Endpoints: [ENDPOINTS_LIST] **Documentation Requirements:** 1. **Overview Section**: Brief description of what the API does and its main use cases 2. **Authentication**: Clear explanation of how to authenticate, including required headers/tokens 3. **Base URL and Versioning**: Document the base URL structure and any versioning approach 4. **Endpoints Documentation**: For each endpoint, include: - HTTP method and full URL path - Purpose and description - Required and optional parameters - Request body schema (if applicable) - Response format with status codes - Practical code examples in cURL and at least one programming language 5. **Error Handling**: Document common error responses and their meanings 6. **Rate Limiting**: Any usage limits or throttling information 7. **Additional Notes**: Include any important implementation details or best practices **Style Guidelines:** - Use clear, concise language avoiding unnecessary jargon - Include practical examples that developers can copy and test - Use consistent formatting and structure - Add helpful notes for common gotchas or important considerations - Make it scannable with proper headings and bullet points Target Audience: [TARGET_DEVELOPERS] (e.g., front-end developers, mobile developers, etc.) Additional Context: [ADDITIONAL_CONTEXT]

Variables to Customize

[API_NAME]

The name of your API or service

Example: TaskFlow API

[BASE_URL]

The base URL for your API

Example: https://api.taskflow.com/v1

[AUTH_METHOD]

Authentication method used by the API

Example: Bearer token in Authorization header

[ENDPOINTS_LIST]

List of main API endpoints to document

Example: GET /tasks, POST /tasks, PUT /tasks/{id}, DELETE /tasks/{id}

[TARGET_DEVELOPERS]

Primary audience for the documentation

Example: web developers building productivity applications

[ADDITIONAL_CONTEXT]

Any special requirements or context

Example: This API supports real-time webhooks and bulk operations

Example Output

# TaskFlow API Documentation ## Overview The TaskFlow API allows developers to integrate task management functionality into their applications. Create, update, and manage tasks with support for real-time webhooks and bulk operations. ## Authentication All API requests require a Bearer token in the Authorization header: ``` Authorization: Bearer YOUR_API_TOKEN ``` ## Base URL ``` https://api.taskflow.com/v1 ``` ## Endpoints ### GET /tasks Retrieve all tasks for the authenticated user. **Parameters:** - `status` (optional): Filter by task status (pending, completed, archived) - `limit` (optional): Number of tasks to return (default: 50, max: 200) **Response:** ```json { "tasks": [ { "id": "task_123", "title": "Complete API documentation", "status": "pending", "created_at": "2024-01-15T10:30:00Z" } ], "total": 1 } ``` **cURL Example:** ```bash curl -H "Authorization: Bearer YOUR_TOKEN" \ "https://api.taskflow.com/v1/tasks?status=pending" ``` ## Error Responses - `401 Unauthorized`: Invalid or missing API token - `429 Too Many Requests`: Rate limit exceeded (100 requests/minute) ## Rate Limiting API requests are limited to 100 requests per minute per API key.

Pro Tips for Best Results

  • Provide working code examples in multiple programming languages to increase usability
  • Include realistic sample data in your examples rather than generic placeholders
  • Document error scenarios and edge cases that developers commonly encounter
  • Add interactive elements like copy-to-clipboard buttons for code examples if publishing online
  • Test all examples thoroughly before publishing to ensure they work as documented

Tags

Want 500+ Expert Prompts?

Get the Premium Prompt Pack — organized, tested, and ready to use.

Get it for $29

Related Prompts You Might Like