Skip to main content

Create Flexible Webhook

POST

Creates a Flexible Webhook subscription that matches Stream events against a CEL filter expression and delivers them to the endpoint you specify.

The signingKey is only exposed in plain text in this response. Store it securely.

Before creating a Flexible Webhook, call the Get Stream Schema API or List Flexible Streams API to check the available streamId values and the fields you can filter with a CEL expression.

Path Parameters
chainstringrequired
Parameter specifying the target chain to query.
networkstringrequired
Parameter specifying the network of the target chain.
Request Body
namestringrequired
The display name of the Flexible Webhook subscription. Up to 255 characters.
descriptionstring
An optional description of the Webhook subscription.
streamIdstringrequired
The unique ID of the on-chain data trackable via Flexible Webhook. You can look this up using the List Flexible Streams API.
filterExpressionstringrequired
A CEL (Common Expression Language) expression used to filter events. Use the List Flexible Streams API to view the stream's schema.
receiveFieldsarray
List of fields to include in the Webhook payload. If not specified, all fields from the stream are received.
destinationstringrequired
The endpoint URL to receive events.
reorgCorrectionEnabledboolean
Field that selects whether to apply reorg detection and correction. With this option enabled, when a reorg block occurs, the message affected by the reorg is re-sent under the same Sequence Number with the event.reorgRemoved: true tag. The information of the new block is then sent under a new Sequence Number.
Responses
subscriptionIdstring
The unique ID that identifies this Flexible Webhook.
projectIdstring
The ID of the project this Flexible Webhook belongs to.
accountIdstring
The ID of the account that created this Flexible Webhook.
namestring
The display name of the Flexible Webhook subscription.
descriptionstring
An optional description of the Flexible Webhook subscription.
chainstring
The name of the blockchain this Flexible Webhook is subscribed to.
networkstring
The network of the blockchain this Flexible Webhook is subscribed to.
streamIdstring
The unique ID of the on-chain data trackable via Flexible Webhook. You can look this up using the Get Stream Schema API or List Flexible Streams API.
streamSlugstring
The slug identifying this Stream.
filterExpressionstring
A CEL (Common Expression Language) expression used to filter events. Use the Get Stream Schema API or List Flexible Streams API to view the stream's schema.
receiveFieldsarray
List of fields included in the Webhook payload. If not specified, all stream fields are received.
deliveryChannelstring
The delivery channel for event data.
destinationstring
The endpoint URL that receives events for this Flexible Webhook subscription.
signingKeystring
The signing key used to authenticate Flexible Webhook notifications. After receiving a notification, use this key to verify its validity.The signing key is automatically generated when the Flexible Webhook is created and is only available in the creation response.
statusstring
The subscription status of this Flexible Webhook.
createdAtstring
The date and time this Flexible Webhook subscription was created (ISO 8601 format).
updatedAtstring
The date and time this Flexible Webhook subscription was last updated (ISO 8601 format).
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "MISSING_REQUIRED_PARAMETER",
"message": "Missing required parameter: { PARAMETER_NAME }"
}
cURL
curl -X POST 'https://web3.nodit.io/v1/avalanche/mainnet/flexible-webhooks' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"name": "usdt-transfer-monitor",
"description": "Monitor USDT transfers",
"streamId": "77",
"filterExpression": "address_eq(token_address, '0xdAC17F958D2ee523a2206206994597C13D831ec7')",
"receiveFields": [
"from_address",
"to_address",
"value"
],
"destination": "https://example.com/webhook"
}'