Webhooks
The Webhooks API enable you to register and manage webhooks. You can also use the API to list webhook deliveries for a webhook.
List webhooks
List webhooks.
GET /api/webhooks
Query parameters
q
stringA query used to find matching items.
tag
stringList items with the specified tag.
trashed
booleanIndicates whether trashed items should be listed (default is
false
). Specifynull
to return both trashed and non-trashed items.
order_by
stringSpecifies the sort order and direction for the listing, e.g. "
name
" or "name+desc
"
top
integerMaximum number of items to return in the listing. Should be a value between
0
and100
. Default is25
.
skip
integerThe number of items to skip. Used together with
top
to return a specific range of items (for pagination).
count
booleanfalse
to skip counting the total number of matching items; default istrue
.
count_only
booleantrue
to only return the number of matching items; when this is specified the response will only contain thecount
property.
Response codes
200 Success
{
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
}
Code sample
curl https://{WEAVY-SERVER}/api/webhooks
-H "Authorization: Bearer {API-KEY}"
Register webhook
Registers a webhook.
POST /api/webhooks
Body parameters
payload_url
string requiredThe URL to which the payloads will be delivered.
secret
stringIf provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers.
triggers
array of strings requiredA list of event groups that will trigger this webhook.
enabled
booleanGets or sets a value indicating wheter the webhook is enabled (if notifications are sent when the webhook is triggered).
Response codes
201 Created
{
"id": "integer",
"payload_url": "string",
"triggers": [
"string"
],
"is_enabled": "boolean"
}
400 Bad Request
Code sample
curl https://{WEAVY-SERVER}/api/webhooks
-H "Authorization: Bearer {API-KEY}"
-H "Content-Type: application/json"
-d "{'payload_url': 'http://mywebsite.com/api/webhooks', 'triggers': ['notifications']}"
Get webhook
Get a webhook by id.
GET /api/webhooks/{id}
Path parameters
id
integer requiredThe unique identifier of the hook.
Response codes
200 Success
{
"id": "integer",
"payload_url": "string",
"triggers": [
"string"
],
"is_enabled": "boolean"
}
404 Not Found
Code sample
curl https://{WEAVY-SERVER}/api/webhooks/1
-H "Authorization: Bearer {API-KEY}"
Update webhook
Update a webhook registration.
PATCH /api/webhooks/{id}
Path parameters
id
integer requiredThe unique identifier of the hook.
Body parameters
payload_url
string requiredThe URL to which the payloads will be delivered.
secret
stringIf provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers.
triggers
array of strings requiredA list of event groups that will trigger this webhook.
is_enabled
booleanIndicates if the webhook is enabled (if notifications are sent when the webhook is triggered).
Response codes
204 No Content
404 Not Found
400 Bad Request
Code sample
$ curl -X PATCH {WEAVY_SERVER}/api/webhooks/1
-H "Authorization: Bearer {API-KEY}"
-H "Content-Type: application/json"
-d "{ 'triggers': ['notifications', 'comments'] }"
Delete webhook
Delete a webhook
DELETE /api/webhooks/{id}
Path parameters
id
integer requiredThe unique identifier of the hook.
Response codes
204 No Content
Code sample
$ curl -X DELETE {WEAVY_SERVER}/api/webhooks/1
-H "Authorization: Bearer {API-KEY}"
List webhook deliveries
List webhook deliveries.
GET /api/webhooks/{id}/deliveries
Path parameters
id
integer requiredWebhook id
Query parameters
action
string
q
stringA query used to find matching items.
tag
stringList items with the specified tag.
trashed
booleanIndicates whether trashed items should be listed (default is
false
). Specifynull
to return both trashed and non-trashed items.
order_by
stringSpecifies the sort order and direction for the listing, e.g. "
name
" or "name+desc
"
top
integerMaximum number of items to return in the listing. Should be a value between
0
and100
. Default is25
.
skip
integerThe number of items to skip. Used together with
top
to return a specific range of items (for pagination).
count
booleanfalse
to skip counting the total number of matching items; default istrue
.
count_only
booleantrue
to only return the number of matching items; when this is specified the response will only contain thecount
property.
Response codes
200 Success
{
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
}
Code sample
curl https://{WEAVY-SERVER}/api/webhooks/1/deliveries?top=20
-H "Authorization: Bearer {API-KEY}"