Webhooks
Webhooks allow you to integrate more deeply with Vrite and automate various tasks like publishing. They serve as customizable HTML callbacks that are triggered in response to various events, like a content piece being moved or a new member being added to the workspace. The API lets you create and manage webhooks associated with your workspace.
Retrieve Webhook
Retrieves details of the webhook specified by ID.
ID of the webhook
ID of the webhook
URL for the webhook to send data to
Name of the webhook
Description of the webhook
ID of the content group the webhook event is connected with
Event that triggers the webhook
contentPieceUpdatedcontentPieceAddedcontentPieceRemovedcontentGroupAddedcontentGroupRemovedcontentGroupMovedmemberInvitedmemberAddedmemberRemoved
Whether the webhook is associated with an extension
curl --request GET \
--url "https://api.vrite.io/webhooks?id={ID}" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Accept: application/json'
const client = createClient({
token: "<API_TOKEN>",
});
const result = await client.webhook.get({
id: "1b396703e04491a752262178"
});
{
"id": "1b396703e04491a752262178",
"url": "string",
"name": "string",
"description": "string",
"metadata": {
"contentGroupId": "4398d64edb8ac4db90de0f36"
},
"event": "contentPieceUpdated",
"extension": true
}
List Webhooks
Lists existing webhooks. Supports pagination and filtering for webhooks associated with extensions.
Number of webhooks to return per page
Page number to fetch
Last webhook ID to starting fetching webhooks from
Whether to only fetch webhooks associated with the extension
ID of the webhook
URL for the webhook to send data to
Name of the webhook
Description of the webhook
ID of the content group the webhook event is connected with
Event that triggers the webhook
contentPieceUpdatedcontentPieceAddedcontentPieceRemovedcontentGroupAddedcontentGroupRemovedcontentGroupMovedmemberInvitedmemberAddedmemberRemoved
Whether the webhook is associated with an extension
curl --request GET \
--url "https://api.vrite.io/webhooks/list" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Accept: application/json'
const client = createClient({
token: "<API_TOKEN>"
});
const result = await client.webhooks.list({
// Optional
page: 1,
// Optional
perPage: 20,
// Optional
extensionOnly: true
});
[
{
"id": "de2fb21ad4bbb929cf73ee5a",
"url": "string",
"name": "string",
"description": "string",
"metadata": {
"contentGroupId": "ef69f28cc9538e5cb1580ea5"
},
"event": "contentPieceUpdated",
"extension": true
}
]
Create Webhook
Creates a webhook for the specified event with provided data.
URL for the webhook to send data to
Name of the webhook
Description of the webhook
Secret for signing webhook payload
ID of the content group the webhook event is connected with
Event that triggers the webhook
contentPieceUpdatedcontentPieceAddedcontentPieceRemovedcontentGroupAddedcontentGroupRemovedcontentGroupMovedmemberInvitedmemberAddedmemberRemoved
ID of the webhook
curl --request POST \
--url "https://api.vrite.io/webhooks" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"url": "{URL}",
"name": "{NAME}",
"event": "{EVENT}"
}'
const client = createClient({
token: "<API_TOKEN>",
});
const result = await client.webhooks.create({
url: "string",
name: "string",
// Optional
description: "string",
// Optional
secret: "string",
// Optional
metadata: {
// Required for webhooks for "contentPiece*" events
contentGroupId: "a70a17453ad260deb43e5192",
},
event: "contentPieceUpdated",
});
{
"id": "98ed3f1f2b861cd31f9cef16"
}
Update Webhook
Updates the webhook (including the event it’s registered for) with the provided data.
All properties except the secret of the webhook can be updated.
ID of the webhook
URL for the webhook to send data to
Name of the webhook
Description of the webhook
ID of the content group the webhook event is connected with
Event that triggers the webhook
contentPieceUpdatedcontentPieceAddedcontentPieceRemovedcontentGroupAddedcontentGroupRemovedcontentGroupMovedmemberInvitedmemberAddedmemberRemoved
curl --request PUT \
--url "https://api.vrite.io/webhooks" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "{ID}"
}'
const client = createClient({
token: "<API_TOKEN>",
});
await client.webhooks.update({
id: "2294b5fd7eb27ec7c61675e1",
url: "string",
name: "string",
description: "string",
metadata: {
contentGroupId: "636e825f62661160fb170413",
},
event: "contentPieceUpdated",
});
Delete Webhook
Deletes the webhook specified by ID.
ID of the webhook
curl --request DELETE \
--url "https://api.vrite.io/webhooks?id={ID}" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Accept: application/json'
const client = createClient({
token: "<API_TOKEN>",
});
await client.webhooks.delete({
id: "2294b5fd7eb27ec7c61675e1",
});