Receive and process webhooks safely
Prompt that plans a webhook receiver with signature check, a quick response and protection against duplicate events. Paste it into an AI tool of your choice, which then plans the webhook receiver.
- Topic
- Apps & prototypes
- Type
- Prompt
- Level
- Intermediate
- Time
- about 10 min
Results depend on the tool, the model and what you enter.
Result preview
Example: written by our editors, not real AI output.
POST /webhooks/payments 1. Verify the signature over the raw body; timestamp older than 5 minutes → 400 2. Event ID already in the webhook_events table → 200 straight away, do nothing 3. Store the entry (ID, type, received, status "open") → 200 in under 1 second 4. Queue: fetch the current payment state from the provider, unlock the order 5. Error → up to 5 retries with growing gaps, then status "failed" and an alert Tests: wrong signature, same event twice, "refunded" before "paid", database unreachable Assumption: the sender retries deliveries for up to three days
Fill in
What you type stays in this browser window. We store and send nothing.
- payments from a payment provider
- new orders from a shop system
- changes in a code repository
- form submissions
- status updates from a shipping service
- unlock the order
- update the record in the CRM
- post a message to the team chat
- start a build
- create an invoice
- Python with FastAPI
- Node.js with Express
- PHP with Laravel
- Go
- a serverless cloud function
Your prompt
You have edited the prompt. Changes in the fields above no longer overwrite it.
This is an instruction for an AI, not the result itself.
Where this prompt works
These AI tools are a good fit for this prompt:
How to use it
- Fill in the fields or tap a suggestion. Leave out names, addresses and other personal data.
- Copy the finished prompt into an AI tool of your choice.
- Send the same test event twice and one with altered content. The first may take effect only once, the second must be rejected.
Why does this work?
Senders often deliver webhooks more than once, late or out of order. Keeping signature check, event ID and the quick response cleanly separate prevents double bookings and lost events.
Tips
- Do not keep the secret in the code; store it in a protected environment variable and plan how to rotate it.