Skip to main content
短.be

Webhook

A mechanism that automatically sends an HTTP request to a specified URL when a specific event occurs. Enables real-time service integration.

Oct 29, 2025 · About 1 min read

Analytics

A webhook is a mechanism where a service automatically sends an HTTP request (typically POST) to a pre-registered URL when a specific event occurs. It's like giving someone your phone number and saying "call me when something happens" - enabling event-driven service integration.

The opposite of webhooks is polling, where you repeatedly ask "any updates?" at regular intervals. Polling is inefficient because requests are made even when nothing has changed. Webhooks only fire when events occur, providing better real-time responsiveness with lower server load.

In URL shortening services, webhooks can notify you in real-time when links are clicked. For example, you could receive instant Slack notifications for important campaign link clicks, or automatically feed click data into your own database.

Several considerations are important when implementing webhooks. First, the receiving endpoint must be publicly accessible over HTTPS. Second, retry logic for failed deliveries needs consideration - most services retry with exponential backoff, but events may be lost if the receiver is down for extended periods. Third, verifying the webhook sender through signature validation (HMAC-SHA256) is a critical security measure.

Webhooks are widely used across modern web services: GitHub (push notifications), Stripe (payment confirmations), Slack (message posting), and many more. Automation platforms like Zapier and IFTTT are built on webhooks internally. Related books are available on Amazon.

Share on XHatena

Was this article helpful?

Related Terms

Related Articles

FAQ

What's the difference between webhooks and APIs?
APIs are "pull" - you send a request to get information. Webhooks are "push" - the server sends you a notification when an event occurs. APIs are on-demand; webhooks are real-time. Use each based on your needs.
What happens if a webhook delivery fails?
Most services retry several times with increasing delays. After exhausting retries, the notification is discarded. For critical data, consider placing a message queue (like SQS) between the webhook and your processing logic.
How do I secure webhook endpoints?
Verify the sender by checking the HMAC signature included in request headers. Use HTTPS for your endpoint, and if possible, configure IP address whitelisting for the sending service.

Ready to create a short URL?

Shorten a URL for Free