Complete AI Training

Prompt lesson · 22 prompts

API Documentation prompts for Technical Writers

22 ready-to-use prompts from our AI for Technical Writers course. Copy one, fill in the {{placeholders}}, and paste it into ChatGPT, Claude, Gemini or any other AI.

01

API Authentication Guide

Use this when you need to document the authentication methods for a specific API, including OAuth, API keys, JWT, or basic auth.

Prompt

Role You are a technical writer specializing in API documentation. Your goal is to create clear, accurate guides for developers on how to authenticate with a given API.

Context you provide

  • {{api_name}}: The name of the API (e.g., Stripe, GitHub API, Custom API).
  • {{auth_methods}}: One or more authentication methods to cover (e.g., OAuth 2.0, API keys, JWT, Basic Auth). If not specified, cover the most common methods.
  • {{programming_language}}: Optional – if you want code snippets in a specific language (e.g., Python, JavaScript, curl).

Instructions

  1. If the user hasn't specified the API name or preferred authentication methods, ask for them before starting.
  2. For each requested authentication method, provide a step-by-step explanation:
  • What the method is and when to use it.
  • How to obtain credentials (e.g., API keys, client ID/secret).
  • How to include the credentials in requests (e.g., headers, parameters).
  • A code snippet in the specified programming language (or generic HTTP examples if none specified).
  1. Highlight common pitfalls and best practices for each method (e.g., key rotation, token expiry, security).
  2. If multiple methods are covered, include a comparison table summarizing pros and cons.

Output format Present the guide in structured sections per method. Include a brief introduction, then method sections with headings. Use code blocks for snippets. Keep total length between 500–800 words. Write in a neutral, instructional tone.

Guardrails

  • Only provide code snippets that follow official documentation; do not invent API endpoints or credentials.
  • Flag any assumptions about the API (e.g., "This assumes the API supports OAuth 2.0 authorization code flow").
  • Do not include security advice that could be misleading (e.g., storing keys in plaintext); always recommend secure storage.

Example

  • api_name: "Acme Payments API"
  • auth_methods: OAuth 2.0 (authorization code) and API keys.
  • programming_language: Python.

Open this prompt Writing · Intermediate

02

API Authentication Guide

Use this when you need to create a comprehensive guide on API authentication methods and best practices.

Prompt

Role You are a technical writer who creates clear, developer-focused documentation for API authentication.

Context you provide

  • {{api_name}}: The name of the API you are documenting.
  • {{auth_methods}}: The authentication methods to cover (e.g., OAuth 2.0, API keys, JWT, HMAC).
  • {{examples}}: Any specific use cases or code examples to include.

Instructions

  1. If any required input is missing, ask for it before proceeding.
  2. Structure the guide with an introduction to authentication, then a section for each method, explaining how it works, when to use it, and step-by-step instructions.
  3. Include practical code examples for each method, using a common programming language (e.g., Python, JavaScript) unless specified otherwise.
  4. Add a section on best practices and common security pitfalls to avoid.
  5. Ensure the guide is accessible to developers with basic API knowledge.

Output format Provide a well-structured Markdown document with headings, subheadings, code blocks, and bullet points. Use clear, concise language. Include a table comparing the methods at the end.

Guardrails

  • Do not invent API endpoints or credentials; use generic placeholders like 'your-api-key'.
  • Flag any assumptions about the API's capabilities or the developer's environment.
  • Stay focused on authentication and authorization, not broader API functionality.

Example API name: 'Acme API'; Auth methods: 'OAuth 2.0, API keys, JWT'.

Open this prompt Creating · Intermediate

03

API Change Log Creation

Use this when you need to document API updates and changes clearly for users and stakeholders.

Prompt

Role You are a technical writer who maintains clear, user-friendly API change logs that communicate updates effectively.

Context you provide

  • {{api_name}}: The name of the API.
  • {{changes}}: A list of changes or updates to document (e.g., new endpoints, deprecations, bug fixes).
  • {{version}}: The version number or release date for the change log entry.

Instructions

  1. If any required input is missing, ask for it before proceeding.
  2. Organize the change log chronologically, with the most recent changes first.
  3. For each change, provide a clear, concise explanation of what changed and why, avoiding technical jargon where possible.
  4. Categorize changes (e.g., New Features, Improvements, Bug Fixes, Deprecations) to make scanning easier.
  5. Include a summary at the top highlighting the most impactful changes.

Output format Provide a Markdown document with a version header, date, and categorized bullet points. Use plain language and keep each entry to 1-2 sentences.

Guardrails

  • Do not invent changes; only document what is provided.
  • Flag any changes that are unclear or require more detail.
  • Stay within the scope of the change log; do not add tutorials or unrelated content.

Example API name: 'Acme API'; Changes: 'Added new /users endpoint, deprecated /v1/login, fixed pagination bug'.

Open this prompt Creating · Beginner

04

API Code Samples

Use this when you need to generate code examples in multiple programming languages to demonstrate API usage, including requests, error handling, authentication, and pagination.

Prompt

Role You are an expert technical writer and developer advocate. Your goal is to produce accurate, idiomatic code samples that help developers integrate with an API quickly and correctly.

Context you provide

  • {{API Name}}: The API you are writing samples for.
  • {{Languages}}: List of programming languages to cover (e.g., Python, JavaScript, Ruby).
  • {{Operation}}: The specific operation to demonstrate (e.g., GET request, error handling, authentication, pagination).

Instructions

  1. If any required context is missing, ask for it before proceeding.
  2. For each language, write a complete, runnable code snippet that demonstrates the specified operation.
  3. Include comments explaining key steps and any language-specific considerations.
  4. Show how to handle common errors, such as network failures or invalid responses.
  5. If authentication is involved, show how to include API keys or tokens securely.
  6. For pagination, demonstrate how to iterate through pages of results.

Output format A code block for each language, with a brief introduction and explanation. Use proper syntax highlighting. Keep each snippet concise but functional.

Guardrails

  • Do not assume API endpoints or parameters; use placeholders like {{base_url}}.
  • Ensure code follows best practices for security (e.g., no hardcoded secrets).
  • Stay within the scope of the requested operation.

Example

  • {{API Name}}: WeatherAPI, {{Languages}}: Python, JavaScript, Ruby, {{Operation}}: GET request.

Open this prompt Writing · Intermediate

05

API Data Model Documentation

Use this when you need to describe data models, request/response formats, and validation rules for an API.

Prompt

Role You are a technical documentation specialist. Your goal is to produce clear, accurate descriptions of API data models, including nested structures, validation rules, and sample formats.

Context you provide

  • {{api_name}} (the name of the API)
  • {{data_model_overview}} (brief description of the main objects and relationships)
  • {{request_example}} (a sample API request, e.g., POST /users with JSON body)
  • {{response_example}} (a sample API response, e.g., 200 with user JSON)

Instructions

  1. Ask for any missing context (e.g., data types, optional fields).
  2. Describe the data model structure, highlighting nesting and relationships between objects.
  3. Document validation rules for each field (e.g., required, format, min/max).
  4. Provide annotated sample request and response with explanations.
  5. Discuss data transformation or normalization if applicable, and note backward compatibility considerations.

Output format Structured document with sections: Overview, Data Model Schema (table format), Validation Rules, Sample Request/Response (with comments), Notes on Backward Compatibility. Tone is technical but readable for developers.

Guardrails

  • Do not invent API features; base all descriptions solely on the provided examples.
  • Flag any ambiguous data types or constraints that need clarification.
  • Stay focused on data model documentation; do not cover authentication, endpoints, or error handling unless requested.

Example api_name: "UserManagement API" | data_model_overview: "User object with nested address and roles" | request_example: "POST /users {\"name\":\"John\",\"address\":{\"city\":\"NYC\"}}" | response_example: "200 {\"id\":123,\"name\":\"John\",\"address\":{\"city\":\"NYC\"}}"

Open this prompt Writing · Intermediate

06

API Documentation Template

Use this when you need a standardized, reusable template for API documentation across projects.

Prompt

Role You are a technical writer who designs comprehensive API documentation templates that meet industry standards.

Context you provide

  • {{api_name}}: The name of the API (optional, for customization).
  • {{template_style}}: The desired style (e.g., minimal, detailed, OpenAPI-based).
  • {{sections}}: Any specific sections you want included beyond the standard ones.

Instructions

  1. If any required input is missing, ask for it before proceeding.
  2. Create a template with the following standard sections: Overview, Getting Started, Authentication, Endpoints (with request/response examples), Error Handling, Rate Limits, and Versioning.
  3. Make the template customizable by using placeholders for API-specific details.
  4. If requested, align the template with the OpenAPI Specification (OAS) and include fields for parameters, headers, and response codes.
  5. Ensure the template is clear and easy for developers to fill in.

Output format Provide the template as a Markdown document with clear headings and placeholders like {{endpoint_name}}. Include brief instructions in italics under each section explaining what to fill in.

Guardrails

  • Do not include actual API details; use generic placeholders.
  • Flag any assumptions about the API's features or the developer's needs.
  • Stay focused on the template structure, not on writing content for a specific API.

Example API name: 'Acme API'; Template style: 'OpenAPI-based'.

Open this prompt Creating · Intermediate

07

API Error Code Documentation

Use this when you need to create a comprehensive reference document for API error codes, including descriptions, causes, and troubleshooting steps.

Prompt

Role You are a technical documentation specialist who produces clear, structured error code references that help developers diagnose and resolve API issues quickly. Context you provide

  • {{api_name}}: The name of the API.
  • {{error_code_list}}: A list of error codes to document (if available; otherwise, you will generate common ones).
  • {{api_technology}}: The underlying technology stack (e.g., REST, GraphQL, SOAP).
  • {{troubleshooting_guidelines}}: Any existing guidelines or best practices to incorporate.
  • Instructions

  1. If no error code list is provided, generate a comprehensive set of common error codes for the given API technology (e.g., 400, 401, 403, 404, 500, etc.).
  2. For each error code, provide:
  • The error code and HTTP status code (if applicable).
  • A short description of the error.
  • Potential causes (at least 2-3).
  • Troubleshooting steps for developers.
  1. Include best practices for handling each error in production, such as retry logic, logging, or user-facing messages.
  2. Organize the document in a logical order: client errors first, then server errors, then custom errors.
  3. Optionally, suggest improvements to the error messaging system for better clarity.
  4. Output format A structured document with a table of contents and sections for each error code. Use tables for quick reference and bullet points for details. Tone should be technical and clear. Guardrails

  • Do not use real API documentation; create generic but realistic error codes.
  • Do not assume specific implementation details; use common patterns.
  • Flag any assumptions about the API's error format (e.g., JSON vs XML).
  • Example

  • {{api_name}}: Payment Gateway API
  • {{error_code_list}}: (none provided)
  • {{api_technology}}: REST
  • {{troubleshooting_guidelines}}: Include retry suggestions for 5xx errors

Open this prompt Writing · Intermediate

08

API Error Handling Documentation

Use this when you need to document API error codes, messages, and troubleshooting steps for developers.

Prompt

Role You are a technical writer who creates clear, actionable error handling documentation for APIs.

Context you provide

  • {{api_name}}: The name of the API.
  • {{error_codes}}: A list of error codes and messages (if available).
  • {{examples}}: Any specific scenarios or code snippets to include.

Instructions

  1. If any required input is missing, ask for it before proceeding.
  2. Structure the documentation with an introduction to error handling, then a table of error codes with descriptions, common causes, and troubleshooting steps.
  3. For each error code, provide a practical example of the error response and a code snippet showing how to handle it.
  4. Categorize errors by severity (e.g., client errors, server errors) to help developers prioritize.
  5. Include a section on best practices for error handling in client applications.

Output format Provide a Markdown document with a table of error codes, followed by detailed sections for each error. Use clear, concise language and include code blocks for examples.

Guardrails

  • Do not invent error codes; use only those provided or clearly mark placeholders.
  • Flag any assumptions about the API's behavior or the developer's environment.
  • Stay focused on error handling; do not expand into general API usage.

Example API name: 'Acme API'; Error codes: '400 Bad Request, 401 Unauthorized, 404 Not Found'.

Open this prompt Creating · Intermediate

09

API Integration Guide Creation

Use this when you need to create a step-by-step integration guide for an API with a specific platform or framework.

Prompt

Role You are a technical documentation specialist skilled in API integration. Your goal is to produce a clear, actionable integration guide that enables developers to implement the API successfully with minimal friction.

Context you provide

  • {{API Name}}: The name of the API to integrate.
  • {{Platform/Framework}}: The target platform or framework (e.g., React, Node.js, Python).
  • {{Specific Use Cases}}: (Optional) Any particular use cases or scenarios to highlight.
  • {{Authentication Method}}: (Optional) If known, the authentication method (e.g., OAuth, API key).

Instructions

  1. If any required context is missing, ask the user to provide it before proceeding.
  2. Outline the integration process step by step, starting with prerequisites and setup.
  3. Include code snippets or configuration examples for each major step, using placeholders for actual credentials.
  4. Explain authentication procedures clearly, covering common methods.
  5. Address common integration challenges (e.g., rate limits, error handling) and provide solutions.
  6. If webhooks are relevant, include a section on setting them up and handling requests.
  7. Conclude with a checklist for testing and going live.

Output format A structured guide with headings, numbered steps, code blocks, and a troubleshooting section. Use clear, concise language suitable for developers. Aim for 800–1200 words.

Guardrails

  • Do not invent API endpoints or features; use only provided information or clearly mark assumptions.
  • Keep the guide focused on integration, avoiding unrelated topics.
  • Flag any security considerations, such as storing credentials securely.

Example API Name: Stripe, Platform: Node.js, Use Case: Payment processing, Auth: API keys.

Open this prompt Creating · Intermediate

10

API Overview and Introduction

Use this when you need to create a clear, audience-friendly introduction to an API, explaining its purpose, key features, and benefits.

Prompt

Role — You are a technical writer specializing in API documentation, skilled at translating complex technical details into clear, benefit-focused overviews for diverse audiences.

Context you provide —

  • {{api_name}}: The name of the API (e.g., Stripe API, Twilio SMS API).
  • {{target_audience}}: Who the overview is for (e.g., developers, product managers, business stakeholders).
  • {{key_features}}: (Optional) A list of main features or endpoints to highlight.
  • {{use_case}}: (Optional) A specific industry or application where the API is used (e.g., e-commerce payments, healthcare messaging).

Instructions —

  1. If any inputs are missing, ask for them before proceeding.
  2. Begin with a one-paragraph summary of the API's purpose and the problem it solves.
  3. List and explain the key features, emphasizing how each benefits the target audience.
  4. If a use case is provided, illustrate with a concrete example or mini-case study.
  5. Optionally, compare the API to similar ones in the market if relevant, highlighting differentiators.
  6. Keep the tone professional yet accessible; avoid unnecessary jargon unless the audience is technical.

Output format — Provide a structured overview with sections: What is {{api_name}}?, Key Features and Benefits, How It Works (high-level), Example Use Case, and Comparison (optional). Use bullet points for features. Aim for 300–500 words unless otherwise specified.

Guardrails —

  • Do not include actual code snippets unless requested; focus on conceptual explanation.
  • Base all claims on the information provided; do not invent features or performance metrics.
  • If the audience is non-technical, avoid deep technical details.

Example — {{api_name}}: "Twilio Verify API" {{target_audience}}: "Product managers at a fintech startup" {{use_case}}: "Implementing phone-based two-factor authentication."

Follow-ups —

  • Can you provide more details about the scalability of {{api_name}} under high traffic?
  • What are some common misconceptions developers have when using {{api_name}}?
  • How does {{api_name}} compare to similar APIs like Authy or Firebase Authentication?

Open this prompt Communication · Intermediate

11

API Performance Metrics Analysis

Use this when you need to analyze and document API performance metrics and provide optimization recommendations.

Prompt

Role You are a performance analyst and technical writer. Your goal is to turn raw API performance data into a clear, actionable report that helps developers optimize the API.

Context you provide

  • {{API Name}}: The API to analyze.
  • {{Performance Data}}: (Optional) Any metrics you have, such as response times, error rates, throughput.
  • {{User Feedback}}: (Optional) Any user feedback or pain points related to performance.
  • {{Benchmarks}}: (Optional) Any known benchmarks or targets.

Instructions

  1. If performance data is not provided, ask the user to supply it or specify that you will work with general best practices.
  2. Analyze the provided metrics to identify trends, bottlenecks, and areas for improvement.
  3. Document the performance benchmarks, comparing them to industry standards if possible.
  4. Provide actionable recommendations for optimization, such as caching, query optimization, or infrastructure changes.
  5. Prioritize recommendations based on potential impact and ease of implementation.
  6. If user feedback is available, incorporate it to highlight real-world impact.

Output format A structured report with sections for overview, metrics analysis, benchmarks, recommendations, and next steps. Use tables or charts if helpful. Keep it concise, around 600–900 words.

Guardrails

  • Do not fabricate metrics; base analysis only on provided data or clearly state assumptions.
  • Stay within the scope of performance; avoid unrelated API features.
  • Flag any data that seems incomplete or inconsistent.

Example API Name: Payment API, Performance Data: response times (avg 300ms, p95 800ms), error rate 2%, user feedback: slow during peak hours.

Open this prompt Analysis · Intermediate

12

API Security Best Practices Guide

Use this when you need to compile a comprehensive guide on securing API endpoints and data transmission.

Prompt

Role You are an API security expert and technical writer. Your goal is to produce a practical, up-to-date guide that helps developers secure their API endpoints and data transmission effectively.

Context you provide

  • {{API Name}}: The API to secure.
  • {{Authentication Methods}}: (Optional) Current authentication methods in use (e.g., OAuth, JWT).
  • {{Data Sensitivity}}: (Optional) The sensitivity of data handled (e.g., PII, financial).
  • {{Compliance Requirements}}: (Optional) Any regulatory standards to meet (e.g., GDPR, HIPAA).

Instructions

  1. If any context is missing, ask the user to provide it before proceeding.
  2. Outline best practices for authentication, including OAuth, API keys, and JWT, with recommendations.
  3. Cover encryption protocols for data in transit (TLS) and at rest.
  4. Discuss input validation techniques to prevent injection attacks.
  5. Explain access control strategies, including role-based access control (RBAC).
  6. Include rate limiting and API key management best practices.
  7. Emphasize the importance of regular security audits and monitoring.
  8. Provide a checklist for implementation.

Output format A well-structured guide with sections for each security area, bullet points for best practices, and a final checklist. Use clear, technical language. Aim for 1000–1500 words.

Guardrails

  • Do not provide specific security vulnerabilities that could be exploited; focus on defensive measures.
  • Ensure recommendations align with industry standards (e.g., OWASP).
  • Flag any assumptions about the API's architecture or environment.

Example API Name: Healthcare API, Auth: OAuth 2.0, Data: PII, Compliance: HIPAA.

Open this prompt Creating · Advanced

13

API Troubleshooting FAQ Compilation

Use this when you need to create a comprehensive FAQ and troubleshooting guide for common API issues.

Prompt

Role You are a technical support writer with deep API knowledge. Your goal is to create a user-friendly FAQ that helps developers resolve common API issues quickly and independently.

Context you provide

  • {{API Name}}: The API for which to create the FAQ.
  • {{Common Issues}}: (Optional) Any known issues or error codes to include.
  • {{Target Audience}}: (Optional) The experience level of users (e.g., beginner, intermediate).

Instructions

  1. If the API name is not provided, ask for it.
  2. Compile a list of common issues, such as authentication failures, rate limits, CORS errors, and error codes.
  3. For each issue, provide a clear explanation of the problem and step-by-step troubleshooting tips.
  4. Include code examples or configuration snippets where helpful.
  5. Organize the FAQ by category (e.g., authentication, errors, performance).
  6. Ensure the language is accessible to the target audience, avoiding jargon where possible.
  7. Add a section on best practices for error handling.

Output format A structured FAQ document with categories, questions, and answers. Use a question-and-answer format with clear headings. Aim for 800–1200 words.

Guardrails

  • Do not invent error codes or solutions; use only known information or clearly mark assumptions.
  • Keep the FAQ focused on common issues; avoid edge cases unless specified.
  • Ensure troubleshooting steps are safe and do not encourage harmful practices.

Example API Name: Stripe, Common Issues: 401 errors, rate limits, webhook failures.

Open this prompt Creating · Beginner

14

API Usage Examples Showcase

Use this when you need to provide real-world usage examples of an API across different industries or scenarios.

Prompt

Role You are a technical storyteller and API evangelist. Your goal is to illustrate the versatility of an API through compelling, realistic use cases that inspire developers and decision-makers.

Context you provide

  • {{API Name}}: The API to showcase.
  • {{Industries}}: (Optional) Specific industries to cover (e.g., e-commerce, healthcare).
  • {{Scenarios}}: (Optional) Any particular scenarios or features to highlight.

Instructions

  1. If the API name is not provided, ask for it.
  2. For each industry or scenario, describe a realistic use case that demonstrates the API's value.
  3. Explain how the API is integrated and what data it processes.
  4. Highlight the benefits and outcomes, such as efficiency gains or insights.
  5. Use a consistent structure for each example: challenge, solution, result.
  6. If specific industries are not given, choose a diverse set (e.g., e-commerce, healthcare, finance, manufacturing).
  7. Keep examples concise but vivid, focusing on practical applications.

Output format A collection of use case vignettes, each with a heading, a brief description, and bullet points for key details. Use a narrative style that is engaging yet professional. Aim for 600–900 words total.

Guardrails

  • Do not fabricate specific metrics or outcomes; use plausible scenarios and clearly state they are illustrative.
  • Stay within the scope of the API's capabilities; avoid overpromising.
  • Ensure examples are diverse and inclusive of different industries.

Example API Name: Twilio, Industries: e-commerce, healthcare, finance.

Open this prompt Creating · Beginner

15

API Versioning Guide

Use this when you need to create a comprehensive guide on API versioning, focusing on backward compatibility and change management.

Prompt

Role You are a senior technical writer specializing in API documentation. Your goal is to produce a clear, actionable guide on API versioning that helps developers maintain backward compatibility and communicate changes effectively.

Context you provide

  • {{API Name}}: The name of the API you are documenting.
  • {{Current version}}: The current version number (e.g., v1.2).
  • {{Key changes}}: Any recent or planned changes that affect versioning.

Instructions

  1. If any of the required context is missing, ask for it before proceeding.
  2. Outline the core principles of API versioning, including why it matters and common strategies (e.g., URI versioning, header versioning).
  3. Provide a step-by-step process for implementing versioning for the specified API, covering how to introduce new versions while maintaining backward compatibility.
  4. Explain how to handle deprecated features, including timelines and communication strategies.
  5. Include best practices for documenting version changes, such as changelogs and migration guides.
  6. Suggest tools or practices that can help manage versioning and documentation updates.

Output format A structured guide with headings, bullet points, and code examples where relevant. Aim for 800–1200 words. Use a professional, instructional tone.

Guardrails

  • Do not invent specific API details; use placeholders or generic examples.
  • Flag any assumptions about the API's architecture or user base.
  • Stay focused on versioning; do not cover unrelated API topics.

Example

  • {{API Name}}: AcmePay API, {{Current version}}: v2.0, {{Key changes}}: Adding new payment methods.

Open this prompt Writing · Intermediate

16

Create API Support Documentation

Use this when you need to produce support and contact information materials for an API, including FAQs, troubleshooting guides, and escalation scripts.

Prompt

Role — You are a technical documentation specialist creating clear, user-friendly support materials for an API, optimized for self-service and efficient issue resolution.

Context you provide

  • {{API name}} — the name of the API
  • {{common issues}} — list of frequent problems or error codes users encounter
  • {{support channels}} — available contact methods (e.g., email, chat, ticket system)
  • {{target audience}} — developer skill level (e.g., beginners, experienced)

Instructions

  1. Ask for any missing context before starting.
  2. Create a detailed FAQ section with at least 5 common questions, including answers and links to relevant documentation.
  3. Generate a troubleshooting guide for the top 3 common issues, with step-by-step solutions and when to escalate.
  4. Craft customer support scripts for reporting bugs and escalating urgent issues, including required information (e.g., environment, logs, steps to reproduce).
  5. Design a knowledge base article on best practices for contacting support, including preparation tips (e.g., gather error messages, check status page).

Output format — Separate sections for FAQ, Troubleshooting Guide, Support Scripts, and Knowledge Base Article. Use clear headings, numbered steps, and code blocks where appropriate. Tone: helpful and concise.

Guardrails

  • Do not invent technical details about the API; use only the provided context.
  • Avoid overly technical jargon unless explaining it; keep instructions clear for the target audience.
  • Ensure all scripts and guides are actionable and realistic.

Example

  • {{API name}}: "Payment Gateway API"
  • {{common issues}}: "401 Unauthorized error, payment timeout, webhook not received"
  • {{support channels}}: "Email support@example.com, ticket system at https://example.com/support"
  • {{target audience}}: "Developers with basic API experience"

Open this prompt Creating · Intermediate

17

Develop API Best Practices

Use this when you need to create a set of best practices for using an API effectively and efficiently.

Prompt

Role You are a senior technical writer and API documentation specialist, skilled in creating clear, actionable best practices for developers using an API. Your goal is to produce a concise guide that helps users avoid common pitfalls and optimize performance.

Context you provide

  • {{api_name}}: the name of the API (e.g., Twilio SMS API, OpenAI API).
  • {{use_case}}: the primary use case or scenario (e.g., bulk data processing, real-time messaging).
  • {{key_concerns}}: any specific concerns (e.g., rate limits, error handling, security, throughput).
  • {{audience}}: the target developer audience (e.g., beginner, experienced, mobile).

Instructions

  1. If any context is missing, ask for it before proceeding.
  2. Based on the provided context, compile a list of 5–10 best practices.
  3. For each best practice, explain why it matters and give a concrete example or code snippet (in pseudocode or a common language).
  4. Cover topics such as authentication, error handling, rate limiting, data formatting, and performance optimization.
  5. If the API has specific quirks, address them.
  6. Conclude with a quick checklist for implementation.

Output format A structured guide with numbered best practices, each with a title, explanation, and example. Include a summary checklist at the end. Use clear, instructional language.

Guardrails

  • Do not assume the API's exact endpoints or authentication methods; use generic terms like 'API key' or 'token'.
  • Flag any recommendations that are specific to a particular API version.
  • Stay within best practices; do not write full documentation or tutorials.

Example API name: 'Acme Payment API' | Use case: processing payment transactions | Key concerns: rate limiting, idempotency, error responses | Audience: intermediate developers

Open this prompt Creating · Intermediate

18

Document API Rate Limits

Use this when you need to understand and document API rate limits, including monitoring, optimization, and error handling.

Prompt

Role — You are a technical writer and API integration expert who creates clear, practical rate-limit guidance for developers using a specific API.

Context you provide

  • {{api_name}} — the API or service being documented.
  • {{api_specification}} — endpoints, authentication method, and any existing rate-limit values (optional but useful).
  • {{usage_patterns}} — how the API will be used, such as real-time calls, batch processing, or webhook-heavy workloads.
  • {{known_limits}} — rate limits already provided by the API vendor or observed in testing (optional).

Instructions

  1. Ask for the API name and at least one usage pattern before starting; request rate-limit values if not provided.
  2. Summarize how rate limiting generally works for API requests, including windows, quotas, tiers, and headers.
  3. Explain how to monitor and manage limits for {{api_name}}, including headers, dashboards, logs, and alerts.
  4. Describe how different usage patterns may hit limits and recommend best practices for batching, throttling, or caching.
  5. Provide error-handling strategies for rate-limit responses, including retry logic, backoff, and user-facing messaging where relevant.

Output format Return an 'API Rate Limit Guide' with sections for overview, monitoring, optimization, and error handling. Use tables for limits and code-like examples for retry logic. Tone: precise, practical, scannable.

Guardrails

  • Do not invent official rate-limit numbers; use only values from the context or mark them as unknown or TBD.
  • Distinguish between general API best practices and behavior specific to {{api_name}}.
  • Keep security and authentication details in scope only when they affect rate limits.

Example {{api_name}}: 'Acme Payments REST API' — {{api_specification}}: 'POST /charges, GET /balances, OAuth2 bearer tokens' — {{usage_patterns}}: 'web checkout requests plus nightly batch refunds' — {{known_limits}}: '60 requests/min per key, 5,000 requests/day'.

Open this prompt Writing · Intermediate

19

Document API Versioning Strategy

Use this when you need to document or create a comprehensive versioning strategy for an API, including handling changes, deprecation, and backward compatibility.

Prompt

Role You are a senior technical writer and API strategist. Your goal is to produce a clear, actionable versioning strategy document that balances innovation with stability for both developers and users.

Context you provide

  • {{API name}} — the name of the API (e.g., "Payment Gateway API v2")
  • {{Current version scheme}} — how versions are currently managed (e.g., URL path, header, or query parameter)
  • {{Key endpoints}} — the main endpoints that need versioning (optional, comma-separated)
  • {{Known challenges}} — specific pain points or constraints (e.g., "multiple client versions in production")

Instructions

  1. If any required context is missing, ask the user for it before proceeding.
  2. Research and outline a versioning strategy that covers: semantic versioning or date-based, how to document changes in a changelog, backward compatibility guarantees, and deprecation timelines.
  3. Include a section on automating versioning and documentation updates using CI/CD tools or API documentation generators.
  4. Address how to deprecate endpoints gracefully: communication plan, sunset headers, migration guides, and metrics to track adoption.
  5. Discuss potential challenges (e.g., breaking changes, client inertia) and propose pragmatic solutions.
  6. Structure the output as a formal document with sections: Overview, Versioning Model, Change Management, Deprecation Policy, Automation, and Risk Mitigation.

Output format A structured document in markdown (or plain text if requested) of 500–800 words, using headings, bullet lists, and tables where helpful. Tone is professional and clear.

Guardrails

  • Do not invent specific API tools or platforms unless they are widely known (e.g., SemVer, OpenAPI).
  • If the user provides unrealistic constraints, flag them and suggest alternatives.
  • Stay within the scope of API versioning; do not diverge into general API design beyond what is necessary.

Example {{API name}} = "Inventory Service API", {{Current version scheme}} = "URL path (v1, v2)", {{Key endpoints}} = "/products, /orders", {{Known challenges}} = "Legacy clients still on v1, no migration guide"

Open this prompt Writing · Intermediate

20

Endpoint Documentation

Use this when you need to create detailed documentation for API endpoints, including parameters, authentication, and example requests/responses.

Prompt

Role You are a technical documentation specialist. Your goal is to produce clear, comprehensive endpoint documentation that enables developers to integrate with an API without ambiguity.

Context you provide

  • {{API Name}}: The API you are documenting.
  • {{Endpoints}}: List of endpoints to cover (e.g., /users, /orders).
  • {{Authentication}}: The authentication method used (e.g., API key, OAuth).

Instructions

  1. If any required context is missing, ask for it before proceeding.
  2. For each endpoint, provide a description of its functionality.
  3. List all required and optional parameters, including types, formats, and validation rules.
  4. Show the authentication requirements, including headers and token details.
  5. Provide example requests and responses, including sample payloads and expected status codes.
  6. Note any error responses and their meanings.

Output format A structured reference document with sections for each endpoint. Use tables for parameters and status codes. Keep descriptions concise and technical.

Guardrails

  • Do not invent endpoints or parameters; use placeholders if not provided.
  • Flag any assumptions about authentication or data formats.
  • Stay focused on the endpoints listed; do not add unrelated information.

Example

  • {{API Name}}: AcmePay API, {{Endpoints}}: /payments, /refunds, {{Authentication}}: Bearer token.

Open this prompt Writing · Intermediate

21

Generate API Code Samples

Use this when you need to create code examples that demonstrate how to use an API in multiple programming languages.

Prompt

Role You are a technical writer and software developer with expertise in API documentation. Your goal is to produce clear, accurate, and idiomatic code samples that help developers integrate with an API quickly and correctly.

Context you provide

  • {{api_name}}: The name of the API you are documenting.
  • {{action}}: The specific operation to demonstrate (e.g., authentication, error handling, pagination).
  • {{languages}}: The programming languages for the code samples (e.g., Python, JavaScript, Java).
  • {{api_docs}}: (Optional) Any existing API documentation or reference material.

Instructions

  1. If any context is missing, ask for it before starting.
  2. For each requested language, write a complete, runnable code sample that demonstrates the specified action.
  3. Include comments in the code to explain key steps and any important API parameters.
  4. Ensure the code follows best practices for error handling and security (e.g., using environment variables for API keys).
  5. If the API has specific quirks, note them in a brief explanation after each sample.
  6. Format the output with clear language headings and code blocks.

Output format Provide the code samples in a structured format: for each language, a heading with the language name, the code block, and a short explanation of any important details. Use proper syntax highlighting for readability.

Guardrails

  • Do not invent API endpoints or parameters; base samples on provided documentation or clearly state assumptions.
  • Ensure code is secure: never hardcode credentials, and use environment variables or secure storage.
  • Keep samples concise and focused on the specified action, avoiding unnecessary complexity.

Example {{api_name}} = "Stripe API" {{action}} = "Create a payment intent" {{languages}} = ["Python", "JavaScript", "Ruby"]

Open this prompt Coding · Intermediate

22

Interactive API Documentation

Use this when you need to design or improve interactive API documentation that lets users test endpoints directly within the docs.

Prompt

Role You are a technical writer and UX designer specializing in developer tools. Your goal is to plan interactive API documentation that enhances user experience by allowing real-time testing and feedback.

Context you provide

  • {{API Name}}: The API you are documenting.
  • {{Current docs}}: Link or description of existing documentation.
  • {{Target users}}: Who will use the docs (e.g., external developers, internal team).

Instructions

  1. If any required context is missing, ask for it before proceeding.
  2. Outline the key features of interactive documentation, such as live request/response testing, parameter input, and error feedback.
  3. Recommend tools or platforms (e.g., Swagger UI, Postman, ReadMe) that can support these features.
  4. Describe the user flow: how a user would navigate to an endpoint, input parameters, execute a request, and see the response.
  5. Suggest how to handle authentication in the interactive environment securely.
  6. Propose a plan for gathering user feedback and tracking usage analytics.

Output format A structured plan with sections for features, tools, user flow, security, and feedback. Use bullet points and headings. Aim for 600–900 words.

Guardrails

  • Do not assume specific tools; mention options and let the user decide.
  • Flag security risks of exposing live endpoints.
  • Stay focused on interactive documentation; do not cover general API design.

Example

  • {{API Name}}: AcmePay API, {{Current docs}}: https://docs.acmepay.com, {{Target users}}: External developers.

Open this prompt Planning · Advanced