Webhook
A webhook lets YGL send data to your system automatically when a business event happens.
Examples: when a new lead is created, when a task is completed, or when a lead status changes, YGL can send an HTTP POST request to your URL.
Only organization-level integration users can view or manage webhooks. Referral source users cannot use these endpoints.
Requests
| Name | Method | Description |
|---|---|---|
| /api/webhooks | GET | Returns all webhooks available to the authenticated organization. |
| /api/webhooks/eventsByWebSite?webSite={webSite} | GET | Returns the supported event definition for the specified WebSite. |
| /api/webhooks | POST | Creates a new webhook subscription. |
| /api/webhooks/{id} | GET | Returns one webhook by id. |
| /api/webhooks/{id}/logs | GET | Returns recent delivery logs for the webhook from the last 30 days. |
| /api/webhooks/{id} | PUT | Updates an existing webhook. |
| /api/webhooks/{id} | DELETE | Deletes the webhook. |
| /api/webhooks/{id}/logs/{logId}/retry | POST | Retries delivery for a specific webhook log entry. Use this when a previous delivery failed or needs to be sent again. |
Request/Response Objects
The main object used by these endpoints is the Webhook object.
A webhook defines which event YGL should watch, which property it belongs to, and where YGL should send the outbound POST request.
Important: use the website-specific events endpoint to decide which Event values can be used for the selected WebSite.
Required Fields for POST
The following fields are required when creating a webhook:
- PropertyId: the property the webhook belongs to
- Event: the event name returned by
https://partner-api.youvegotleads.com/api/webhooks/eventsByWebSite?webSite=... - TargetUrl: the destination URL that will receive the POST request
- WebSite: the integration target name, such as
Zapier,NGrok, or your custom integration website
AuthenticationType, AuthenticationKey, and TriggerData are optional.
Webhooks
| Name | Type | Support PUT | Description |
|---|---|---|---|
| Id | int | - | The unique id of the webhook. |
| PropertyId | int | YES | The property this webhook applies to. Only events from this property can trigger the webhook. |
| Event | string | YES | The event that triggers the webhook. Use a value returned by https://partner-api.youvegotleads.com/api/webhooks/eventsByWebSite?webSite=..., for example NewLead or CompleteTask. |
| TargetUrl | string | YES | The HTTPS endpoint that will receive webhook POST requests from YGL. |
| WebSite | string | YES | Identifies the external integration target by name. Use a valid website target name such as Zapier, NGrok, or your custom integration website. The selected value must support the selected Event. |
| AuthenticationType | int? | YES | Optional authentication mode for outbound requests. If set to 1, YGL will use AuthenticationKey. |
| AuthenticationKey | string? (255) | YES | Optional secret, token, or credential used when authentication is enabled. |
| TriggerData | string? | YES | Optional configuration used to customize filtering or payload behavior for the webhook. |
Sample GET Requests
https://partner-api.youvegotleads.com/api/webhooks
https://partner-api.youvegotleads.com/api/webhooks/eventsByWebSite?webSite=NGrok
https://partner-api.youvegotleads.com/api/webhooks/1
https://partner-api.youvegotleads.com/api/webhooks/1/logs
Sample EventsByWebSite Request
https://partner-api.youvegotleads.com/api/webhooks/eventsByWebSite?webSite=NGrok
Sample EventsByWebSite Response
Use this endpoint to load the supported website definition and event list for a selected website in the client.
{
"Website": "NGrok",
"SupportedEvents": ["NewLead", "NewTask", "LeadStatusChanged", "LeadMovedIn", "DepositMade", "ScheduledMove", "LeadMovedOut", "LeadClosed", "PreTour", "PostTour", "CompleteTask", "NewTourTask"],
"Notes": "Supports all webhook events for testing and generic integrations."
}
Sample GET Response
[
{
"PropertyId": 141069,
"Id": 1044,
"Event": "NewTask",
"TargetUrl": "https://sample.com/api/v1/webhooks/tasks",
"WebSite": "NGrok",
"CreatedOn": "2024-12-10T06:24:42.66",
"AuthenticationType": 1,
"AuthenticationKey": "Bearer sampleAuth",
"TriggerData": "{\"task_TaskTypeId\":[\"29\",\"31\"]}"
},
{
"PropertyId": 141069,
"Id": 1045,
"Event": "CompleteTask",
"TargetUrl": "https://sample.com/api/v1/webhooks/tasks",
"WebSite": "NGrok",
"CreatedOn": "2024-12-10T06:38:19.873",
"AuthenticationType": 1,
"AuthenticationKey": "Bearer sampleAuth",
"TriggerData": "{\"task_TaskTypeId\":[\"29\",\"31\",\"33\"]}"
}
]
Sample POST Request
Include all required fields in the JSON body. Optional fields may be omitted if you do not use them.
https://partner-api.youvegotleads.com/api/webhooks
{
"PropertyId": 141069,
"Event": "CompleteTask",
"TargetUrl": "https://sample.com/api/v1/webhooks/tasks",
"WebSite": "NGrok",
"AuthenticationType": 1,
"AuthenticationKey": "Bearer sampleAuth",
"TriggerData": "{\"task_TaskTypeId\":[\"29\",\"31\",\"33\"]}"
}
Sample POST Response
If the webhook is created successfully, the API returns HTTP 201 and the created object. If creation fails, review the response body for the reason.
{
"PropertyId": 141069,
"Id": 3057,
"Event": "CompleteTask",
"TargetUrl": "https://sample.com/api/v1/webhooks/tasks",
"WebSite": "NGrok",
"CreatedOn": "2025-09-02T07:27:29.918762Z",
"AuthenticationType": 1,
"AuthenticationKey": "Bearer sampleAuth",
"TriggerData": "{\"task_TaskTypeId\":[\"29\",\"31\",\"33\"]}"
}
Sample PUT Request
https://partner-api.youvegotleads.com/api/webhooks/3057
Send the full set of updatable fields in the PUT body. If you leave out an updatable field, it may be overwritten.
{
"PropertyId": 141069,
"Event": "CompleteTask",
"TargetUrl": "https://sample.com/api/v1/webhooks/tasks",
"WebSite": "NGrok",
"AuthenticationType": 1,
"AuthenticationKey": "Bearer updatedSampleAuth",
"TriggerData": "{\"task_TaskTypeId\":[\"29\",\"31\",\"33\"]}"
}
Sample PUT Response
https://partner-api.youvegotleads.com/api/webhooks/3057
If the update succeeds, the API returns HTTP 200 and the updated object.
{
"PropertyId": 141069,
"Id": 3057,
"Event": "CompleteTask",
"TargetUrl": "https://sample.com/api/v1/webhooks/tasks",
"WebSite": "NGrok",
"CreatedOn": "2025-09-02T07:27:29.918762Z",
"AuthenticationType": 1,
"AuthenticationKey": "Bearer updatedSampleAuth",
"TriggerData": "{\"task_TaskTypeId\":[\"29\",\"31\",\"33\"]}"
}
Common Error Responses
| Message | What it means |
|---|---|
| Event not recognized. | The Event value is not supported. Use /api/webhooks/eventsByWebSite?webSite=... to get valid values for the selected website. |
| System actor not recognized. | The internal integration target could not be resolved. |
| Website 'X' not found. | The WebSite value is not valid. Use a valid website target name. |
| Property not recognized. | The property does not exist or the authenticated user does not have access to it. |
| Duplicate Data | A webhook with the same PropertyId, Event, WebSite, and TargetUrl already exists. |
| Event 'X' is not supported for system actor 'Y'. | The selected Event and WebSite are not an allowed combination. Use /api/webhooks/eventsByWebSite?webSite=... to load the event list for the selected website. |
| You do not have access to this webhook. | The webhook exists, but the authenticated organization is not allowed to view or manage it. |