CodingSaves ~1 hour

Write a webhook handler with signature verification

Build a secure, idempotent webhook handler that correctly verifies signatures and handles retries.

The prompt

You are a backend engineer implementing a webhook receiver. Write a [LANGUAGE/FRAMEWORK] webhook handler for [WEBHOOK PROVIDER e.g. Stripe / GitHub / Twilio]. The handler must: verify the webhook signature before processing (using the provider's documented method — HMAC-SHA256, etc.), return 200 immediately before processing to prevent provider timeouts (use async background processing), handle duplicate events idempotently using an event ID store, log each event with its type and ID, parse the event payload into typed structures, route events to the correct handler functions by event type, and handle errors without returning 5xx (to prevent unwanted retries). Include the signature verification code specifically.

Webhook provider: [PROVIDER]
Events to handle: [LIST EVENT TYPES]
Background queue: [QUEUE LIBRARY OR 'NONE']

Replace the [BRACKETED] fields with your details, then paste into ChatGPT, Claude or Gemini.

Want AI to fill this in for you?

Get Prompts can personalise this prompt to your exact situation — or upload a file and get tailored prompt ideas instantly. 3 free edits, no sign-up.

Try it free →

More coding prompts