ingest_eventsBatch-insert event occurrences into BigQuery for an existing event type.
Area
Discovery & Research
Group
Event management
Access
Write
Risk
May change server state
▸Details
Full description
Details
Batch-insert event occurrences into event history.
Omit symbol for market-wide events.
Validates the event type exists and is active, then writes all events
idempotently. Optional event_id is a stable nonempty string of at most
256 characters, unique within this feed. Distinct IDs at the same symbol
and time coexist. Reuse an ID for retries and corrections, including a
changed symbol or date. Without it, identity remains symbol plus event_ts.
A retry preserves the original version's knowledge and receipt times;
an older version cannot replace a newer correction. Every source persists
to event history (inserted counts persisted rows, post-dedup) — a webhook
or system event is never delivered live without also being durably
stored, so it remains visible to query_events and backtestable
after the fact. source='backfill' is historical/manual entry: versions
known before their effective date are also sent to running paper sessions,
including retries after that date; other historical versions are stored
without live delivery. source='webhook'/'system' send
every event for immediate delivery to running paper sessions — check
the response's published field to confirm that happened; a delivery
failure is an error, and retrying is safe.
Optional known_at records when this version became knowable, independently of event_ts and the server's receipt time. Supply it for historical publication timing; it may precede or follow event_ts. When omitted, live uploads use receipt; past backfills assume event_ts, and future backfills use their first upload time. An intentional correction back to earlier content supplies a new known_at. Conflicting versions of one ID at the same known_at in one batch are refused before schema admission.
Timestamp format: event_ts and supplied known_at MUST be ISO 8601 with an explicit timezone
offset (e.g. 2025-01-15T14:00:00Z or 2025-01-15T14:00:00-05:00).
Naive timestamps (no offset) are rejected — do NOT silently assume UTC;
send the offset explicitly so the stored time is unambiguous.
Example events: [ { "event_ts": "2025-01-15T14:00:00Z", "symbol": "SPY", "payload": {"direction": "bullish"} }, {"event_ts": "2025-03-19T18:00:00-04:00"} ]
Returns the count of persisted events (inserted) and whether this batch was
also published for real-time delivery (published). Requires a plan with
custom events. Refuses with EVENT_TYPE_NOT_FOUND when the event type does
not exist, is not yours, or is a system feed, and with VALIDATION_ERROR when
the list is empty or malformed.
Capabilities
Bounded options and operating modes surfaced above the full JSON schema.
Required Inputs
event_type_idstringEvent type ID (must exist and be active)eventsarray<object>List of events to ingest. Each event: {event_ts: ISO timestamp (required), event_id: stable feed-local ID (optional), known_at: ISO publication/availability timestamp (optional), symbol: str (optional), payload: object (optional)}. Omit symbol for market-wide events.Optional Inputs
sourcestringSource label: 'backfill' (historical), 'webhook' (real-time), 'system'