EventService
EventService manages event type definitions and event pushing. Event types must be registered before they can be pushed. Each event type has a unique name (scoped to the default tenant) and an optional JSON schema for payload validation.
RegisterEvent
/webhook.EventService/RegisterEvent RegisterEvent creates a new event type definition. If a JSON schema is provided, all future PushEvent payloads for this event are validated against it. The event name is the primary identifier (not a UUID). Errors: ALREADY_EXISTS if an event with the same name already exists.
Request
namestringUnique event name (e.g., "order.created", "payment.completed"). Required. Convention: use dot-separated lowercase names.
descriptionstringHuman-readable description of what this event represents. Optional.
schemaStruct (JSON)JSON Schema for validating PushEvent payloads. Optional. When set, all future PushEvent calls for this event type must conform to this schema. Passed as a google.protobuf.Struct (JSON object).
metadatamap<string, string>Arbitrary key-value metadata attached to the event type definition. Optional.
activeboolWhether the event type is active. Default: true. Inactive event types cannot receive new PushEvent calls.
Response
created_atTimestampTimestamp when the event type was created.
curl -X POST http://localhost:8080/webhook.EventService/RegisterEvent \
-H "Content-Type: application/json" \
-d '{
"name": "order.created",
"description": "Fired when a new order is placed",
"schema": {
"properties": {
"amount": {
"type": "number"
},
"order_id": {
"type": "string"
}
},
"required": [
"order_id",
"amount"
],
"type": "object"
},
"active": true
}' {
"created_at": "2025-01-15T10:30:00Z"
} ListEvents
/webhook.EventService/ListEvents ListEvents returns all registered event types, optionally filtered to active-only. Results are paginated.
Request
active_onlyboolWhen true, only return active event types. Default: false (return all).
paginationPaginationRequestPagination parameters. Default: limit=50, offset=0.
Response
eventsRegisteredEvent[]Event type definitions matching the filter criteria.
paginationPaginationResponsePagination metadata.
curl -X POST http://localhost:8080/webhook.EventService/ListEvents \
-H "Content-Type: application/json" \
-d '{
"active_only": true
}' UpdateEvent
/webhook.EventService/UpdateEvent UpdateEvent modifies an existing event type's description, schema, metadata, or active flag. Updating the schema does not retroactively validate previously pushed events. Errors: NOT_FOUND if the event name does not exist.
Request
namestringEvent name to update. Required. This is the lookup key (not a UUID).
descriptionstringUpdated description. Omit to leave unchanged.
schemaStruct (JSON)Updated JSON Schema for payload validation. Omit to leave unchanged. Note: changing the schema does not retroactively validate previously pushed events.
metadatamap<string, string>Updated metadata. Omit to leave unchanged.
activeboolUpdated active flag. Omit to leave unchanged.
curl -X POST http://localhost:8080/webhook.EventService/UpdateEvent \
-H "Content-Type: application/json" \
-d '{
"name": "order.created",
"description": "Updated: Fired when a new order is placed"
}' DeleteEvent
/webhook.EventService/DeleteEvent DeleteEvent permanently removes an event type definition. Existing subscriptions referencing this event name are not automatically deleted. Errors: NOT_FOUND if the event name does not exist.
Request
namestringEvent name to delete. Required.
curl -X POST http://localhost:8080/webhook.EventService/DeleteEvent \
-H "Content-Type: application/json" \
-d '{
"name": "order.created"
}' GetEvent
/webhook.EventService/GetEvent GetEvent returns a single event type by name, including its schema and auto-generated sample payload. Errors: NOT_FOUND if the event name does not exist.
Request
namestringEvent name to look up. Required.
Response
eventRegisteredEventThe event type definition, including schema and sample_payload.
curl -X POST http://localhost:8080/webhook.EventService/GetEvent \
-H "Content-Type: application/json" \
-d '{
"name": "order.created"
}' PushEvent
/webhook.EventService/PushEvent PushEvent emits an event instance. This is the primary ingestion endpoint. On success, the event is persisted and a background job is enqueued to fan out deliveries to all matching subscriptions (by namespace + event_name + label_filters). The response returns immediately with the event_id; delivery happens asynchronously. If the event type has a JSON schema, the payload is validated before acceptance. Errors: INVALID_ARGUMENT if the payload fails schema validation. Errors: NOT_FOUND if the event name is not registered.
Request
namespacestringNamespace to push the event into. Required. Only subscriptions in this namespace are matched.
eventstringEvent type name (must match a registered event type). Required. Subscriptions with matching event_name in this namespace will receive deliveries.
payloadStruct (JSON)Event payload as a JSON object. Required. If the event type has a schema, this payload is validated against it before acceptance. This payload (or its template-transformed version) becomes the HTTP request body sent to each matching webhook.
ttl_secondsint64Time-to-live in seconds for delivery retries. Optional. When set, deliveries that haven't succeeded within this window transition to EXPIRED. Default: 0 (no expiration -- retries continue until max_retries is exhausted).
metadatamap<string, string>Arbitrary key-value metadata attached to this event instance. Optional. Metadata is stored with the event record and available in event reports, but is NOT included in the delivery payload sent to webhooks.
idstringClient-provided event ID for idempotency. Optional. If provided and an event with this ID already exists, the existing event_id is returned without creating a duplicate.
labelsmap<string, string>Labels for label-based subscription matching. Optional. When set, only subscriptions whose label_filters are a subset of these labels will receive deliveries. Labels use AND logic: all filter keys must match. Subscriptions with no label_filters match all events regardless of labels.
Response
event_idstringServer-generated UUID for the event instance. Use this ID to query delivery status via DeliveryService.ListDeliveries.
curl -X POST http://localhost:8080/webhook.EventService/PushEvent \
-H "Content-Type: application/json" \
-d '{
"namespace": "production",
"event": "order.created",
"payload": {
"amount": 99.99,
"currency": "USD",
"order_id": "ord-123"
},
"labels": {
"priority": "high",
"region": "us-east"
}
}' {
"event_id": "e-550e8400-e29b-41d4-a716-446655440000"
} ListEventReports
/webhook.EventService/ListEventReports ListEventReports returns pushed event instances (not type definitions) for a namespace, ordered by created_at descending. Each report includes delivery stats (webhook_count, successful/failed/pending counts). Paginated, max 1000 per page.
Request
namespacestringNamespace to list events from. Required.
event_namestringFilter to events of this type name. Optional.
paginationPaginationRequestPagination parameters. Default: limit=50, offset=0. Max limit: 1000.
Response
eventsEventReport[]Event instances ordered by created_at descending (newest first).
paginationPaginationResponsePagination metadata.
curl -X POST http://localhost:8080/webhook.EventService/ListEventReports \
-H "Content-Type: application/json" \
-d '{
"namespace": "production",
"event_name": "order.created",
"pagination": {
"limit": 25
}
}'