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

GET /api/webhooks

List webhooks.

Sample request

$ curl {WEAVY_SERVER}/api/webhooks
-H "Authorization: Bearer {WEAVY_APIKEY}"

Parameters

Name Type Required Description
q string False
tag string False
trashed boolean False
order_by string False
top integer False
skip integer False
count boolean False
count_only boolean False

Responses

Status code 200

application/json

{
  "data": [
    "object"
  ],
  "start": "integer",
  "end": "integer",
  "count": "integer"
}

Register webhook

POST /api/webhooks

Registers a webhook.

Sample request

$ curl {WEAVY_SERVER}/api/webhooks
-H "Authorization: Bearer {WEAVY_APIKEY}"
-H "Content-Type: application/json"
-d "{'payload_url': 'http://mywebsite.com/api/webhooks', 'triggers': ['notifications']}"

Request body

application/json

{
  "payload_url": "string",
  "secret?": "string",
  "triggers": [
    "string"
  ],
  "enabled?": "boolean"
}

Note. Properties marked with ? are optional.

Responses

Status code 201

application/json

{
  "id": "integer",
  "payload_url": "string",
  "triggers": [
    "string"
  ],
  "is_enabled": "boolean"
}
Status code 400

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}

Get webhook

GET /api/webhooks/{id}

Get a webhook by id.

Sample request

$ curl {WEAVY_SERVER}/api/webhooks/1
-H "Authorization: Bearer {WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True The unique identifier of the hook.

Responses

Status code 200

application/json

{
  "id": "integer",
  "payload_url": "string",
  "triggers": [
    "string"
  ],
  "is_enabled": "boolean"
}
Status code 404

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}

Update webhook

PATCH /api/webhooks/{id}

Update a webhook registration.

Sample request

$ curl -X PATCH {WEAVY_SERVER}/api/webhooks/1
-H "Authorization: Bearer {WEAVY_APIKEY}"
-H "Content-Type: application/json"
-d "{ 'triggers': ['notifications', 'comments'] }"

Parameters

Name Type Required Description
id integer True The unique identifier of the hook.

Request body

application/json

{
  "payload_url": "string",
  "secret?": "string",
  "triggers": [
    "string"
  ],
  "is_enabled?": "boolean"
}

Note. Properties marked with ? are optional.

Responses

Status code 204

No Content

Status code 404

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}
Status code 400

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}

Delete webhook

DELETE /api/webhooks/{id}

Delete a webhook

Sample request

$ curl -X DELETE {WEAVY_SERVER}/api/webhooks/1
-H "Authorization: Bearer {WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True The unique identifier of the hook.

Responses

Status code 204

No Content


List webhook deliveries

GET /api/webhooks/{id}/deliveries

List webhook deliveries.

Sample request

$ curl {WEAVY_SERVER}/api/webhooks/1/deliveries?top=20
-H "Authorization: Bearer {WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True Webhook id
action string False
q string False
tag string False
trashed boolean False
order_by string False
top integer False
skip integer False
count boolean False
count_only boolean False

Responses

Status code 200

application/json

{
  "data": [
    "object"
  ],
  "start": "integer",
  "end": "integer",
  "count": "integer"
}

Weavy Docs