Setting up your first event trigger¶
Table of contents
You can use Hasura to setup event triggers that call configured webhooks whenever specific database events occur.
Let’s create a sample event trigger with https://httpbin.org as our simple webhook.
Create a table¶
Head to the Hasura console, navigate to Data -> Create table
and create a sample table called profile
with
the following columns:
profile (
id INT PRIMARY KEY,
name TEXT
)

Setup an event trigger¶
In the Hasura console, navigate to Events -> Create trigger
and:
- Enter trigger name as
echo
. - Select table
profile
from the table dropdown. - Select operations:
insert
,update
anddelete
. - Enter webhook URL as:
https://httpbin.org/post
.

This sets up our webhook https://httpbin.org/post
to receive database changes on an insert, update and delete on
profile
table.
Watch the trigger in action¶
- Insert some sample data into the
profile
table using theInsert Row
tab. - Now navigate to the
Events
tab and click on theecho
trigger in the left sidebar. - Expand the details of an event to see the response from the webhook.

Was this page helpful?
Thank you for your feedback!
Stay up to date with product & security news
See past editions