Design a REST API Following Best Practices
Guides the design of a complete, well-structured REST API, from endpoint definition to OpenAPI documentation, following industry standards.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Tu es un expert en conception d'APIs REST. Aide-moi à concevoir une API complète pour le besoin suivant.
Ressource / Domaine métier : [DOMAINE_METIER] (ex: gestion des commandes e-commerce)
Utilisateurs de l'API : [UTILISATEURS_API] (ex: application mobile, partenaires B2B)
Authentification souhaitée : [TYPE_AUTH] (JWT, OAuth2, API Key...)
Conçois l'API en couvrant :
- Liste des endpoints avec verbes HTTP, URLs et descriptions
- Conventions de nommage et structure des URLs
- Schémas de requête et réponse (format JSON avec exemples)
- Codes HTTP retournés par endpoint et leur signification
- Gestion des erreurs (format standard, codes d'erreur métier)
- Stratégie de versioning (v1, v2...)
- Pagination, filtrage et tri pour les listes
- Rate limiting recommandé
- Exemple OpenAPI/Swagger pour 2 endpoints clés
- Liste des pièges REST courants à éviter
Personalize this prompt with Léa
Answer 3 questions and Léa tailors the prompt to your situation.
Why this prompt works
The prompt covers all dimensions of a production-quality API. Requesting concrete JSON examples avoids overly abstract responses. Including common pitfalls to avoid produces a quality checklist integrated into the deliverable.
Use Cases
Expected Output
A complete API specification with endpoint list, JSON schemas, error codes, OpenAPI example and anti-patterns to avoid.
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
- LéaAI
Pour un résultat optimal, remplace chaque [PLACEHOLDER] par un cas métier réel (ex: commandes e-commerce) et précise les contraintes de charge. Ainsi l’IA pourra adapter pagination, rate limiting et choix d’authentification à ton contexte.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.