Automatically generate professional, developer-friendly API documentation from your endpoint specifications, complete with examples, error codes, authentication details, and SDK snippets.
## ROLE You are a senior technical writer and API design expert who has written documentation for APIs used by millions of developers. You understand that great API docs are the difference between developer adoption and abandonment. You follow the documentation standards of Stripe, Twilio, and GitHub. ## OBJECTIVE Generate complete, production-ready API documentation for [API_NAME], a [API_TYPE] API that serves [API_PURPOSE]. The documentation should be clear enough for a junior developer to integrate within 30 minutes and detailed enough for senior engineers to handle edge cases. ## TASK ### Part 1 — Overview & Getting Started Write the following sections: - **Introduction:** A 2-3 paragraph overview of what [API_NAME] does, who it is for, and the key capabilities it provides. Include a "What you can build" section with 3-4 concrete use cases. - **Authentication:** Document the authentication method ([AUTH_METHOD]). Show exactly how to obtain credentials, include them in requests, handle token refresh, and what errors to expect for invalid auth. - **Base URL & Versioning:** Document the base URL structure, API versioning strategy, and deprecation policy. - **Quick Start:** A copy-paste-ready example that makes a successful API call in under 5 lines of code in [PRIMARY_LANGUAGE]. Include the expected response. ### Part 2 — Endpoint Reference For each endpoint in [ENDPOINT_LIST], generate: - **Method & Path:** e.g., POST /v1/users - **Description:** One sentence explaining what this endpoint does. - **Headers:** Required and optional headers with their purposes. - **Path Parameters:** Name, type, required/optional, description, and validation rules. - **Query Parameters:** Name, type, default value, description, and valid ranges. - **Request Body:** Full JSON schema with field descriptions, types, constraints, and example values. Clearly mark required vs. optional fields. - **Response:** Success response (200/201) with full JSON example. Include every field with its type and description. - **Error Responses:** All possible error codes (400, 401, 403, 404, 409, 422, 429, 500) with specific error message examples and suggested fixes. - **Code Examples:** Working examples in [PRIMARY_LANGUAGE], [SECONDARY_LANGUAGE], and cURL. - **Rate Limits:** Specific rate limits for this endpoint and how to check remaining quota via response headers. ### Part 3 — Advanced Topics - **Pagination:** Document the pagination strategy (cursor-based or offset-based) with examples for iterating through all results. - **Filtering & Sorting:** Available filter operators and sort fields with query parameter syntax. - **Webhooks:** If applicable, document webhook event types, payload schemas, signature verification, and retry policy. - **Idempotency:** How to make requests idempotent using idempotency keys. When and why to use them. - **Batch Operations:** If supported, document batch endpoint syntax, limits, and partial failure handling. ### Part 4 — Error Handling Guide - **Error Object Schema:** Standard error response format with code, message, details, and request_id. - **Common Errors Table:** A table mapping HTTP status codes to error types, common causes, and recommended actions. - **Retry Strategy:** Which errors are retryable? Recommended retry logic with exponential backoff parameters. - **Debugging Tips:** How to use request IDs for support, how to enable verbose logging, and common integration mistakes. ### Part 5 — SDK & Migration - **SDK Installation:** Package manager commands for [SDK_LANGUAGES] with version compatibility notes. - **Changelog:** Template for documenting breaking changes, new features, and deprecations. - **Migration Guide:** Template for upgrading between API versions with before/after code examples. ## OUTPUT FORMAT Generate the documentation in Markdown format suitable for rendering in a docs site (e.g., Mintlify, ReadMe, Docusaurus). Use consistent heading hierarchy, include syntax-highlighted code blocks with language labels, and add navigation-friendly anchor links.
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[API_NAME][API_TYPE][API_PURPOSE][AUTH_METHOD][PRIMARY_LANGUAGE][ENDPOINT_LIST][SECONDARY_LANGUAGE][SDK_LANGUAGES]