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
Python FileNotFoundError Debugging Prompt
Debug Python FileNotFoundError from the exact traceback, resolved path, working directory, filesystem context, deployment environment, and failing operation.
Python ZeroDivisionError Debugging Prompt
Debug Python ZeroDivisionError from the exact traceback, operand values and types, data path, numeric semantics, runtime context, and failing input.
Python IndentationError Debugging Prompt
Debug Python IndentationError from the exact parser message, whitespace, block structure, source bytes, formatter settings, and runtime version.
Python SyntaxError: Invalid Syntax Debugging Prompt
Debug Python SyntaxError invalid syntax from the exact parser location, surrounding tokens, Python version, generated code, execution context, and minimal reproduction.
Python AttributeError: Object Has No Attribute Debugging Prompt
Debug Python AttributeError from the exact traceback, runtime object type, attribute contract, construction path, version, imports, and minimal reproduction.
Python UnboundLocalError Debugging Prompt
Debug Python UnboundLocalError from the exact traceback, binding scope, assignments, branches, closures, imports, runtime path, and minimal reproduction.