Webhooks in Brightsy AI allow external systems to trigger scenarios or receive notifications when events occur. This guide will walk you through the process of managing webhooks for integrating Brightsy with your external applications and services.
Table of Contents
- Accessing Webhooks
- Creating a New Webhook
- Editing an Existing Webhook
- Testing a Webhook
- Deleting a Webhook
- Understanding Webhook Fields
- Using Webhooks with Scenarios
- Troubleshooting
1. Accessing Webhooks
To manage webhooks, navigate to the "Webhooks" section under Utilities in your account dashboard. Here, you will see a list of all existing webhooks associated with your account.
Webhook Properties
| Property | Type | Description | Required | Constraints |
|---|---|---|---|---|
| id | string | Unique identifier for the webhook | Auto-generated | Read-only |
| name | string | Name of the webhook | Yes | 2-100 characters |
| description | string | Description of the webhook's purpose | No | Max 1000 characters |
| status | enum | Current state of the webhook | Yes | Values: "active", "inactive" |
| scenarioId | string | ID of the scenario to trigger | Yes | Must exist in the system |
| secret | string | Secret key for webhook verification | Auto-generated | Used for HMAC signature |
| url | string | The webhook endpoint URL | Auto-generated | Read-only |
| createdAt | datetime | When the webhook was created | Auto-generated | Read-only |
| updatedAt | datetime | When the webhook was last updated | Auto-generated | Read-only |
2. Creating a New Webhook
- Navigate to Webhooks: Go to the "Webhooks" section from Utilities in your account dashboard.
- Click "Create New Webhook": This button is located at the top right of the webhooks list.
- Fill in the Webhook Details: Enter the name and optional description for your webhook.
- Select a Scenario: Choose the scenario that should be triggered when the webhook receives a request.
- Set the Status: Choose whether the webhook should be active immediately.
- Save the Webhook: Click the "Save" button to create the webhook.
- Copy the Webhook URL: After creation, copy the generated webhook URL to use in your external systems.
3. Editing an Existing Webhook
- Select a Webhook: Click on the webhook you wish to edit from the list.
- Modify the Details: Update any fields as necessary, such as changing the name, description, scenario, or status.
- Save Changes: Click the "Save" button to apply your changes.
4. Testing a Webhook
- Select a Webhook: Choose the webhook you want to test.
- Click "Test Webhook": Use the test button to send a sample payload.
- Review the Response: Check the response to ensure the webhook is configured correctly.
- Check Scenario Execution: Verify that the linked scenario was triggered successfully.
5. Deleting a Webhook
- Select a Webhook: Choose the webhook you want to delete.
- Access the Danger Zone: Scroll to the bottom of the webhook details page.
- Delete the Webhook: Click the "Delete" button in the Danger Zone section. Confirm the deletion when prompted.
6. Understanding Webhook Fields
- Name: A descriptive identifier for your webhook.
- Description: A brief explanation of the webhook's purpose and what triggers it.
- Status: Indicates whether the webhook is active (receiving requests) or inactive.
- Scenario: The scenario that will be executed when the webhook receives a valid request.
- Secret: A secure key used to verify that incoming requests are authentic. Include this in your request headers.
- URL: The unique endpoint URL that external systems should send requests to.
7. Using Webhooks with Scenarios
Sending a Request to Your Webhook
To trigger a webhook, send an HTTP POST request to your webhook URL:
curl -X POST https://app.brightsy.ai/api/webhooks/{webhook-id} \
-H "Content-Type: application/json" \
-H "X-Webhook-Secret: your-webhook-secret" \
-d '{"key": "value", "data": "your payload"}'
Request Headers
| Header | Description | Required |
|---|---|---|
| Content-Type | Should be application/json | Yes |
| X-Webhook-Secret | Your webhook's secret key for verification | Yes |
Request Body
The request body should be a valid JSON object. This data will be passed to the linked scenario as input.
Response Codes
| Code | Description |
|---|---|
| 200 | Webhook received and scenario triggered successfully |
| 400 | Invalid request body or missing required headers |
| 401 | Invalid or missing webhook secret |
| 404 | Webhook not found |
| 500 | Internal server error |
8. Troubleshooting
Webhook Not Triggering
- Verify that the webhook status is set to "Active"
- Check that the correct scenario is linked
- Ensure the X-Webhook-Secret header matches your webhook's secret
Authentication Errors
- Double-check that you're using the correct webhook secret
- Ensure the secret is included in the X-Webhook-Secret header
Scenario Not Executing
- Verify the linked scenario is enabled
- Check that the scenario's agent is properly configured
- Review the scenario's instruction to ensure it can handle the webhook payload
Invalid Payload Errors
- Ensure your request body is valid JSON
- Check that required fields expected by the scenario are included
For further assistance, please contact Brightsy AI support or refer to the in-app help resources.