Core jobsSet up alerts

Set up alerts

Create a watch, choose coins and engines, pause and resume it.

A watch re-runs one pattern on every closed candle. When a lane matches, the alert is

delivered to the destinations you connected — for API integrations, a webhook.

Price the watch

A watch is billed per lane and period. Ask before creating it:

curl -s -X POST "$API/watches/price" \
  -H "X-API-Key: $DEJABARS_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "pattern": [0.42, 0.51, 0.47, 0.63, 0.58],
    "xs": [0.0, 0.2, 0.4, 0.6, 0.8],
    "coins": "all",
    "lanes": [{"timeframe":"1h","engines":["geo"],"tolerance":0.35}]
  }'

The response states the token cost and how much comes from the weekly allowance. Creating

the watch charges the same amount. A lane is one timeframe plus one or more engines; a

watch can hold several lanes.

Create it

curl -s -X POST "$API/watches" \
  -H "X-API-Key: $DEJABARS_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Ascending triangle",
    "pattern": [0.42, 0.51, 0.47, 0.63, 0.58],
    "xs": [0.0, 0.2, 0.4, 0.6, 0.8],
    "coins": ["BTCUSDT", "ETHUSDT", "SOLUSDT"],
    "lanes": [
      {"timeframe":"1h","engines":["geo"],"tolerance":0.35},
      {"timeframe":"4h","engines":["dtw"],"tolerance":0.30}
    ]
  }'
FieldMeaning
pattern, xsThe same sketch format as a search
coins"all", or a list of symbols
lanes[].timeframe1m, 5m, 15m, 1h, 4h, 1d, 1w
lanes[].enginesOne or more matcher ids
lanes[].tolerance0–1; lower is stricter
lanes[].min_bars, max_barsWindow length bounds; 0 means unset
lanes[].reversal_pctReversal threshold used by some engines

The response contains the watch and its id. Keep that id; it is the handle for every later

call.

Manage it

curl -s -H "X-API-Key: $DEJABARS_KEY" "$API/watches"
curl -s -H "X-API-Key: $DEJABARS_KEY" "$API/watches/<watch_id>"

Pause without losing the configuration:

curl -s -X POST -H "X-API-Key: $DEJABARS_KEY" "$API/watches/<watch_id>/pause"
curl -s -X POST -H "X-API-Key: $DEJABARS_KEY" "$API/watches/<watch_id>/resume"

Change the name, the coin list or the lanes:

curl -s -X PATCH "$API/watches/<watch_id>" \
  -H "X-API-Key: $DEJABARS_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"name":"Triangle — majors","coins":["BTCUSDT","ETHUSDT"]}'

Delete it:

curl -s -X DELETE -H "X-API-Key: $DEJABARS_KEY" "$API/watches/<watch_id>"

A configuration change applies to the next closed candle. There is no backfill and no

replay of candles that closed before the change.

Choose lanes that can actually fire

  • 1h on geo is the cheap default and covers the free window.
  • 1m lanes cost more and need a tight tolerance, or they fire constantly.
  • Running geo and dtw on the same lane is useful: they disagree in a way that tells

you whether the shape or the trend is doing the work.

  • Start with a handful of coins, not "all". Widen once the alert volume is understood.

Where the alert goes

A watch has no destination of its own. Every enabled webhook destination on the account

receives every watch hit. The payload carries data.watch.id and data.watch.name, so a

receiver that serves several patterns can filter before acting. Connect a destination

first — see Receive webhooks — and send a test delivery

before you trust it.

What is that pattern?

Read the watch that produced the alert:

curl -s -H "X-API-Key: $DEJABARS_KEY" "$API/watches/<watch_id>"

The response is the source of truth: name, pattern, xs, coins, the lanes

(timeframe, engines, tolerance, window bounds), the term and the pricing. The webhook

carries the watch id and the hit, not the points themselves; fetch the watch to describe

the pattern to a person.

One pattern per watch

A watch is one pattern. If you want alerts for one pattern only, create one watch and

ignore every alert whose data.watch.id is not that watch. Two patterns means two

watches; both use the same destinations, and the receiver routes by watch id.

Verify a call

Open the interactive reference and run the operation with your key.

Open the playground →