API Endpoint Documentation Writer
Generate clear, developer-friendly API documentation for any endpoint including parameters, responses, and code examples.
Prompt Template
You are a senior developer writing API documentation. Document the following endpoint: Endpoint: [HTTP method + path, e.g., POST /api/v1/users] Purpose: [what it does] Auth required: [yes/no, method] Request body / params: [describe them] Response structure: [describe it] Language for examples: [e.g., JavaScript, Python, curl] Provide: 1. Endpoint overview (2-3 sentences) 2. Request parameters table (name, type, required, description) 3. Example request (code block) 4. Success response (code block with JSON) 5. Error responses (table with status codes and meanings) 6. Usage notes / rate limits
Example Output
POST /api/v1/users
Creates a new user account and returns a session token. Requires API key authentication via the `X-API-Key` header.
Request Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| email | string | Yes | Valid email address |
| password | string | Yes | Min 8 chars, 1 uppercase, 1 number |
| name | string | No | Display name (defaults to email prefix) |
Example Request
const res = await fetch('/api/v1/users', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-Key': 'your_key' },
body: JSON.stringify({ email: 'jane@example.com', password: 'Secure123' })
});
Success Response (201)
{ "id": "usr_abc123", "email": "jane@example.com", "token": "eyJ..." }
Errors
| Status | Code | Meaning |
|--------|------|---------|
| 400 | INVALID_EMAIL | Email format invalid |
| 409 | EMAIL_EXISTS | Account already exists |
Tips for Best Results
- 💡Always document error codes — developers spend more time handling errors than happy paths
- 💡Include a working curl example — it's the fastest way for any developer to test an endpoint
- 💡Version your endpoints from day one — it's much harder to add versioning retroactively
Frequently Asked Questions
What is the API Endpoint Documentation Writer prompt?
Generate clear, developer-friendly API documentation for any endpoint including parameters, responses, and code examples. It's a free ChatGPT prompt template from our Coding collection — copy it, fill in the bracketed variables, and paste it into your AI tool.
Which AI tools work with this prompt?
It's written and tested for ChatGPT, Claude and Gemini. Any AI assistant that accepts free-form text prompts will handle it well.
How do I customize this ChatGPT prompt?
Replace the bracketed variables — such as [what it does], [yes/no, method], [describe them] — with your own details before running it. Always document error codes — developers spend more time handling errors than happy paths
Is this prompt free to use?
Yes. Every prompt on PromptAtlas is free to copy, customize, and use — no signup required.
Related Prompts
JavaScript Cannot Read Properties of Undefined Debugging Prompt
Debug JavaScript's Cannot read properties of undefined error from the exact stack, runtime values, data flow, lifecycle timing, types, and minimal reproduction.
React Too Many Re-renders Error Debugging Prompt
Debug React's Too many re-renders error from the exact component, stack, state updates, event handlers, effects, framework mode, and minimal reproduction.
Git Detached HEAD Recovery Prompt
Recover safely from a Git detached HEAD using repository state, commit reachability, reflog evidence, worktree changes, remotes, and an explicit preservation-first plan.
npm ERESOLVE Error Debugging Prompt
Debug an npm ERESOLVE dependency-tree error from the exact command, peer-dependency conflict, package metadata, runtime versions, lockfile state, and minimal reproduction.
Next.js Hydration Error Debugging Prompt
Debug a Next.js hydration error from the exact server HTML, first client render, component boundary, versions, console output, and minimal reproduction.
Python ModuleNotFoundError Debugging Prompt
Debug Python ModuleNotFoundError from the exact traceback, interpreter, environment, import path, project layout, packaging metadata, and launch command.