---
# System prepended metadata

title: Webhooks for Stakehouse

---

# Webhooks for Stakehouse
### Webhooks for integrating Automatic reactions.

We want webhooks to be available to the various developers who want to build solutions on top of the stakehouse protocol (Blockswap team being a part of that).Webhooks are particularly useful for asynchronous events like when a validator is registered, a rage quit,minting of rewards etc. DeFi being something mostly defined by actions of bots, webhooks can be really helpful for people who want to work based on oppurtunities of the protocol.

## How To Register

Webhooks is something we want the various developers to use and thus want it to be as simplified as possible. Users can simply register their endpoint as they register their email for email notifications. The endpoints will simply be called as part of the webhook with a specified schema so that users can process it and use as per their need.
A webhook will enable you to push real-time notifications to the various users. You can use HTTPS to send these notifications as a JSON payload. Users can then use these notifications to execute actions in their backend systems. 

## How it works

Users will simply provide with their API endpoint and you can call that API with a JSON something like this-

```JSON{
  "id": "UUID",
  "event_name": "NAME",
  "created": 1633887337,
  "version": "1",
  "data": {
    "object": {...}
}
```

As you can see we simply send the event name and details to the API whenever a particular event happens. The users can select the alerts they want thus for every event all the APIs who have been subscribed can be called.

## What to provide in webhooks.

The webhooks are simply an alternative to the email notifications, You can provide the current email alerts only. To start out all the tristate properties can be addressed and whenever a property goes from say green to amber or red to green you can call the user APIs. Also users should be able to select the events they want to listen to thus the API should be called for those events only. It will be great if the webhook can do the following-

* Serve all the developers (Including Blockswap Team) and also provide them to register their APIs
* Calls all the APIs based on user's needs
* Should allow users to select events they want to listen to