Webhook

A webhook is an HTTP endpoint that Home Assistant exposes to receive data from external services — allowing any app or platform that can send an HTTP request to trigger automations or pass data into Home Assistant.

A webhook is a URL that Home Assistant exposes to receive incoming HTTP requests from external services. Where most Home Assistant integrations pull data from external sources on a schedule — polling an API every 30 seconds, for example — a webhook inverts the flow: the external service pushes data to Home Assistant the moment something happens, by sending an HTTP POST request to the webhook URL. The result is real-time, event-driven integration without the latency and inefficiency of polling.

Webhook: an external service sends an HTTP POST to a Home Assistant webhook URL, which triggers an automation

In Home Assistant, webhooks appear as a trigger type in the automation editor. When you create a webhook trigger, Home Assistant generates a unique URL — typically in the format https://your-instance/api/webhook/[random-id] — that you paste into the external service’s settings. From that point, whenever the external service fires its event, it sends an HTTP request to that URL, and Home Assistant immediately starts the automation. The request can carry a JSON payload with data from the external service, which Home Assistant makes available as template variables within the automation — allowing the automation to act on the specific values sent, not just the fact that a request arrived.

Webhooks are particularly useful for connecting services that don’t have a native Home Assistant integration. IFTTT, Zapier, GitHub, Shopify, and hundreds of other platforms support outgoing webhooks as a standard feature — meaning they can trigger Home Assistant automations without any custom code or dedicated integration. More advanced use cases include receiving data from custom scripts, microcontrollers running ESPHome or custom firmware, or other home automation systems that need to pass events into Home Assistant without sharing the same network.

Pro Tip: Keep webhook URLs private and use allowed hosts
A webhook URL is effectively a password — anyone who knows it can trigger your automation. Treat it accordingly: don’t share it publicly, don’t commit it to a public GitHub repository, and rotate it if you suspect it has been exposed. Home Assistant also supports restricting webhook triggers to local network requests only, which is the safest option for webhooks that don’t need to be triggered from outside your home network.

For two-way integrations — where Home Assistant both receives data from and sends data to an external service — webhooks pair naturally with the Home Assistant REST API and notification actions. A webhook receives the inbound trigger; a service call to the REST API or a notification action sends the outbound response. Node-RED simplifies this pattern further by providing HTTP input and output nodes that handle the request and response cycle in a single flow, making webhook-based integrations easier to build and debug than the equivalent YAML automation.

🏠 Fun Fact: The term “webhook” was coined by developer Jeff Lindsay in 2007 in a blog post proposing a standard way for web applications to notify each other of events in real time. The concept predates modern APIs by several years and was initially considered an obscure developer pattern — it is now one of the most widely implemented integration mechanisms across the entire software industry, used by GitHub, Stripe, Slack, and thousands of other platforms as their primary event notification method.

Related Articles

No post found!

Sources