页面简介
Delete a monitor and all its results with DELETE /v1/monitors/{id}. This can't be undone; pause a monitor to stop it for a while.
正文摘录
TypeScriptTypeScriptimport { Keenable } from "keenable"; async function main() { // reads KEENABLE_API_KEY from the environment const client = new Keenable(); const monitor = await client.monitors.delete("mon_3kq9z2c8f1a04b7d9e6f5a21"); console.log(monitor.id, monitor.status); } main(); 200401403404409429503{ "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": {} }DELETE/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.delete("mon_3kq9z2c8f1a04b7d9e6f5a21"); console.log(monitor.id, monitor.status); } main(); 200401403404409429503{ "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": {} }Delete a monitor and all its results, or a page monitor and all its versions. The response is the monitor as it was. A deleted monitor can’t be restored, so to stop one for a while, pause it instead. When to use it Delete a monitor when you no longer need its topic or its results. Its results go with it, so read its results first if you want to keep them. If the webhook lists monitor.deleted, your endpoint gets that event. If the API returns 409 with request_rejected, the monitor can’t be deleted on its own. message says why. SDK, CLI and MCP ClientCallPython, TypeScriptclient.monitors.delete(monitor_id)Goclient.Monitors.Delete(ctx, monitorID, nil)Rustclient.monitors().delete(monitor_id)CLIkeenable monitors delete <id>. It asks first; without a terminal, pass --yes.MCPdelete_monitor, with id The SDK methods need SDK 0.2.0 or later. See SDKs → Monitors, CLI → Monitors and Monitors tools. Related operations Bulk actions deletes many monitors at once, with a dry run first. List monitors finds the id of the monitor to delete. Statuses compares pausing and deleting. AuthorizationsapiKeybearerAuthX-API-KeystringheaderrequiredAPI key for authentication. Obtain one from the Keenable dashboard.Path ParametersidstringrequiredThe monitor's ID, such as mon_3kq9z2c8f1a04b7d9e6f5a21.Response200application/jsonThe monitor as it was before deletionidstringrequiredExample:"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.