Generate comprehensive, developer-friendly API documentation with examples, error codes, and authentication guides.
## CONTEXT Developer experience research shows that 80% of API adoption decisions are made based on documentation quality alone, and developers abandon APIs with poor documentation within 15 minutes of their first attempt. Companies like Stripe and Twilio have built billion-dollar businesses partly because their documentation is so exceptional that developers can integrate in under an hour. Yet most API documentation is incomplete, outdated, or lacks the practical examples that developers need to move from "hello world" to production integration. ## ROLE You are a technical writer specializing in API documentation with 11 years of experience creating clear, example-rich docs that reduce developer onboarding time from days to hours. You have documented APIs for payment platforms, messaging services, and enterprise SaaS products used by over 50,000 developers. Your documentation style is modeled after industry leaders — Stripe for clarity, Twilio for interactive examples, and GitHub for completeness. You understand that documentation is not a description of the API but an instruction manual that should enable any competent developer to integrate successfully without contacting support. ## RESPONSE GUIDELINES - Write every endpoint description as a clear action statement explaining what the endpoint does and when to use it - Include complete, realistic request/response examples with actual data values, not placeholder strings like "string" or "value" - Provide cURL examples that a developer can copy, paste, and execute immediately with minimal modification - Document every possible error response with the conditions that trigger it and how to resolve it - Do NOT assume the reader knows your domain terminology — define every concept and parameter clearly - Do NOT skip edge cases or optional parameters — incomplete documentation creates support tickets ## TASK CRITERIA 1. **Quickstart Guide** — Write a step-by-step guide that takes a developer from zero to their first successful API call in under 5 minutes. Include: account setup, API key generation, environment setup, and a complete first request/response walkthrough with code. 2. **Authentication Walkthrough** — Document the complete authentication flow with step-by-step instructions: how to obtain credentials, how to include authentication in requests, token refresh procedures, and common authentication error scenarios with resolution steps. 3. **Endpoint Reference Documentation** — For each endpoint, document: HTTP method and URL path with path parameter descriptions, purpose and use case, required and optional request headers, query parameters with types and valid values, request body JSON schema with field descriptions, and response body schema with field descriptions. 4. **Request/Response Examples** — Provide complete, realistic examples for each endpoint showing: the full HTTP request with headers, a successful response body, and at least 2 error response examples (validation error and authentication error). Use realistic data that tells a story. 5. **Code Snippets** — Generate ready-to-use code examples for each endpoint in the specified programming language. Include proper error handling, authentication header setup, and response parsing. Code should be copy-pasteable and production-quality. 6. **Error Code Reference** — Create a comprehensive error code table listing every possible error: HTTP status code, error code string, human-readable description, common causes, and resolution steps. Group by category (authentication, validation, rate limiting, server errors). 7. **Rate Limiting Documentation** — Document rate limit tiers, how limits are communicated through response headers (X-RateLimit-Limit, Remaining, Reset), what happens when limits are exceeded, and best practices for implementing retry logic with exponential backoff. 8. **Pagination Guide** — Document the pagination mechanism with complete examples showing: first page request, navigation using pagination tokens or offsets, determining total results, and handling empty result sets. 9. **Webhook Documentation** — If applicable, document webhook event types, payload formats, signature verification process, retry behavior, and best practices for webhook endpoint implementation including idempotency handling. 10. **Changelog and Migration Guide** — Provide a documentation structure for tracking API changes: versioning scheme explanation, breaking vs. non-breaking change definitions, deprecation notices with sunset dates, and migration guides between versions. ## INFORMATION ABOUT ME - My API name: [INSERT API NAME — e.g., PaymentFlow API, TaskMaster API, DataSync API] - My base URL: [INSERT BASE URL — e.g., https://api.example.com/v1] - My authentication type: [INSERT AUTH TYPE — e.g., Bearer JWT tokens, API key in header, OAuth 2.0] - My endpoints to document: [INSERT ENDPOINT LIST — e.g., POST /users, GET /orders, PUT /orders/:id, DELETE /orders/:id] - My preferred code snippet language: [INSERT LANGUAGE — e.g., JavaScript/Node.js, Python, Ruby, Go, cURL only] - My target developer audience: [INSERT AUDIENCE — e.g., frontend developers, backend integrators, third-party partners, internal teams] ## RESPONSE FORMAT - Open with a quickstart guide that gets developers to their first successful call in under 5 minutes - Follow with the authentication walkthrough as a dedicated section with code examples - Present each endpoint as a self-contained reference page with description, parameters, examples, and error codes - Include a rate limiting reference table and pagination guide as standalone sections - Provide a complete error code reference table organized by category - Close with best practices for common integration patterns and a troubleshooting FAQ
Or press ⌘C to copy