The Webhook Object
Overviewβ
The Webhook object represents webhook configurations for receiving notifications from Verifik to your backend.
Attributesβ
clientβ
Type: ObjectId
Required: Yes
Reference to the client associated with the webhook. This is a required field that links the webhook to a specific client.
projectFlowβ
Type: Array of ObjectId
Required: No
Array of references to ProjectFlow objects. If no project flows are provided, this field defaults to an empty array.
statisticsβ
Type: Object
Required: No
Stores statistical data related to the webhook. By default, this field is an empty object {}.
isActiveβ
Type: Boolean
Required: Yes
Indicates whether the webhook is active. This is a required field and must be set to either true or false.
nameβ
Type: String
Required: Yes
The name of the webhook. This is a required field and must be provided as a string.
urlβ
Type: String
Required: Yes
The URL endpoint that the webhook will send notifications to. This is a required field and must be provided as a valid string.
descriptionβ
Type: String
Required: No
A brief description of the webhook. This is an optional field and can be used to add more context or details about the webhook.
notificationβ
Type: Object
Required: No
Contains notification settings for the webhook. The object has the following optional sub-fields:
- email -
String- Optional - Email address to which notifications will be sent. - success -
Boolean- Optional - Indicates whether to send notifications on successful events. Defaults tofalse. - fail -
Boolean- Optional - Indicates whether to send notifications on failure events. Defaults totrue.
Example Objectβ
{
"client": "613a4b978482f60fd31bd7b7",
"projectFlow": ["613a4b978482f60fd31bd7b8", "613a4b978482f60fd31bd7b9"],
"statistics": {},
"isActive": true,
"name": "Payment Processor Webhook",
"url": "https://example.com/webhook-endpoint",
"description": "This webhook handles payment processing notifications.",
"notification": {
"email": "notify@example.com",
"success": true,
"fail": false
}
}
Featuresβ
- Client Association: Links webhooks to specific clients
- Project Flow Integration: Connect webhooks to multiple project flows
- Notification Settings: Configure email notifications for success/failure events
- Statistics Tracking: Monitor webhook performance and usage
- Flexible Configuration: Optional fields for custom descriptions and settings