P
🤖AutomatisationIntermediate4 steps

Automatic REST API Documentation Generator Agent

This agent analyzes your source code or API specifications to automatically generate complete and structured technical documentation. It produces endpoint descriptions, data schemas, request/response examples, and documented error handling. The result is ready to integrate into a developer portal or export in OpenAPI format.

documentation techniqueAPI RESTcode cleanautomatisationdéveloppement backend

For who

Backend developers, tech leads, and DevOps teams looking to quickly document their REST APIs without manually writing each endpoint.

Input

Type: text
Format: code source

Code source de l'API (fichiers de routes, contrôleurs, modèles, middleware) ou spécification partielle des endpoints à documenter. Formats acceptés : JavaScript/TypeScript (Express, NestJS), Python (FastAPI, Django), PHP (Laravel), Java (Spring Boot), ou toute description textuelle des endpoints.

steps (4)

1

Source Code Analysis and Endpoint Extraction

prompt

Scans source code to identify and inventory all API endpoints and their characteristics.

2

Description and Data Schema Generation

prompt

Generates detailed descriptions and data schemas for each endpoint.

3

Request and Response Example Creation

prompt

Creates realistic copy-paste ready usage examples for each endpoint.

4

Final Documentation Compilation

prompt

Assembles all elements into polished documentation ready for publication.

Output

Type: text
Format: structuré

Documentation API complète incluant : description de chaque endpoint, schémas JSON Schema des requêtes et réponses, exemples cURL et multi-langages, gestion des erreurs, guide d'authentification et modèles de données. Format Markdown ou OpenAPI selon le choix utilisateur.

Example

Input

// routes/users.js (Express)
router.get('/api/v1/users', authMiddleware, async (req, res) => {
  const { page = 1, limit = 20, role } = req.query;
  const users = await User.find(role ? { role } : {}).skip((page-1)*limit).limit(limit);
  const total = await User.countDocuments(role ? { role } : {});
  res.json({ data: users, pagination: { page, limit, total } });
});

router.post('/api/v1/users', authMiddleware, adminOnly, async (req, res) => {
  const { email, name, role } = req.body;
  if (!email || !name) return res.status(400).json({ error: 'Email and name required' });
  const user = await User.create({ email, name, role: role || 'user' });
  res.status(201).json({ data: user });
});

Output

## Users

### GET /api/v1/users
**Lists users** with pagination and optional role filtering.
- Auth: Bearer token required
- Query params: page (number, default: 1), limit (number, default: 20), role (string, optional)
- Response 200: { data: User[], pagination: { page, limit, total } }

```curl
curl -H 'Authorization: Bearer eyJhb...' 'https://api.example.com/api/v1/users?page=1&limit=20&role=admin'
```

### POST /api/v1/users
**Creates a new user.** Restricted to administrators.
- Auth: Bearer token required + admin role
- Body: { email (string, required), name (string, required), role (string, default: 'user') }
- Response 201: { data: User }
- Error 400: { error: 'Email and name required' }

Customization

ParameterDescriptionDefault
format_sortieFormat du document de documentation final généré par l'agentMarkdown
langLangue de rédaction de la documentation (français, anglais, etc.)français
lang_sdkLangage pour les exemples de code SDK côté clientJavaScript (fetch)

Technical Notes

This agent works optimally with structured source code using popular frameworks (Express, NestJS, FastAPI, Django REST, Spring Boot, Laravel). For less common frameworks, provide comments or annotations in the code to improve endpoint detection.

The Markdown output format can be converted to OpenAPI 3.0 YAML by adding this instruction in the step 4 prompt. For very large APIs (50+ endpoints), it is recommended to split the code by module and run the agent multiple times, then merge the results.

Generated examples use realistic fictional data. Always verify validation constraints and error codes against your actual implementation before publishing the documentation.

Related Prompts

⚡ProductiviteAdvancedAll AIs

Churn Prediction

Proactively prevent churn

0319
⚡ProductiviteBeginnerAll AIs

Non-Disclosure Agreement (NDA)

NDA

0380
⚡ProductiviteIntermediateAll AIs

Create effective contextual reminders and alerts

Design a contextual reminders and alerts system that ensures follow-up on critical tasks without overloading your team with notifications.

190571
⚡ProductiviteIntermediateAll AIs

Prompt Mistral to Synthesize a Meeting

Professional meetings generate a considerable amount of information that is often difficult to remember and structure afterwards. Whether it's a weekly team stand-up, a steering committee, or a creative brainstorming session, synthesizing a meeting is a time-consuming but essential exercise to ensure decision tracking and team coordination. Mistral, the French language model, excels at this task thanks to its nuanced understanding of French and its ability to prioritize information. By providing a transcription or raw meeting notes, Mistral can produce a structured report in seconds, complete with key points, decisions made, action items, and identified owners. This approach not only saves valuable time but also ensures no critical information is forgotten. Whether you are a project manager, executive assistant, or member of an agile team, using Mistral to synthesize your meetings will transform how you document and track your professional exchanges.

0493