Webhooks
The Webhooks API enable you to register and manage webhooks. You can also use the API to list webhook deliveries for a webhook.
Register webhook
Registers a webhook.
POST /api/webhooks
Body parameters
payload_urlstringrequiredThe URL to which the payloads will be delivered.
secretstringIf provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers.
triggersarray of stringsrequiredA list of event groups that will trigger this webhook.
enabledbooleanGets or sets a value indicating wheter the webhook is enabled (if notifications are sent when the webhook is triggered).
Example request
curl {WEAVY-URL}/api/webhooks
-H "Authorization: Bearer {API-KEY}"
--json "{'payload_url': 'https://www.example.com/webhooks/incoming', 'triggers': ['notifications']}"
Response codes
201 Created
400 Bad Request
401 Unauthorized
403 Forbidden
422 Validation Failed
Response schema
{
"id": "integer",
"payload_url": "string",
"triggers": [
"string"
],
"is_enabled": "boolean"
}
Get webhook
Get a webhook by id.
GET /api/webhooks/{id}
Path parameters
idintegerrequiredThe unique identifier of the hook.
Example request
curl {WEAVY-URL}/api/webhooks/1
-H "Authorization: Bearer {API-KEY}"
Response codes
200 OK
401 Unauthorized
404 Not Found
Response schema
{
"id": "integer",
"payload_url": "string",
"triggers": [
"string"
],
"is_enabled": "boolean"
}
Update webhook
Update a webhook registration.
PATCH /api/webhooks/{id}
Path parameters
idintegerrequiredThe unique identifier of the hook.
Body parameters
payload_urlstringrequiredThe URL to which the payloads will be delivered.
secretstringIf provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers.
triggersarray of stringsrequiredA list of event groups that will trigger this webhook.
is_enabledbooleanIndicates if the webhook is enabled (if notifications are sent when the webhook is triggered).
Example request
curl -X PATCH {WEAVY-URL}/api/webhooks/1
-H "Authorization: Bearer {API-KEY}"
--json "{ 'triggers': ['notifications', 'comments'] }"
Response codes
200 OK
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
422 Validation Failed
Response schema
{
"id": "integer",
"payload_url": "string",
"triggers": [
"string"
],
"is_enabled": "boolean"
}
List webhooks
Returns the list of registered webhooks.
GET /api/webhooks
Query parameters
qstringA string used to find matching items by name, e.g.
q=test.
tagstringList items with the specified tag.
trashedbooleanIndicates whether trashed items should be listed (default is
false). Specifynullto list both trashed and non-trashed items.
order_bystringSpecifies the sort order and direction for the listing, e.g.
order_by=idororder_by=id+desc.
skipintegerThe number of items to skip. Used together with
taketo return a specific range of items (for pagination).
takeintegerMaximum number of items to return in the listing. Should be a value between
1and100. Default is25.
count_onlybooleantrueto count the number of matching items instead of listing them; when specified the response will only contain thecountproperty.
Example request
curl {WEAVY-URL}/api/webhooks
-H "Authorization: Bearer {API-KEY}"
Response codes
200 OK
401 Unauthorized
Response schema
{
"data": [
{
"id": "integer",
"payload_url": "string",
"triggers": [
"string"
],
"is_enabled": "boolean"
}
],
"start": "integer",
"end": "integer",
"count": "integer"
}
List webhook deliveries
List webhook deliveries.
GET /api/webhooks/{id}/deliveries
Path parameters
idintegerrequiredWebhook id
Query parameters
actionstring
qstringA string used to find matching items by name, e.g.
q=test.
tagstringList items with the specified tag.
trashedbooleanIndicates whether trashed items should be listed (default is
false). Specifynullto list both trashed and non-trashed items.
order_bystringSpecifies the sort order and direction for the listing, e.g.
order_by=idororder_by=id+desc.
skipintegerThe number of items to skip. Used together with
taketo return a specific range of items (for pagination).
takeintegerMaximum number of items to return in the listing. Should be a value between
1and100. Default is25.
count_onlybooleantrueto count the number of matching items instead of listing them; when specified the response will only contain thecountproperty.
Example request
curl {WEAVY-URL}/api/webhooks/1/deliveries?take=25
-H "Authorization: Bearer {API-KEY}"
Response codes
200 OK
401 Unauthorized
404 Not Found
Response schema
{
"data": [
{
"id": "integer",
"guid": "string",
"event_id": "integer",
"action": "string",
"delivered_at": "string",
"duration": "number",
"status_code": "integer",
"status": "string"
}
],
"start": "integer",
"end": "integer",
"count": "integer"
}
Delete webhook
Delete a webhook.
DELETE /api/webhooks/{id}
Path parameters
idintegerrequiredThe unique identifier of the hook.
Example request
curl -X DELETE {WEAVY-URL}/api/webhooks/1
-H "Authorization: Bearer {API-KEY}"
Response codes
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found