Subscribe to a scan query
https://api.tickerbot.io/ v2/ scan/ subscribePush a whole query: we POST your endpoint every time the match set changes.
Body parameters
stringrequiredWHERE-clause expression using signal names — the same grammar and the same 4000-char cap as POST /v2/scan, so anything scannable is subscribable. Custom signals are expanded and frozen in at creation. See the signals catalog for columns + flags you can compose.
stringSystem or user-owned universe to scope the scan. universe_id accepted as an alias. Unknown universes are a 404 universe_not_found.
stringhttps:// URL to POST when the match set changes. Omit for in-app delivery.
enumDelivery channel. webhook (POST to target_url), discord (embed to discord_url), in_app (dashboard only), or mobile_push (requires a device_id from POST /v2/devices/register). Inferred when omitted: webhook if target_url is set, discord if discord_url is set, else in_app. slack is reserved and returns 501.
webhook | POST the payload to an HTTPS endpoint you own, signed with X-Tickerbot-Signature. |
discord | Post to a Discord channel via its webhook URL. Delivered as a Discord embed, never HMAC-signed — the URL is itself the credential. |
in_app | Deliver to the in-app feed. No external receiver, so nothing to validate and no test_url. |
mobile_push | Push to a registered device. Requires a device_id from Register a device. |
stringDiscord incoming-webhook URL. Required when channel is discord. Stored as a posting credential: the create response echoes it back under channel_config, but every later read (list, get, deliveries) strips it and sets channel_config_present: true instead.
stringDevice to notify, from POST /v2/devices/register. Required when channel is mobile_push; unknown ids are a 404 device_not_found.
enumrealtime (the default) is evaluated on every data refresh (~1×/min); hourly and nyse_open throttle to a batch schedule. 1m is a deprecated alias for realtime.
realtime | Evaluate on every refresh — the canonical value. (1m is a deprecated alias that collapses to this.) |
hourly | Batch schedule: evaluate once an hour. |
nyse_open | Batch schedule: evaluate once per session, at the NYSE open. |
stringHuman-readable label (up to 80 chars). Defaults to scan: <q>.
string[]Extra signals per fired payload match row, beyond the standard set (ticker, name, asset_type, price, change_1d_pct, market_cap). Each must be a real signal; unknown ones are rejected at creation. fields accepted as an alias — and the RESPONSE reports them under fields, as an array.
stringdefault market_capSignal the payload's match lists are sorted by before the 100-row cap applies, so a truncated list is the deterministic top 100 rather than an arbitrary sample. Must be a real signal (validated at creation).
enumdefault descSort direction for order.
asc | Ascending — smallest or earliest first. |
descdefault | Descending — largest or most recent first. |
Headers
stringOptional unique string (≤255 chars). A retry carrying the same key within 24h replays the original response (Idempotency-Replayed: true header) instead of creating a duplicate; a concurrent duplicate gets 409 idempotency_in_flight; reusing a key for a *different* request (another method or path) gets 422 idempotency_key_reused. 5xx responses are not stored — those retries re-execute.
Returns
as_ofstringServer time this response was assembled (ISO 8601).
idstringThe webhook id — `wh_…`, the handle for every other call on this record.
namestringYour label for the subscription.
qstringThe stored predicate. Custom signals appear expanded: the SQL is frozen at creation.
rule_idstringLegacy link to a v1 alert rule; `null` on everything created through v2.
fieldsstringExtra signals carried on each fired match row; `null` means the standard set.
orderstringSort signal for the payload row list; `null` means the evaluator default (`market_cap`).
dirstringSort direction for that list; `null` means the default (`desc`).
universe_idstringUniverse the trigger is scoped to, or `null` for the whole market.
cadencestringHow often the trigger is evaluated — `realtime`, `hourly`, or `nyse_open`.
channelstringWhere deliveries go: `webhook`, `discord`, `in_app`, or `mobile_push`.
target_urlstringYour HTTPS endpoint; `null` on every channel except `webhook`.
deliverystringLegacy alias of `channel`, kept aligned for older readers.
statusstring`active` or `disabled`. Auto-disable follows repeated delivery failure.
sourcestringWhich API version created the record; `v2` for anything you create today.
subscription_originobjectWhich door created it — `type` (`ticker`/`signal`/`scan`/`event`), its `ref`, and the `condition` in display form.
last_predicate_valuestringThe trigger's value at the last evaluation; `null` until it has run.
created_atnumberCreation timestamp.
updated_atnumberLast modification timestamp.
last_firednumberWhen a delivery last went out; `null` if it never has.
last_match_setarrayTickers matching at the last evaluation — the set the next run is diffed against, which is what makes firing edge-triggered.
last_eval_error_atnumberWhen the last evaluation error happened; `null` on a healthy hook.
last_errorstringThe last evaluation error; `null` on a healthy hook. The answer to "why is my webhook not firing?".
next_eval_atnumberWhen the evaluator will next consider this subscription.
last_evaluated_atnumberWhen it was last evaluated; `null` until the first run.
event_kindsarrayEvent-trigger webhooks only: the kinds subscribed (`split`, `dividend`, `insider`, `analyst`, `earnings`).
event_qstringEvent-trigger webhooks only: the payload filter, or `null`.
event_tickersarrayEvent-trigger webhooks only: the symbols the trigger is scoped to, or `null` for the universe / whole market.
trigger_kindstringEvent-trigger webhooks only: `event`.
channel_configobjectReturned on create only: the channel-specific delivery settings as stored (e.g. the Discord URL, the device id).
signing_secretstringReturned on create only — shown once, never again. HMAC key for verifying the `X-Tickerbot-Signature` header on deliveries.
test_urlstringReturned on create only: the `POST /v2/webhooks/{id}/test` URL for this record.
_metaobjectReturned on create only, and only when the rule or `columns` named a column under its pre-2026-09-07 spelling: `deprecated_columns` lists each one (`requested`, `use`, `note`). The stored rule carries the current name.
Status codes
201GET /v2/webhooks/{id}, plus test_url (wire-delivered channels only) and, uniquely on create, signing_secret (shown once, for HMAC verification) and the raw channel_config you supplied. Later reads strip both.400404409idempotency_in_flight — a concurrent request carried the same Idempotency-Key.422idempotency_key_reused — the Idempotency-Key was already used for a different request.501channel_not_implemented — channel: "slack" is reserved.Notes
- Shorthand for
POST /v2/webhookswith a{ type: "scan" }trigger — one of the four doors to the same webhook object, listed, updated, and deleted at/v2/webhooks. Optionally scope it to auniverse. - Subscribes to a free-form
q, the same grammar asPOST /v2/scan, and fires whenever tickers enter or leave the match set.qtakes the same 4,000 characters scan does, checked before custom-signal inlining — so anyqthe scan endpoint accepts is subscribable. - Payload row lists (
matches,current_matches) are capped at 100 entries, whilematched_count/current_match_countalways carry the true totals and amatches_truncated/current_matches_truncatedfield appears when a list was capped. A capped list is the top 100 byorder(defaultmarket_capdescending), and the payload echoes theorder/dirused — so the 100 you receive are deterministic and stable between fires, not an arbitrary sample. - Wire-delivered subscriptions (
webhook,discord) come back with atest_url. Subscribing does NOT auto-fire — call it to send a real-shapewebhook.firedand validate your receiver. In-app subscriptions have no external receiver and carry notest_url. - Custom signals referenced in
qare expanded and frozen into the webhook at creation. Editing the signal later does not change this subscription — re-subscribe to apply.