CountWatchDocs

Docs / Connect your data

Bring in past data

Send past counts so alerts start today, and see which alerts the past would have raised.

In short: send your past counts once and alerts start the same day; the result shows what the past would have raised. Your agent can do it. No code: Import past counts (Senders (Connect) → Imports) takes a CSV file with two columns, each row's start time and its count; a longer file is fine, its last 90 days are added.

POST /v1/import takes arrays of counts per watch: {metric, tags, start, resolution: 5m | 1h | 1d, counts[]} (start falls on a step of the resolution, in UTC), up to 90 days each and 1,000 watch-days per request (and a body under 2 MB, refused at once with 413 before anything is stored). Have only the times of single events (sign-ups, orders)? Send {metric, events: ["2026-08-01T19:04:44Z", …]} instead of counts (up to 10,000): each adds 1 to its 5-minute window, and every 5-minute window from the first event (or start) up to now is imported, zeros included; leave out events in the current 5 minutes. Add past_events for spans you know about (kind: real | expected_change, direction: spike | drop | no_data), and tz for the watch's timezone. The answer is 202 with an import_id; poll GET /v1/imports/{import_id} until status: done. Each watch then shows the rules chosen for it and the alerts they would have raised in the replayed days: what this service would have told you.

curl -X POST https://countwatch.com/v1/import \
  -H "Authorization: Bearer $COUNTWATCH_API_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: orders-history-1" \
  -d '{"watches":[{"metric":"orders","tags":{"shop":"EU"},"start":"<bucket start>","resolution":"5m","counts":[3,5]}]}'

For agents: this page as Markdown.