翻篇收录说明
翻篇网页快照

Monitors API: create a monitor - Keenable

https://docs.keenable.ai/api-reference/monitors/create

最近抓取:2026-12-03 05:52:20(北京时间)

最近内容变化:2026-12-03 05:52:20(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

Create a monitor with POST /v1/monitors: a topic or a page to watch, an optional schedule and webhook. The response carries the webhook signing secret.

正文摘录

TypeScriptTypeScriptimport { Keenable } from "keenable"; async function main() { // reads KEENABLE_API_KEY from the environment const client = new Keenable(); const monitor = await client.monitors.create({ name: "Open-weights LLM releases", search: { query: "new open-weights LLM releases" }, webhook: { url: "https://hooks.example.com/keenable", events: ["monitor.result.found", "monitor.disabled"], }, }); console.log(monitor.id, monitor.status); console.log(monitor.webhook?.secret); // shown once: store it } main(); 201400401403409429503{ "id": "mon_3kq9z2c8f1a04b7d9e6f5a21", "object": "monitor", "name": "Open-weights LLM releases", "type": "search", "status": "active", "disabled_reason": { "code": "runs_failed", "message": "<string>" }, "search": { "query": "<string>", "max_results": 123, "include_domains": [ "<string>" ], "exclude_domains": [ "<string>" ], "content": { "text": false } }, "page": { "url": "https://example.com/pricing", "watch_for": "price changes and new plans", "sensitivity": "meaningful" }, "schedule": { "type": "cron", "value": "0 9 * * 1-5", "timezone": "Europe/Paris" }, "webhook": { "url": "<string>", "events": [ "monitor.created" ], "secret": "whsec_example" }, "metadata": {}, "last_run_at": "2023-11-07T05:31:56Z", "next_run_at": "2023-11-07T05:31:56Z", "upcoming_runs": [ "2023-11-07T05:31:56Z" ], "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z", "output_schema": {} }POST/v1/monitorsTry itTypeScriptTypeScriptimport { Keenable } from "keenable"; async function main() { // reads KEENABLE_API_KEY from the environment const client = new Keenable(); const monitor = await client.monitors.create({ name: "Open-weights LLM releases", search: { query: "new open-weights LLM releases" }, webhook: { url: "https://hooks.example.com/keenable", events: ["monitor.result.found", "monitor.disabled"], }, }); console.log(monitor.id, monitor.status); console.log(monitor.webhook?.secret); // shown once: store it } main(); 201400401403409429503{ "id": "mon_3kq9z2c8f1a04b7d9e6f5a21", "object": "monitor", "name": "Open-weights LLM releases", "type": "search", "status": "active", "disabled_reason": { "code": "runs_failed", "message": "<string>" }, "search": { "query": "<string>", "max_results": 123, "include_domains": [ "<string>" ], "exclude_domains": [ "<string>" ], "content": { "text": false } }, "page": { "url": "https://example.com/pricing", "watch_for": "price changes and new plans", "sensitivity": "meaningful" }, "schedule": { "type": "cron", "value": "0 9 * * 1-5", "timezone": "Europe/Paris" }, "webhook": { "url": "<string>", "events": [ "monitor.created" ], "secret": "whsec_example" }, "metadata": {}, "last_run_at": "2023-11-07T05:31:56Z", "next_run_at": "2023-11-07T05:31:56Z", "upcoming_runs": [ "2023-11-07T05:31:56Z" ], "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z", "output_schema": {} }Start watching the web for new pages about a topic with search, or one page for changes with "type": "page" and page. A page monitor’s baseline run starts in the background after the 201. Store webhook.secret from the response. Only this response and an update that adds a first webhook carry it. Send an Idempotency-Key header so a retried create doesn’t make a second monitor. See Monitors for page monitors, schedules, structured outputs, events and signatures. When to use it Create one monitor per topic. Every key in your organization sees the same monitors, so first list your monitors with name and reuse one on the same topic. Write search.query as a topic in plain words, not keywords. Write a good query has examples. A new monitor starts empty and doesn’t backfill: it matches only pages crawled after you create it. For pages already published, use Search. A create counts toward your organization’s active monitors. See Limits. The same Idempotency-Key with the same body within 24 hours returns the monitor the first call created. The same key with another body returns 409 with idempotency_conflict. SDK, CLI and MCP ClientCallPython, TypeScriptclient.monitors.create(...)Goclient.Monitors.Create(ctx, params)Rustclient.monitors().create(&params)CLIkeenable monitors create "<topic>", with --every, --cron, --webhook, --idempotency-keyMCPcreate_monitor, with query, name, webhookUrl, includeDomains and excludeDomains The SDK methods need SDK 0.2.0 or later. Each SDK sends an Idempotency-Key on every create, yours or a new one, so it can retry the call safely. See SDKs → Monitors, CLI → Monitors and Monitors tools. Related operations Update a monitor changes the query, schedule or webhook later. Run a monitor now starts a run without waiting for the schedule. List results reads every result the monitor accepted. For a step-by-step guide, see Create a monitor.AuthorizationsapiKeybearerAuthX-API-KeystringheaderrequiredAPI key for authentication. Obtain one from the Keenable dashboard.HeadersIdempotency-KeystringAny string. Within 24 hours, the same key with the same body returns the monitor the first call created instead of creating another one.Bodyapplication/jsonOption 1Option 2A search monitor (type search, the default) with search, or a page monitor (type page) with page. The create returns 201 at once; a page monitor's first run, which records the page as its baseline, is queued in the background. An organization can have up to 100 active monitors; going over returns 403 with monitor_limit_reached. Monitors is free for now.searchobjectrequiredRequired for a search monitor.Show child attributestypeenum<string>default:searchsearch takes search; page takes page. Sending the other one returns 400 with invalid_request.Available options: search namestring | nullA display name. Defaults to the query.Maximum string length: 200Example:"Open-weights LLM releases"pageobjectRequired for a page monitor.Show child attributesscheduleobjectWhen runs happen. Without a schedule, a search monitor runs only when you trigger one, and a page monitor checks the page every hour (interval 1h).Option 1Option 2Show child attributeswebhookobjectOption 1Option 2Show child attributesoutput_schemaobject | nullA JSON Schema for output.structured. The supported subset: object, array, string, number, integer, boolean, enum, nullable, anyOf, properties, items, required and description. The special case {"type": "text"} asks for a plain-text output in output.text instead of a structure. $ref, oneOf, allOf and additionalProperties are refused. At most 16 KB, 6 levels deep and 100 properties. A schema outside these rules returns 400 with invalid_request, and message names the path of the part that broke one. On a search monitor, each run that finds pages returns a summary of them in this shape; on a page monitor, the first run and every run that finds a change return the fields read from the page.metadataobject | nullYour own string tags, at most 50 keys. Every webhook event carries them. For example {"team": "research"}.Show child attributesResponse201application/jsonThe new monitor, with webhook.secret when you sent a webhookidstringrequiredExample:"mon_3kq9z2c8f1a04b7d9e6f5a21"objectenum<string>requiredAvailable options: monitor namestring | nullrequiredExample:"Open-weights LLM releases"typeenum<string>requiredsearch: new pages on the web about a topic. page: changes to one page.Available options: search, page statusenum<string>requiredactive and paused are set by you. completed: a once monitor after its run. disabled: set by Keenable after 10 failed runs in a row, when no webhook delivery succeeded for 3 days; disabled_reason says which. Only an active monitor runs.Available options: active, paused, disabled, completed disabled_reasonobjectrequiredSet while status is disabled, null otherwise.Option 1Option 2Show child attributessearchobject | nullrequiredThe search a search monitor runs. null on a page monitor.Show child attributespageobjectrequiredThe page a page monitor watches. null on a search monitor.Option 1Option 2Show child attributesscheduleobjectrequiredAll three keys are always present. timezone is UTC for a cron schedule sent without one, and null for interval and once.Option 1Option 2Show child attributeswebhookobject | nullrequiredShow child attributesmetadataobject | nullrequiredShow child attributeslast_run_atstring<date-time> | nullrequiredWhen the last run ended.next_run_atstring<date-time> | nullrequiredThe next scheduled run. null without a schedule or while the monitor isn't active.upcoming_runsstring<date-time>[]requiredThe next three run times, in UTC. Empty without a schedule or while the monitor isn't active.created_atstring<date-time>requiredupdated_atstring<date-time>requiredoutput_schemaobject | nullThe output_schema you set, null without one.