Skip to content

Watches API

MethodPathAuthPurpose
GET/watchesTokenList the caller's watches.
POST/watchesTokenCreate a watch. The owner is taken from your token, never the body.
GET/watches/:idTokenFetch one owned watch.
PUT/watches/:idTokenReplace one owned watch. Id and owner are not client-settable.
DELETE/watches/:idTokenDelete one owned watch. Run history is kept.
GET/watches/:id/runsTokenRun history, newest first. Accepts ?limit=.
POST/watches/:id/runTokenRun this watch now, ignoring its schedule. Returns the outcome.
POST/watches/run-allTokenRun all of the caller's enabled watches now. 409 if one is already in flight.

All routes are scoped to the identity in your token.

Terminal window
curl -s https://<your-host>/watches -H "authorization: Bearer $TOKEN"
{ "watches": [ { "id": "framework-releases", "name": "Framework stable releases", "...": "..." } ] }
Terminal window
curl -s -X POST https://<your-host>/watches \
-H "authorization: Bearer $TOKEN" \
-H 'content-type: application/json' \
-d '{
"id": "framework-releases",
"name": "Framework stable releases",
"sources": [{ "type": "rss", "value": "https://example.com/blog/feed.xml", "trust": "official" }],
"schedule": "0 */6 * * *",
"condition": "A new stable version is released. Ignore release candidates and betas.",
"channels": ["telegram"],
"threshold": 0.6,
"weakThreshold": 0.4,
"enabled": true
}'

Returns 201 with the stored watch. The body is validated against the full watch schema; failures return 400 with the offending fields.

Terminal window
curl -s https://<your-host>/watches/framework-releases -H "authorization: Bearer $TOKEN"
curl -s -X PUT https://<your-host>/watches/framework-releases -H "authorization: Bearer $TOKEN" -H 'content-type: application/json' -d '{ ...full watch... }'
curl -s -X DELETE https://<your-host>/watches/framework-releases -H "authorization: Bearer $TOKEN"

PUT is a full replacement, not a patch: send the complete watch. The id comes from the path.

Deleting removes the watch definition. Its run history is kept.

Terminal window
curl -s "https://<your-host>/watches/framework-releases/runs?limit=20" -H "authorization: Bearer $TOKEN"

Newest first. Each record carries the outcome, the summary and evidence, the model’s reasoning, per-source errors, collection counts, the models consulted and the corroborating trust tier. See Runs and feedback.

Terminal window
curl -s -X POST https://<your-host>/watches/framework-releases/run -H "authorization: Bearer $TOKEN"

Runs the watch immediately, ignoring its schedule, and returns the result synchronously:

{
"result": {
"watchId": "framework-releases",
"outcome": "nothing-new",
"collected": 10,
"fresh": 0,
"notificationsSent": 0,
"sourceErrors": [],
"collection": { "attempted": 1, "collected": 10, "extracted": 10, "failed": 0 }
}
}
Terminal window
curl -s -X POST https://<your-host>/watches/run-all -H "authorization: Bearer $TOKEN"

Runs every enabled watch you own, ignoring schedules, and returns a summary plus per-watch outcomes:

{
"summary": { "total": 4, "ran": 3, "skipped": 1, "failed": 0, "notified": 1 },
"outcomes": [ { "watchId": "framework-releases", "status": "ran", "result": { "...": "..." } } ]
}

Only one run-all per owner may be in flight; a second returns 409. Watches are processed sequentially by default to respect shared model rate limits, so this can take a while.