create_event_typeCreate a custom event type for use in event-driven strategies.
Area
Discovery & Research
Group
Event management
Access
Write
Risk
May change server state
▸Details
Full description
Details
Create a new custom event type for use in event-driven strategies.
Only call after list_event_types(filters={"ids":[...]}) confirms no existing system
or custom event type matches the use case AND has coverage for the
symbol(s) you need (see top_symbols/symbols.total/
global_occurrence_count on each returned row). Re-using a
system event type is always preferred over creating a near-duplicate custom
one — system types are already backfilled and maintained by Quawd. A custom
type that is topically similar but scoped to different symbols does NOT
count as a match — reusing it silently produces a condition that never
fires for your target symbol. If nothing existing both fits the topic and
covers the right symbols, source real data (e.g. web search for a data
provider, scrape a feed) and create a new type here — do not attach an
event condition to a symbol the underlying data doesn't actually cover.
Each user can own at most 50 custom event types. If payload_schema is omitted, the first ingest_events call infers it from the payload.
After creation, use ingest_events() to add historical occurrences. Reference this event_type_id in strategy conditions through two value refs inside a compare: its distance from an occurrence, or a payload scalar.
{"kind": "event_distance", "event_type_id": "<this event_type_id>", "direction": "previous", "unit": "bars"} {"kind": "event_field", "event_type_id": "<this event_type_id>", "event_field": "<payload field name>"}
A payload value carries forward until the next occurrence, so a payload compare alone stays true between events. To act on the event itself, put it under all_of with the proximity guard {"kind": "compare", "left": <the event_distance ref above>, "op": "<=", "right": N}, which holds on the occurrence bar and the N bars after it (builder_discover(action='get', ref='recipe:event_payload_threshold')).
Do not use {"kind": "event_type"} as a compare left/right. event_type_id identifies the feed; event_field identifies the numeric/string/boolean payload field to compare.
After creation, always reference this event by its bare slug (the
event_type_id you passed here, and the same value returned as id
in the response). There is no owner-uid-prefixed id to remember —
the response's id is always the bare slug for custom event types.
Returns the created event type. Requires a plan with custom events. Refuses with VALIDATION_ERROR when the id is not kebab-case and with EVENT_TYPE_DUPLICATE when the id already exists.
Capabilities
Bounded options and operating modes surfaced above the full JSON schema.
Required Inputs
event_type_idstringUnique kebab-case ID for this event type: lowercase letters and digits separated by single hyphens (e.g. 'my-sentiment-score', 'earnings-surprise-flag'). System event types use dotted '<category>.<name>' ids such as 'macro.cpi', so a custom id cannot collide with one.namestringHuman-readable nameOptional Inputs
descriptionstringWhat this event representspayload_schemaanyOf (2 variants)Optional schema for event payloads: {fields:{<name>:<number|boolean|string>}, required:[...]}.