Webhook Management
Our Webhook REST API supports the following webhook management actions:
- Create account webhook
- Create group webhook
- Retrieve webhook details
- Update webhook
- Delete webhook
- Retrieve the list of webhooks
- Test webhook
Create account webhook
This endpoint allows you to create a new webhook for the current account.
Request
POST https://api.fivetran.com/v1/webhooks/account
{
"url": "https://your-host.your-domain/webhook",
"events": [
"sync_start",
"sync_end"
],
"active": true,
"secret": "my_secret"
}
Request parameters
Name | Description |
---|---|
url (required) | Your webhooks URL endpoint for your application |
events (required) | The array of event types |
active | Boolean, if set to true , webhooks are immediately sent in response to events. Optional. true by default. |
secret | The secret string used for payload signing. Optional. |
Response
HTTP 200 OK
{
"code": "Success",
"message": "Account webhook has been created",
"data": {
"id": "program_quoth",
"type": "account",
"url": "https://your-host.your-domain/webhook",
"events": [
"sync_start",
"sync_end"
],
"active": true,
"secret": "******",
"created_at": "2022-04-29T09:41:08.583Z",
"created_by": "_airworthy"
}
}
Fields
Name | Description | Possible values |
---|---|---|
code | Response status code | |
message | Response status text | |
data | Response data | |
id | The webhook ID | |
type | The webhook type | account |
url | Your webhooks URL endpoint for your application | |
events | The array of event types | |
active | Boolean, if set to true , webhooks are immediately sent in response to events | |
secret | The secret string used for payload signing and masked in the response. | |
created_at | The webhook creation timestamp | |
created_by | The ID of the user who created the webhook |
Create group webhook
This endpoint allows you to create a new webhook for a given group.
Request
POST https://api.fivetran.com/v1/webhooks/group/{group_id}
{
"url": "https://your-host.your-domain/webhook",
"events": [
"sync_start",
"sync_end"
],
"active": true,
"secret": "my_secret"
}
Path parameters
Name | Description |
---|---|
group_id (required) | The group ID |
Request parameters
Name | Description |
---|---|
url (required) | Your webhooks URL endpoint for your application |
events (required) | The array of event types |
active | Boolean, if set to true , webhooks are immediately sent in response to events. Optional. true by default. |
secret | The secret string used for payload signing. Optional. |
Response
HTTP 200 OK
{
"code": "Success",
"message": "Group webhook has been created",
"data": {
"id": "recur_readable",
"type": "group",
"group_id": "_moonbeam",
"url": "https://your-host.your-domain/webhook",
"events": [
"sync_start",
"sync_end"
],
"active": true,
"secret": "******",
"created_at": "2022-04-29T10:45:00.000Z",
"created_by": "_airworthy"
}
}
Fields
Name | Description | Possible values |
---|---|---|
code | Response status code | |
message | Response status text | |
data | Response data | |
id | The webhook ID | |
type | The webhook type | group |
group_id | The group ID | |
url | Your webhooks URL endpoint for your application | |
events | The array of event types | |
active | Boolean, if set to true , webhooks are immediately sent in response to events | |
secret | The secret string used for payload signing and masked in the response. | |
created_at | The webhook creation timestamp | |
created_by | The ID of the user who created the webhook. |
Retrieve webhook details
This endpoint allows you to retrieve details of the existing webhook for a given identifier.
Request
GET https://api.fivetran.com/v1/webhooks/{webhook_id}
Path parameters
Name | Description |
---|---|
webhook_id (required) | The webhook identifier |
Response
HTTP 200 OK
{
"code": "Success",
"data": {
"id": "recur_readable",
"type": "group",
"group_id": "_moonbeam",
"url": "https://your-host.your-domain/webhook",
"events": [
"sync_start",
"sync_end"
],
"active": true,
"secret": "******",
"created_at": "2022-04-29T10:45:00.000Z",
"created_by": "_airworthy"
}
}
Fields
Name | Description | Possible values |
---|---|---|
code | Response status code | |
data | Response data | |
id | The webhook ID | |
type | The webhook type | account , group |
group_id | The group ID | |
url | Your webhooks URL endpoint for your application | |
events | The array of event types | |
active | Boolean, if set to true , webhooks are immediately sent in response to events | |
secret | The secret string used for payload signing and masked in the response. | |
created_at | The webhook creation timestamp | |
created_by | The ID of the user who created the webhook. |
Update webhook
The endpoint allows you to update the existing webhook with a given identifier.
Request
PATCH https://api.fivetran.com/v1/webhooks/{webhook_id}
{
"url": "https://your-host.your-domain/webhook",
"events": [
"sync_end",
"sync_start"
],
"active": true,
"secret": "my_secret"
}
Path parameters
Name | Description |
---|---|
webhook_id (required) | The webhook identifier |
Request parameters
Name | Description |
---|---|
url | Your webhooks URL endpoint for your application |
events | The array of event types |
active | Boolean, if set to true , webhooks are immediately sent in response to events |
secret | The secret string used for payload signing and masked in the response. Optional. |
Response
HTTP 200 OK
{
"code": "Success",
"message": "Webhook has been updated",
"data": {
"id": "program_quoth",
"type": "account",
"url": "https://your-host.your-domain/webhook",
"events": [
"sync_start",
"sync_end"
],
"active": true,
"secret": "******",
"created_at": "2022-04-29T09:41:08.583Z",
"created_by": "_airworthy"
}
}
Fields
Name | Description | Possible values |
---|---|---|
code | Response status code | |
message | Response status text | |
data | Response data | |
id | The webhook ID | |
type | The webhook type | account , group |
group_id | The group ID | |
url | Your webhooks URL endpoint for your application | |
events | The array of event types | |
active | Boolean, if set to true , webhooks are immediately sent in response to events | |
secret | The secret string used for payload signing and masked in the response. | |
created_at | The webhook creation timestamp | |
created_by | The ID of the user who created the webhook. |
Delete webhook
This endpoint allows you to delete an existing webhook with a given identifier.
Request
DELETE https://api.fivetran.com/v1/webhooks/{webhook_id}
Path parameters
Name | Description |
---|---|
webhook_id (required) | The webhook identifier |
Response
HTTP 200 OK
{
"code": "Success",
"message": "Webhook with id 'webhook_id' has been deleted"
}
Retrieve the list of webhooks
The endpoint allows you to retrieve the list of existing webhooks available for the current account.
Request
GET https://api.fivetran.com/v1/webhooks
Request parameters
Name | Description |
---|---|
cursor | The paging cursor. Read more about pagination in our documentation |
limit | The number of records to fetch, accepts a number in the range of 1..1000, the default value is 100 |
Response
HTTP 200 OK
{
"code": "Success",
"data": {
"items": [
{
"id": "program_quoth",
"type": "account",
"url": "https://your-host.your-domain/webhook",
"events": [
"sync_start",
"sync_end"
],
"active": true,
"secret": "******",
"created_at": "2022-04-29T09:41:08.583Z",
"created_by": "_airworthy"
},
{
"id": "recur_readable",
"type": "group",
"group_id": "_moonbeam",
"url": "https://your-host.your-domain/webhook",
"events": [
"sync_start",
"sync_end"
],
"active": true,
"secret": "******",
"created_at": "2022-04-29T10:45:00.000Z",
"created_by": "_airworthy"
}
]
}
}
Fields
Name | Description | Possible values |
---|---|---|
code | Response status code | |
data | Response data | |
items | The collection of webhooks available for the current account | |
id | The webhook ID | |
type | The webhook type | account , group |
group_id | The group ID | |
url | Your webhooks URL endpoint for your application | |
events | The array of event types | |
active | Boolean, if set to true , webhooks are immediately sent in response to events | |
secret | The secret string used for payload signing and masked in the response. | |
created_at | The webhook creation timestamp | |
created_by | The ID of the user who created the webhook. |
Test webhook
The endpoint allows you to test an existing webhook. It sends a webhook with a given identifier for a dummy connector with identifier _connector_1
.
Request
POST https://api.fivetran.com/v1/webhooks/{webhook_id}/test
{
"event": "sync_start"
}
Path parameters
Name | Description |
---|---|
webhook_id (required) | The webhook identifier |
Request parameters
Name | Description |
---|---|
event (required) | Type of event that should be sent |
Response
HTTP 200 OK
{
"code": "Success",
"data": {
"succeed": true,
"status": 200,
"message": "SUCCESS"
}
}
Example of webhook payload
Fivetran sends webhooks with the following payload structure:
{
"event" : "sync_end",
"created" : "2021-08-18T11:38:34.386Z",
"connector_type" : "asana",
"connector_id" : "mystified_presiding",
"connector_name" : "mystified_presiding",
"sync_id" : "mystified_presiding",
"destination_group_id" : "deck_enjoy",
"data" : {
"status" : "SUCCESSFUL"
}
}
Fields
Name | Description | Possible Values |
---|---|---|
event | The event type | |
created | The event generation date | |
connector_type | The type of the connector for which the webhooks is sent | |
connector_id | The ID of the connector for which the webhooks is sent | |
connector_name | The name of the connector for which the webhooks is sent | |
sync_id | The sync for which the webhooks is sent | |
destination_group_id | The destination group ID of the connector for which the webhooks is sent | |
data | The response payload object. The object fields vary depending on the event type. | |
status | The webhook creation status | SUCCESSFUL , FAILED |