events
Models for the Open WebUI event webhooks system.
Open WebUI emits structured events for a wide range of system activity (sign-ins, config changes, chat/file/knowledge actions, etc.). Administrators configure outbound event webhooks that receive matching events as HTTP POST deliveries. Each webhook filters by event name pattern and optionally restricts delivery to events whose actor/subject matches a set of users or groups.
The backing store is the events.webhooks config key (a list of webhook
dicts); there is no dedicated database table. The backend normalizes each
webhook dict via normalize_event_webhook in
refs/owui_source_main/backend/open_webui/events.py. Note that, unlike most
Open WebUI models, the created_at/updated_at timestamps here are
seconds since the epoch (not nanoseconds).
Classes
EventWebhookTarget
Bases: BaseModel
A single delivery target that scopes which events a webhook receives.
A webhook with targets == None receives events for all users and
system activity; targets == [] (empty) receives only system events with
no associated user; a non-empty list restricts delivery to events whose
actor or subject user matches one of the listed users, or belongs to one of
the listed groups.
EventWebhook
Bases: BaseModel
A normalized event webhook as stored in the events.webhooks config.
The id is server-assigned (UUID) on create. events and targets
together determine which emitted events get delivered to url. The
enabled flag toggles delivery without deleting the webhook.
- Code Reference routers events Classes EventsClient Functions
Attributes
id
Unique identifier (UUID). The special id 'default' is reserved for the
webhook migrated from the legacy single-webhook config.
name
Display name. Defaults to 'Default webhook' for the default id, else
'Webhook', when not provided.
url
Destination URL that receives event deliveries via HTTP POST. Validated
with the server-side URL allow-list (validate_url).
enabled
Whether this webhook is actively delivering events. When False, no
events match this webhook.
events
Event name filters that select which events are delivered.
Each entry must be one of:
- '*' — matches every event.
- 'prefix.*' — matches every event whose name starts with 'prefix.'
(e.g. 'chat.*', 'knowledge.file.*'). The prefix must correspond to at
least one real event in the catalog.
- An exact event name from the event catalog (e.g. 'user.created',
'auth.login', 'config.updated'). The full catalog is defined by
EventDefinitions in
refs/owui_source_main/backend/open_webui/events.py and is also available
via the GET /api/events catalog endpoint.
An empty/missing list defaults to ['*'].
targets
targets: Optional[list[EventWebhookTarget]] = None
Optional list of delivery targets restricting which users' events are
sent. None means all users plus system events; an empty list means system
events only. See EventWebhookTarget for the entry shape (type/id).
EventWebhookForm
Bases: BaseModel
Create/upsert body for POST /api/events/webhooks.
Mirrors EventWebhookForm in
refs/owui_source_main/backend/open_webui/main.py. On submit the backend
upserts by id: an existing webhook with the same id is replaced, otherwise
a new webhook is appended (with a server-generated id). url is required
and validated.
- Code Reference routers events Classes EventsClient Functions create_event_webhook
Attributes
events
Optional event filters; see EventWebhook.events. Defaults to ['*'].
targets
targets: Optional[list[EventWebhookTarget]] = None
Optional delivery targets; see EventWebhook.targets. Defaults to all.
Functions
to_payload
EventWebhookUpdateForm
Bases: BaseModel
Partial update body for PUT /api/events/webhooks/{webhook_id}.
Mirrors EventWebhookUpdateForm in
refs/owui_source_main/backend/open_webui/main.py. All fields optional; the
backend merges only the provided (non-None) fields onto the existing
webhook.
- Code Reference routers events Classes EventsClient Functions update_event_webhook
Attributes
targets
targets: Optional[list[EventWebhookTarget]] = None
Optional new delivery targets; see EventWebhook.targets. Pass an empty
list to restrict to system events only, or None to leave unchanged.