P
IntermediateAll AIs

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 :

  1. Liste des endpoints avec verbes HTTP, URLs et descriptions
  2. Conventions de nommage et structure des URLs
  3. Schémas de requête et réponse (format JSON avec exemples)
  4. Codes HTTP retournés par endpoint et leur signification
  5. Gestion des erreurs (format standard, codes d'erreur métier)
  6. Stratégie de versioning (v1, v2...)
  7. Pagination, filtrage et tri pour les listes
  8. Rate limiting recommandé
  9. Exemple OpenAPI/Swagger pour 2 endpoints clés
  10. 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

Starting a new backend projectStandardizing a team APIsPreparing documentation for API partners

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 Optimizer

Comments

  • 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.

Go further