CRMcy Docs

Hooks

Subscribe to domain events via webhooks and in-process handlers.

Last updated 2026-05-05

CRMcy emits a typed event for every meaningful state change — invoice.finalized, payment.received, ticket.replied, lead.converted, etc. You can subscribe two ways: configure a Webhook (HTTPS POST signed with HMAC-SHA256, retried with exponential backoff) at Settings → Developer → Webhooks, or register an in-process handler in code by importing @crmcy/hooks and emitting/subscribing through the typed bus. The pipe app forwards external webhooks; the worker app processes the in-process handlers.

Each delivery records its status, latency, and response body for the last 30 days so you can debug a misbehaving consumer without writing your own audit log.

Related endpoints

  • GET /api/tenant/webhooks — list subscriptions.
  • POST /api/tenant/webhooks — subscribe to one or more events.
  • POST /api/tenant/webhooks/:id/test — fire a sample event.
  • GET /api/tenant/webhooks/:id/deliveries — recent delivery log.
  • Internal: packages/hooks/src/bus.ts — typed in-process emitter.

See the source at apps/web/src/app/(tenant)/settings/developer/webhooks, apps/api/src/webhooks, and apps/pipe.