WTH Customise webhook responses

I would like to create a webhook automation and return data of my choosing. Custom HTTP reponse status would be a bonus.

My example use cases:

  • Monitoring - e.g use Uptime Kuma to monitor a sensor (or sensors) value.
  • CI/CD - use something like release August/ArgoCD to check installed integration versions and potentially follow up with updating integrations in HACS/Add-ons.
  • Use HA states to determine if a webhook call is a pass or fail.

I’m aware of the above is achievable in HA for the sake of brevity, please reach out separately if you are curious.

I’m not sure what you’re asking for here because you can do this with a webhook trigger in a “simple automation”. I say simple because it’s only a 2 or 3 step automation, parsing webhook information from a webhook trigger can be difficult if you don’t know data structures.

I’d like to pass my own data back in the webhook response.

I’m interested in the same thing. Right now, the application that calls the webhook only gets back an HTTP 200 OK response with no additional data. It would be quite useful to be able to template some data to send back to the caller, then proceed with starting the HA automation.

Looking at the source for the webhook component, it looks like this could be possible since in __init__.py, the async_register method does take a handler parameter for generating a response. In trigger.py, the handler _handle_webhook returns None, which causes the calling method to return the HTTP 200 OK with no additional data.

My specific use case for this scenario is to send a custom text response back to the caller and execute an automation that is not communicating directly with the caller.

Commenting the same as was done in other thread
Not sure why you want webhook to send the response body, this is not a standard.
You can just call a home assistant API and get the state data - the call via the API is also secure - specifically /api/states/<entity_id>. So if you want some custom data, here would be the steps:

  1. When you make a webhook call, your automation could update some data in particular entity of which you want your data as response
  2. After you get the 200 status from webhook, your client application can again make a API call for that entity. This would also be more performance since your client is not tied to sync call of webhook
    REST API | Home Assistant Developer Docs

Requesting a corporation to “just send a second request” is not feasable (Discord Developer Portal)