页面简介
Get one monitor with GET /v1/monitors/{id}: its query or page, status, schedule, webhook and next three run times.
正文摘录
TypeScriptTypeScriptimport { Keenable } from "keenable"; async function main() { // reads KEENABLE_API_KEY from the environment const client = new Keenable(); const monitor = await client.monitors.get("mon_3kq9z2c8f1a04b7d9e6f5a21"); console.log(monitor.id, monitor.type, monitor.status); } main(); 200401403404429503{ "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": {} }GET/v1/monitors/{id}Try itTypeScriptTypeScriptimport { Keenable } from "keenable"; async function main() { // reads KEENABLE_API_KEY from the environment const client = new Keenable(); const monitor = await client.monitors.get("mon_3kq9z2c8f1a04b7d9e6f5a21"); console.log(monitor.id, monitor.type, monitor.status); } main(); 200401403404429503{ "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": {} }Get one monitor. upcoming_runs lists its next three run times in UTC. A search monitor has search and page: null, and a page monitor has page and search: null. When to use it Check a monitor’s status after a monitor.disabled event, or confirm that an update took effect. next_run_at and upcoming_runs show when the schedule runs next. Both are empty when the monitor has no schedule or isn’t active. To find an id, list your monitors. The response never carries webhook.secret. Your webhook handler needs the one from the create response to verify deliveries. SDK, CLI and MCP ClientCallPython, TypeScriptclient.monitors.get(monitor_id)Goclient.Monitors.Get(ctx, monitorID, nil)Rustclient.monitors().get(monitor_id)CLIkeenable monitors get <id>MCPNo tool. list_monitors returns each monitor’s id, name, status and query. The SDK methods need SDK 0.2.0 or later. See SDKs → Monitors. Related operations Update a monitor changes it, or pauses and resumes it. List runs shows what its runs returned. Statuses explains each status and how it changes. AuthorizationsapiKeybearerAuthX-API-KeystringheaderrequiredAPI key for authentication. Obtain one from the Keenable dashboard.Path ParametersidstringrequiredThe monitor's ID, such as mon_3kq9z2c8f1a04b7d9e6f5a21.Response200application/jsonThe monitoridstringrequiredExample:"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.