Books by finzkoDevelopers

Webhooks API

Register, list, update and delete your own webhook endpoints, and send a signed test ping. What we send to your endpoint (headers, body, signature, retries) is described on the Webhooks page.

Reading needs AIBooks.webhooks.READ. Register, update, delete and test all need AIBooks.webhooks.CREATE. None of these routes requires an Idempotency-Key.

Resource shape

{
  "id":               "6f1c0d7e-…",
  "url":              "https://your-app.example.com/webhooks/aibooks",
  "events":           ["INVOICE_CREATED", "PAYMENT_RECEIVED"],
  "is_active":        true,
  "description":      "Accounting sync",
  "last_status":      "DELIVERED",         // DELIVERED | RETRYING | FAILED | null
  "last_delivery_at": "2026-05-12T08:30:00"
}

The signing secret (whsec_…) is returned only in the create response. It is not returned by list or update and cannot be read again.

GET/webhooks/event_typesList subscribable eventsAIBooks.webhooks.READ
GET /webhooks/event_types

200 OK
{
  "code": 0,
  "message": "OK",
  "event_types": [
    "BILL_CREATED", "BILL_PAID", "CONTACT_CREATED", "CONTACT_UPDATED",
    "INVOICE_CREATED", "INVOICE_PAID", "INVOICE_UPDATED", "INVOICE_VOIDED",
    "ITEM_CREATED", "ITEM_UPDATED", "JOURNAL_POSTED",
    "PAYMENT_MADE", "PAYMENT_RECEIVED"
  ]
}

Note the key is event_types at the top level, not wrapped in a resource object, and there is no page_context.

GET/webhooksList your endpointsAIBooks.webhooks.READ

Returns every endpoint of the organization in one response (not cursor-paginated). page_context.has_more_page is always false.

200 OK
{
  "code": 0,
  "message": "success",
  "webhooks": [ { "id": "6f1c0d7e-…", "url": "https://…", "events": [ … ], "is_active": true, … } ],
  "page_context": { "per_page": 1, "has_more_page": false }
}
POST/webhooksRegister an endpointAIBooks.webhooks.CREATE

Body

FieldTypeNotes
urlstringRequired. https://, resolving to a public address.
eventsstring[]Event names from /webhooks/event_types. Default [], which subscribes to nothing.
descriptionstring?Free text.

Unknown fields are rejected (422 validation.failed).

POST /webhooks
Authorization: Bearer aibk_pat_…
Content-Type: application/json

{
  "url": "https://your-app.example.com/webhooks/aibooks",
  "events": ["INVOICE_CREATED", "PAYMENT_RECEIVED"]
}

200 OK
{
  "code": 0,
  "message": "Webhook created. Save the secret — it is shown once.",
  "webhook": {
    "id": "6f1c0d7e-…",
    "url": "https://your-app.example.com/webhooks/aibooks",
    "events": ["INVOICE_CREATED", "PAYMENT_RECEIVED"],
    "is_active": true,
    "description": null,
    "last_status": null,
    "last_delivery_at": null,
    "secret": "whsec_…"
  }
}

Notable errors

  • 400 validation.invalid_value — an event name is not in the list (Unknown event types: [...]), or the URL is not https, does not resolve, or points at a non-public address.
PATCH/webhooks/{webhook_id}Update an endpointAIBooks.webhooks.CREATE

Send any of url, events, is_active. Fields you omit are unchanged. Setting is_active to false pauses deliveries to that endpoint. Returns { code: 0, webhook: {…} }(no secret). The same 400 validation.invalid_value checks as create apply. Unknown ids return 404 not_found.resource.

DELETE/webhooks/{webhook_id}Delete an endpointAIBooks.webhooks.CREATE
200 OK
{ "code": 0, "message": "success", "webhook": { "id": "6f1c0d7e-…", "deleted": true } }
POST/webhooks/{webhook_id}/testSend a signed test pingAIBooks.webhooks.CREATE

Sends one request to the endpoint right away, signed with its secret, and reports what happened. It is not retried and does not create a delivery-log entry.

POST https://your-app.example.com/webhooks/aibooks
Content-Type:         application/json
X-AIBooks-Event:      ping
X-AIBooks-Signature:  t=1715492700,v1=8c4f1a9b…

{ "event": "ping", "data": { "message": "FinzBooks webhook test" }, "timestamp": 1715492700 }

The ping body differs from a real delivery: it has a timestamp field instead of occurredAt, and there is no X-AIBooks-Delivery-Id header. The signature scheme is the same.

200 OK
{ "code": 0, "message": "Test sent.", "test": { "delivered": true, "status_code": 200 } }

# If the request could not be made (DNS, timeout, refused):
{ "code": 0, "message": "Delivery failed.", "test": { "delivered": false, "error": "…" } }

delivered: true means your server answered; check status_code for whether it answered 2xx. The call itself returns HTTP 200 in both cases.