Trigger conditions
Optionally, you can create up to 5 trigger conditions for a webhook. Only events that meet all of the conditions will be sent to your endpoint. A condition rule consist of a field, a value, and an operator. You can choose from predefined condition fields or create a custom JSONPath query extracting the field you want to match.
Predefined conditions
The easiest way to create a condition is to select a field from a list of predefined fields for each event type.
For example, if you want to be notified when a payment is received on an address, then after selecting trigger type "Transaction" you will be able to create a rule for a field "Receiver", paste the address to the input, and you are all set.
Transaction event
Field | Description | Example |
---|---|---|
recipient | Bech32 encoded address or stake address of the recipient (entry in transaction outputs) | addr1q8q8gdh8j229a683ghk4rd5u5tj2mmq9gh2fk3cxe8c20gjk4gdu3... stake1u9t25x7gs7rzxnstrvqdc7qzkt7c95mcus52tsfmazsem6q8xwujq |
sender | Bech32 encoded address or stake address (entry in transaction inputs) | addr1q8q8gdh8j229a683ghk4rd5u5tj2mmq9gh2fk3cxe8c20gjk4gdu3... stake1u9t25x7gs7rzxnstrvqdc7qzkt7c95mcus52tsfmazsem6q8xwujq |
policy id | Asset policy id | 00000002df633853f6a47465c9496721d2d5b1291b8398016c0e87ae |
asset hex | Concatenation of policy id and hex-encoded asset name | 00000002df633853f6a47465c9496721d2d5b1291b8398016c0e87ae6e7574636f696e |
fingerprint | CIP14 based user-facing fingerprint | asset12h3p5l3nd5y26lr22am7y7ga3vxghkhf57zkhd |
quantity | Quantity of the asset in Lovelaces | 10 |
Blockfrost Secure Webhooks support stake addresses as either a receiver or a sender. All addresses belonging to the same account will match the account stake address.
Block event
Field | Description | Example |
---|---|---|
pool id | Bech32 encoded pool id | pool1pu5jlj4q9w9jlxeu370a3c9myx47md5j5m2str0naunn2q3lkdy |
tx count | Number of transactions in the block | 1 |
size | Block size in bytes | 12000 |
height | Block number | 15243593 |
total fees | Total fees within the block in Lovelaces | 592661 |
total output | Total output within the block in Lovelaces | 128314491794 |
Epoch event
Field | Description | Example |
---|---|---|
epoch number | number of the current epoch | 340 |
In order to receive notifications every time a new epoch starts, do not set any condition.
Delegation event
Field | Description | Example |
---|---|---|
pool id | Bech32 encoded pool id of delegated stake pool | pool1pu5jlj4q9w9jlxeu370a3c9myx47md5j5m2str0naunn2q3lkdy |
JSONPath query
JSONPath is a query language for JSON, similar to XPath for XML. JSONPath defines a string syntax for selecting and extracting values within a JSON. You can make use of JSONPath query to specify the JSON field that should be extracted and matched against a specified value.
To help you prepare the query, use built-in JSONPath Query editor. The editor is preloaded with a sample data. It matches your JSONPath query and shows the extracted field value in real time.
You can match all types of values: strings, numbers, booleans, floats, and null. Numeric values are automatically detected making use of operators such as <, <=, >, >= possible. If the extracted value is an array, then only one of the array items needs to match the specified value in order to satisfy the condition.
Note that evaluation expressions are disabled.
Examples
Transaction minting new assets
Sends a request to the endpoint every time a new asset is minted or burned.
- Trigger event: Transaction
- JSONPath Query:
$.tx.asset_mint_or_burn_count
- Operator:
>
- Value to match:
0
Transaction consumed specific UTXO
Sends a request to the endpoint once the UTXO (transaction hash) is used as an input in another transaction.
- Trigger event: Transaction
- JSONPath Query:
$.inputs..tx_hash
- Operator:
=
- Value to match:
<TX-HASH>
Stake Pool saturation over 90%
Sends a request for every delegation that results in stake pool saturation being above 90 %.
- Trigger event: Delegation
- JSONPath Query:
$.pool.live_saturation
- Operator:
>
- Value to match:
0.9