Create a Robust and Secure Webhooks API
A complete prompt to generate a production-ready webhooks API with subscription management, cryptographic signatures, intelligent retries and observability.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Tu es un développeur backend senior spécialisé en architecture événementielle. Conçois une API de webhooks complète pour [TYPE_APPLICATION] en utilisant [LANGAGE_ET_FRAMEWORK].
L'API doit inclure :
-
Gestion des abonnements :
- Endpoint CRUD pour enregistrer/modifier/supprimer des webhooks
- Validation de l'URL de destination (DNS resolution, blocage des IPs privées)
- Support de filtrage par type d'événement
- Stockage des abonnements avec statut actif/inactif/suspendu
-
Dispatch des événements :
- File d'attente asynchrone pour l'envoi (Redis, RabbitMQ ou équivalent)
- Payload JSON standardisé avec : id unique, timestamp, type d'événement, données, version du schema
- Envoi concurrent avec limite de débit configurable par subscriber
-
Sécurité :
- Signature HMAC-SHA256 des payloads (header X-Webhook-Signature)
- Secret unique par abonnement, généré côté serveur
- Endpoint de vérification (challenge/response) à l'enregistrement
- Rate limiting par IP et par subscriber
- Blocage des destinations vers des réseaux internes (SSRF protection)
-
Fiabilité et retries :
- Stratégie de retry avec backoff exponentiel ([NOMBRE_RETRIES] tentatives max)
- Timeouts configurables par requête (défaut : 10 secondes)
- Circuit breaker : désactivation automatique après [SEUIL_ECHECS] échecs consécutifs
- Notification à l'admin quand un webhook est suspendu
-
Observabilité :
- Logging structuré de chaque tentative (statut HTTP, latence, erreur)
- Table d'historique des livraisons consultable via API
- Dashboard endpoint avec métriques : taux de succès, latence P50/P95/P99, webhooks actifs
-
API endpoints :
- POST /webhooks — créer un abonnement
- GET /webhooks — lister les abonnements
- GET /webhooks/:id — détail d'un abonnement
- PUT /webhooks/:id — modifier
- DELETE /webhooks/:id — supprimer
- GET /webhooks/:id/deliveries — historique des livraisons
- POST /webhooks/:id/test — envoyer un événement de test
- GET /webhooks/events — lister les types d'événements disponibles
Fournis le code complet avec : modèles de données (schéma SQL ou ORM), routes, middleware d'authentification, service de dispatch, worker de file d'attente, et tests unitaires pour les fonctions critiques (signature, retry logic, validation URL). Ajoute des commentaires expliquant les choix d'architecture.
Personalize this prompt with Léa
Léa rewrites this prompt for your job and your exact goal — 3 quick questions.
Why this prompt works
<p>This prompt guides AI to produce a <strong>production-level webhooks API</strong>. It covers the six essential pillars: subscription management, async dispatch, security, reliability, observability and REST API design. Each section is detailed enough to avoid superficial implementations.</p><p>The <strong>[APPLICATION_TYPE]</strong> and <strong>[LANGUAGE_AND_FRAMEWORK]</strong> variables adapt the result to your exact context — whether it is a SaaS in Node.js/Express, a marketplace in Python/FastAPI or an app in Go/Gin. The <strong>[RETRY_COUNT]</strong> and <strong>[FAILURE_THRESHOLD]</strong> variables adjust the reliability policy to your constraints.</p><p>For better results, specify your database (PostgreSQL, MySQL), preferred queue system, and whether you need <strong>specific authentication</strong> (API key, OAuth, JWT). You can also request variants: serverless version, cloud provider integration, or added features like <strong>fan-out</strong> to multiple destinations or past event <strong>replay</strong>.</p>
Use Cases
Expected Output
Complete webhooks API source code with data models, REST routes, async dispatch service, retry worker, security middleware and unit tests, accompanied by comments on architecture choices.
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
Ajoute un timestamp dans la chaîne signée (pas seulement le body) et documente la fenêtre de tolérance (5 min) côté consommateur : sinon une signature HMAC reste rejouable indéfiniment. Prévois aussi un delivery_id idempotent renvoyé en header, pour que le client déduplique les retries. Et compare les signatures avec timingSafeEqual, jamais avec ==.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Similar Prompts
ChatGPT Prompt to Create a Software Architecture
Software architecture is the backbone of any development project. It determines maintainability, scalability, and performance of an application in the long run. Yet, designing a solid architecture requires deep expertise and a global vision that even experienced developers sometimes struggle to mobilize when faced with new constraints. ChatGPT becomes a strategic ally here: by providing it with a well-structured prompt, you get a complete architecture proposal integrating patterns adapted to your context, justified technology choices, and clearly explained trade-offs. Whether you are launching a startup, migrating a monolith to microservices, or designing a high-availability distributed system, ChatGPT helps you explore architectural options, identify technical risks upfront, and document your decisions. The goal is not to replace the architect, but to significantly accelerate the exploration and formalization phase, producing actionable deliverables from the first iteration.
Implement input validation
Validate and sanitize inputs
Plan a monolith-to-microservices migration
Migrate monoliths incrementally
Prompt to Automate Kubernetes Deployments Like a Pro
This prompt generates a complete, secure Kubernetes configuration, including YAML manifests, autoscaling and DevOps best practices tailored to your application.