Adding a Webhook Endpoint
You can add a webhook endpoint to your node by editing the node’s settings:- Navigate to your node and click Settings.
- Locate the field named Webhook URL.
- Enter the endpoint where you’d like to send requests.
- Note down your public key from the settings, as it will be used to verify requests.
Adding a Webhook When Creating a Node
When creating a new node via the API, you can provide a Webhook URL in the settings. This allows to send webhook notifications to your specified endpoint. You can update this URL later through the node’s settings if needed.Retrieve the Public Key
To verify webhook requests, retrieve the public key from: https://cloud-api.thunderstack.org/api/webhook-public-key This public key is used to validate theX-ThunderStack-Signature header included in each webhook event.
How Webhooks Work
When an event is triggered, ThunderStack sends a POST request to your webhook endpoint. The request includes:- A JSON payload with details about the event.
- A header named
X-ThunderStack-Signaturecontaining a digital signature created with ThunderStack’s private key.
Verification Steps
- Validate the Signature: Use the public key to verify the
X-ThunderStack-Signatureheader. - Validate the Payload: Ensure the
nodeIdin the payload matches the expected node or endpoint.
copy
Status Values
- RUNNING: The node is running.
- STARTING: The node is starting.
- PAUSED: The node is paused.
- FAILED: The node has failed.
- IN_PROGRESS: An operation is currently in progress.
Security Considerations
- Use HTTPS: Always use HTTPS for your webhook endpoint to ensure data security during transit.
- Signature Verification: Validate the
X-ThunderStack-Signatureheader using the public key. - Payload Validation: Ensure the
nodeIdfield matches the expected node.
copy