Donutwork Docs

Webhook API

Register, inspect, and remove webhook subscriptions for event-driven integrations.

Webhook API

Use webhooks to receive asynchronous notifications for supported platform events.


List Webhooks

GET
/2026-02-01/webhooks.json
Required permissionwebhooks:readApiAccessPermission::WEBHOOKS_READ

Query Parameters

sizeinteger
Maximum records per page (1-100).
pageinteger
Page index (1-based).

Responses

Paginated list of webhook subscriptions.

{
  "entities": "Webhook",
  "count": 2,
  "per_page": 100,
  "pages": {
    "current": 1,
    "max": 1
  },
  "elements": [
    {
      "id": "wh_001",
      "name": "Billing Events",
      "description": "Receive invoice and payment updates",
      "url": "https://example.com/webhooks/billing",
      "events": [
        "RecurringPayments.charge.paid"
      ],
      "token": "redacted"
    }
  ]
}

Create Webhook

POST
/2026-02-01/webhooks.json
Required permissionwebhooks:writeApiAccessPermission::WEBHOOKS_WRITE

Query Parameters

No query parameters required.

Request Body

JSON
{
  "webhook": {
    "name": "Billing Events",
    "description": "Receive invoice and payment updates",
    "url": "https://example.com/webhooks/billing",
    "events": [
      "RecurringPayments.charge.paid"
    ]
  }
}
webhook.namestringRequired
Display name of the webhook subscription.
webhook.urlstringRequired
HTTPS endpoint that receives webhook payloads.
webhook.eventsarray|stringRequired
Subscribed event names. A single event string is also accepted.
webhook.descriptionstring
Optional free-text description for internal use.

Responses

Webhook created successfully.

{
  "id": "wh_001",
  "name": "Billing Events",
  "description": "Receive invoice and payment updates",
  "url": "https://example.com/webhooks/billing",
  "events": [
    "RecurringPayments.charge.paid"
  ],
  "token": "generated_webhook_token"
}

Name, url, or events missing; or TLS certificate validation failed.

{
  "error": "A valid \"url\" must be specified."
}

URL format invalid or unsupported event specified.

{
  "error": "Some events are not available"
}

List Supported Webhook Types

GET
/2026-02-01/webhooks/types.json
Required permissionwebhooks:readApiAccessPermission::WEBHOOKS_READ

Query Parameters

No query parameters required.

Responses

List of available webhook event names for the company context.

[
  "RecurringPayments.charge.paid",
  "RecurringPayments.charge.failed"
]

Get Webhook

GET
/2026-02-01/webhooks/{webhookId}.json
Required permissionwebhooks:readApiAccessPermission::WEBHOOKS_READ

Query Parameters

webhookIdstringRequired
Webhook unique identifier.

Responses

Webhook details.

{
  "id": "wh_001",
  "name": "Billing Events",
  "description": "Receive invoice and payment updates",
  "url": "https://example.com/webhooks/billing",
  "events": [
    "RecurringPayments.charge.paid"
  ],
  "token": "redacted"
}

Webhook resource not found.

{
  "error": "Webhook not found."
}

Delete Webhook

DELETE
/2026-02-01/webhooks/{webhookId}.json
Required permissionwebhooks:writeApiAccessPermission::WEBHOOKS_WRITE

Query Parameters

webhookIdstringRequired
Webhook unique identifier.

Responses

Webhook deletion accepted.

{
  "id": "wh_001",
  "deleted": true
}

Webhook resource not found.

{
  "error": "Webhook not found. Unable to delete unknown resource"
}

On this page