v1

latestSwagger 2.02026-07-1745100168.1 KB
hooks

Create hook

post/hooks

Request body

batch_flush_interval_secinteger

BatchFlushIntervalSec is the maximum time a batch may sit before being flushed even when below BatchMaxItems. 0 = use HooksConfig default, then DefaultHookBatchFlushIntervalSec.

batch_max_itemsinteger

BatchMaxItems caps the number of events bundled into one HTTP POST body. 0 = use HooksConfig.BatchMaxItems, then DefaultHookBatchMaxItems. Ignored for File hooks (they always write one event per line).

batch_max_queue_itemsinteger

BatchMaxQueueItems caps the per-hook in-memory queue (pending + re-queued failures). When exceeded, the OLDEST events are dropped with a warning log so the queue never grows unbounded against an unreachable target. 0 = use HooksConfig default, then DefaultHookBatchMaxQueueItems.

enabledboolean
event_typesDomainEventType[]

EventTypes filters which events trigger delivery. Empty = all events.

idstring
max_retriesinteger

MaxRetries is the number of delivery attempts before giving up. 0 means use the server default (3). For HTTP hooks this caps retries inside a single batch flush; events that still fail are re-queued for the next flush regardless of MaxRetries.

metadataobject

Metadata holds user-defined key-value pairs merged into every event payload delivered by this hook. Useful for tagging events with custom context (e.g. environment, tenant ID, region) without modifying the server config.

namestring
secretstring

HMAC-SHA256 signing secret (HTTP only)

targetstring

HTTP(S) URL or absolute file path

timeout_secinteger

TimeoutSec is the per-attempt delivery timeout in seconds. 0 means use the server default (10s).

type'http' | 'file'

Response

Created