THE GITHTML FIELD GUIDE
A webhook event contract template for receivers
Document a webhook event as a delivery contract, not just a sample JSON body. Include the triggering condition, payload version, verification requirements, delivery identity, ordering assumptions, retry or redelivery behavior, and expected receiver response. Verify provider-specific details and label unknown guarantees explicitly rather than assuming every webhook service behaves like the one you used previously.
Define the event and delivery separately
An event describes something that happened; a delivery is an attempt to communicate it to a receiver. Keep those concepts distinct in the document so readers can reason about duplicates and retries. State which object changed, the action that triggers the event, and whether the payload represents a snapshot or a reference requiring another fetch. Record the provider and API version. Do not infer a stable order from a handful of observed deliveries. If the provider does not promise ordering or exactly-once processing, say what is unknown and link its actual contract rather than inventing a reassuring guarantee.
Fill a receiver-focused contract
The template below includes fields a receiver implementer needs before writing handlers. Use a redacted or synthetic payload and explain optional fields, identifiers, timestamps, and null values. Describe signature verification by linking the provider's current instructions; do not improvise cryptographic guidance from a generic template. Document the expected acknowledgment and any processing-time constraints only after verifying them for that provider. Include how a delivery can be identified and how manual redelivery differs from automatic retry. GitHub's webhook guidance is a useful concrete primary example, but its headers and behavior should not be copied into a different provider's contract without evidence.
Event name and provider:
Trigger condition:
Payload version and sample:
Event identifier:
Delivery identifier:
Verification reference:
Acknowledgment expectation:
Retry / redelivery policy:
Ordering guarantee:
Receiver processing notes:
Test scenarios:Review with realistic delivery scenarios
Walk through a normal delivery, a duplicate, an out-of-order event if possible, an invalid signature, and a temporarily unavailable receiver. Record what the contract says the receiver should do in each case and which details remain application decisions. Use a test endpoint and safe sample data; the template does not authorize replaying production events. Keep secret values out of examples and logs. Review the document when payload schemas or provider delivery policies change. A complete event page should help a reader distinguish trusted data from unverified input and delivery acknowledgment from completion of the business operation. Include a payload evolution note identifying additive fields and breaking changes according to the provider's policy. Receivers need to know which assumptions are safe to encode and which require tolerant parsing.
- Separate event identity from delivery-attempt identity and verify provider guarantees.
- Document schema, verification, acknowledgment, and replay behavior with source links.
- Use synthetic payloads and approved test endpoints for examples.
- Review normal, duplicate, invalid, delayed, and unavailable-receiver scenarios before publication.
Sources and further reading
AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.