Introduction to the Webhooks Table
The Webhooks table is designed to store and manage webhook configurations for companies within the Serial application. This table plays a crucial role in enabling real-time notifications and integrations with external systems based on specific triggers within the application.Table Structure
The Webhooks table is structured to maintain essential information about each webhook configuration. Here’s a detailed breakdown of its columns:| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | Unique identifier for each webhook configuration |
| company_id | uuid | foreign key references companies | The company associated with the webhook |
| trigger_type | text | The type of event that triggers the webhook | |
| url | text | The URL to which the webhook payload will be sent | |
| created_at | timestamp with time zone | Timestamp of when the webhook was created | |
| updated_at | timestamp with time zone | Timestamp of the last update to the webhook |
Usage and Functionality
The Webhooks table is designed to be flexible and secure, allowing companies to configure their own integrations. Here are some key points about its usage:-
Company-Specific Configurations: Each webhook is associated with a specific company through the
company_idforeign key, ensuring that companies can manage their own webhook integrations independently. -
Trigger-Based Notifications: The
trigger_typecolumn allows for different types of events to be configured as webhook triggers, providing flexibility in integration scenarios. - Security and Access Control: Row-level security policies are implemented to restrict access to webhook data. Only users with the ADMIN role for a specific company can SELECT, INSERT, UPDATE, or DELETE webhook records for that company.
- Automatic Updates: A function is in place to update process revisions when a process is updated, which may trigger webhooks to notify external systems of these changes.
Notes
- The table implements timestamps for creation and updates, allowing for auditing and tracking of webhook configuration changes.
- The table is designed to work in conjunction with other tables and functions in the database, particularly for process-related updates and notifications.

