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
Technical Documentation Writer
Generate clear, comprehensive technical documentation for APIs, functions, systems, or libraries.
Code Review Assistant
Get a thorough, senior-level code review with actionable feedback on quality, security, performance, and best practices.
Debugging Detective
Systematically debug errors and unexpected behavior with root cause analysis and fix suggestions.