Home/Glossary/Webhook

Webhook

An HTTP callback that delivers real-time data from one application to another when a specific event occurs.

DevelopmentAlso called: "http callback", "web callback", "event notification"

Webhooks enable event-driven automation by pushing data to your systems immediately when something happens, rather than requiring constant polling.

Why it matters

  • Real-time notifications: Get instant alerts when customers sign up, payments process, or security events occur.
  • Reduced infrastructure costs: Eliminate the need to constantly poll APIs for updates.
  • Better user experience: Respond to events immediately rather than waiting for the next polling cycle.
  • Lower API rate limit consumption: Receive data only when needed instead of checking repeatedly.

How webhooks work

  1. Configuration: Register your webhook URL with the service provider.
  2. Event occurs: Customer completes checkout, file upload finishes, user changes password, etc.
  3. HTTP POST: Provider sends event data to your webhook endpoint.
  4. Processing: Your application receives the payload and takes action.
  5. Acknowledgment: Return 200 OK to confirm receipt.

How to implement securely

  • Verify signatures: Validate HMAC signatures to ensure requests come from legitimate sources.
  • Use HTTPS only: Never accept webhooks over unencrypted HTTP connections.
  • Implement idempotency: Process duplicate events safely since webhooks may retry on failure.
  • Validate payloads: Check JSON schema and sanitize data before processing.
  • Set timeouts: Respond quickly (under 5 seconds) to avoid retries; process heavy work asynchronously.
  • Log everything: Record all webhook attempts for debugging and security audits.