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 string

A query used to find matching items.

tag string

List items with the specified tag.

trashed boolean

Indicates whether trashed items should be listed (default is false). Specify null to return both trashed and non-trashed items.

order_by string

Specifies the sort order and direction for the listing, e.g. "name" or "name+desc"

top integer

Maximum number of items to return in the listing. Should be a value between 0 and 100. Default is 25.

skip integer

The number of items to skip. Used together with top to return a specific range of items (for pagination).

count boolean

false to skip counting the total number of matching items; default is true.

count_only boolean

true to only return the number of matching items; when this is specified the response will only contain the count 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 required

The URL to which the payloads will be delivered.

secret string

If provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers.

triggers array of strings required

A list of event groups that will trigger this webhook.

enabled boolean

Gets 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}"
--json "{'payload_url': 'https://www.example.com/webhooks/incoming', 'triggers': ['notifications']}"

Get webhook

Get a webhook by id.

GET /api/webhooks/{id}
Path parameters
id integer required

The 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 required

The unique identifier of the hook.

Body parameters
payload_url string required

The URL to which the payloads will be delivered.

secret string

If provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers.

triggers array of strings required

A list of event groups that will trigger this webhook.

is_enabled boolean

Indicates 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 https://{WEAVY_SERVER}/api/webhooks/1
-H "Authorization: Bearer {API-KEY}"
--json "{ 'triggers': ['notifications', 'comments'] }"

Delete webhook

Delete a webhook

DELETE /api/webhooks/{id}
Path parameters
id integer required

The unique identifier of the hook.

Response codes

204 No Content

Code sample
curl -X DELETE https://{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 required

Webhook id

Query parameters
action string
q string

A query used to find matching items.

tag string

List items with the specified tag.

trashed boolean

Indicates whether trashed items should be listed (default is false). Specify null to return both trashed and non-trashed items.

order_by string

Specifies the sort order and direction for the listing, e.g. "name" or "name+desc"

top integer

Maximum number of items to return in the listing. Should be a value between 0 and 100. Default is 25.

skip integer

The number of items to skip. Used together with top to return a specific range of items (for pagination).

count boolean

false to skip counting the total number of matching items; default is true.

count_only boolean

true to only return the number of matching items; when this is specified the response will only contain the count 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}"
Weavy Docs