Webhook Contract Design

A webhook contract defining payload shape, retry behavior, and idempotency.

Advanced · Works with ChatGPT, Claude, Gemini, Copilot

The prompt

Design a webhook contract for this event.

Event being delivered and what the receiver does with it:
{{EVENT}}

What can go wrong in delivery (receiver downtime, network failure, etc.):
{{FAILURE_SCENARIOS}}

Define the payload schema including a unique event ID, the retry policy with backoff, and how the receiver should use the event ID to avoid processing a retried delivery twice. Say what the sender should do if retries are exhausted.

Why this prompt works

Designing idempotency around the event ID from the start prevents the classic webhook bug where a slow response triggers a duplicate side effect.

How to customize it

  • Include a scenario where the receiver processes successfully but the ack is lost
  • State a concrete backoff schedule, not just 'retry a few times'

Common mistakes

  • Assuming retries are safe without an idempotency key
  • Leaving exhausted-retry behavior (dead letter, alert) undefined

Example

Input

Event and receiver behavior: order.completed event; receiver updates inventory and sends a confirmation email

What a good answer looks like

A payload schema, retry/backoff policy, and an idempotency rule tied to the event ID.

Make this prompt fit your work

ModelCoach.ai scores your version, shows what to improve and explains why, right inside ChatGPT, Claude, Gemini and Copilot.

Related prompts