Logotipo Hedhog

Get Hedhog updates in your inbox

New releases, fresh recipes, and breaking changes — no spam.

Back to Core modulesWired in CoreModule
webhook-integration module screenshot

Core Submodule

webhook-integration

Manages inbound webhooks, event catalog and action/log pipelines.

Source path: libraries/core/src/webhook-integration

Module file: webhook-integration.module.ts

Introduction

The Webhook Integration submodule is HedHog's automation backbone, enabling event-driven workflows in both directions: receiving arbitrary payloads from external systems and dispatching actions or notifications when internal domain events occur.

Each inbound webhook integration is assigned a unique UUID that forms its receive URL: POST /webhook/:uuid. External systems — payment providers, form services, CI/CD pipelines, IoT devices — can POST any JSON payload to this URL. The server validates an optional HMAC signature (using the integration's secret against the raw request body) and passes the payload through the integration's ordered action pipeline.

An action pipeline is a sequence of actions that execute in order when the webhook fires. Five action types are available. Email sends a transactional message using a Mail submodule template, with payload fields substituted into template variables. HTTP Request performs an outbound call to any URL with configurable method, headers, body, timeout, and retry count. Internal API calls a HedHog endpoint by path, enabling webhook-triggered operations like creating records or generating reports. App Command dispatches a registered application command by slug with typed parameters, decoupling the webhook handler from specific implementation details. WhatsApp via Evolution API sends a message to a phone number or group through a configured Evolution integration profile.

Event-based outbound webhooks (event-webhook) subscribe to domain events from the integration event catalog and deliver the event payload to a configured external URL whenever the event fires. This is how HedHog pushes data out to external systems: when a user is created, a purchase completes, or a status changes, subscribed event webhooks are notified in near real time via the outbox processor.

Each webhook integration carries a UUID (used in the receive URL) and a secret (used for HMAC validation). Both can be independently regenerated via dedicated endpoints without recreating the integration or losing its action definitions, supporting credential rotation without downtime. POST /webhook-integration/:id/duplicate clones an integration including all of its actions, simplifying the creation of similar automation pipelines.

Every invocation is logged. GET /webhook-integration/:id/log returns paginated historical logs. GET /webhook-integration/:id/log/stream opens a Server-Sent Events stream for real-time debugging, making it possible to trace failures and verify payload transformations without switching to an external observability tool.

HTTP Endpoints

32 endpoints

List all webhook integrations.

Query
page, pageSize, search

List API tokens belonging to a user.

Query
userId (int)

Create a new API token for a user.

Body

FieldTypeRequiredNotes
userIdnumberyes
namestringyes

List internal application routes available as webhook targets.

List application commands available for webhook action dispatch.

Get webhook integration details by ID.

Params
id (int)

Create a new webhook integration.

Body

FieldTypeRequiredNotes
namestringyes
urlstringno
secretstringno
headersRecord<string, string>no

Update a webhook integration.

Params
id (int)

Body

FieldTypeRequiredNotes
namestringno
urlstringno
secretstringno
headersRecord<string, string>no

Delete one or more webhook integrations.

Body

FieldTypeRequiredNotes
idsnumber[]yesIDs to delete

Regenerate the UUID used in the webhook receive URL.

Params
id (int)

Regenerate the secret token for a webhook integration.

Params
id (int)

Duplicate a webhook integration including its actions.

Params
id (int)

List actions defined for a webhook integration.

Params
id (int)

Create an action for a webhook integration.

Params
id (int)

Body

FieldTypeRequiredNotes
type"email" | "whatsapp_evolution" | "http_request" | "internal_api" | "app_command"yes
namestringno
ordernumberno
status"active" | "inactive"no
integration_profile_idnumberno
mail_idnumbernoRequired when type is "email"
email_tostringno
email_ccstringno
email_bccstringno
http_urlstringnoRequired when type is "http_request"
http_methodstringno
http_headersRecord<string, string>no
http_bodystringno
http_timeout_msnumberno
http_retry_countnumberno
internal_api_pathstringnoRequired when type is "internal_api"
internal_api_methodstringno
internal_api_bodyobjectno
app_command_slugstringnoRequired when type is "app_command"
app_command_paramsobjectno
whatsapp_target_type"phone" | "group"no
whatsapp_targetstringno
whatsapp_templatestringno

Update a webhook action.

Params
id (int), actionId (int)

Body

FieldTypeRequiredNotes
(same fields as POST action)partialnoAll fields from create action are optional

Delete actions from a webhook integration.

Params
id (int)

Body

FieldTypeRequiredNotes
idsnumber[]yesIDs to delete

List execution logs for a webhook integration.

Params
id (int)
Query
page, pageSize, sort?

Stream live execution logs for a webhook integration via SSE.

Params
id (int)

Receive an incoming webhook request and trigger configured actions.

Params
uuid (string)

Body

FieldTypeRequiredNotes
(payload)anynoArbitrary JSON or form body forwarded to actions

List all event-based webhook configurations.

Query
page, pageSize, search

Get an event webhook by ID.

Params
id (int)

Create a new event-based webhook.

Body

FieldTypeRequiredNotes
eventCatalogIdnumberyes
urlstringyes
secretstringno
headersRecord<string, string>no

Update an event-based webhook.

Params
id (int)

Body

FieldTypeRequiredNotes
eventCatalogIdnumberno
urlstringno
secretstringno
headersRecord<string, string>no

Delete one or more event webhooks.

Body

FieldTypeRequiredNotes
idsnumber[]yesIDs to delete

Duplicate an event webhook configuration.

Params
id (int)

List delivery logs for an event webhook.

Params
id (int)
Query
page, pageSize

List all events in the integration event catalog.

Query
page, pageSize, search

Return event catalog entries formatted as select options.

Get a catalog event by ID.

Params
id (int)

Create a new event catalog entry.

Body

FieldTypeRequiredNotes
namestringyes
slugstringyes
descriptionstringno
schemaobjectnoJSON Schema of the event payload

Update an event catalog entry.

Params
id (int)

Body

FieldTypeRequiredNotes
namestringno
slugstringno
descriptionstringno
schemaobjectno

Delete one or more event catalog entries.

Body

FieldTypeRequiredNotes
idsnumber[]yesIDs to delete

MCP Tools

Named tools callable by AI models via the Model Context Protocol (MCP).

  • core.webhooks.*

    Full CRUD and management operations for webhook integrations

  • core.event-webhooks.*

    Full CRUD operations for event-to-webhook bindings

  • core.integration-events.*

    Full CRUD and catalog operations for integration events