Monitor agent
Update the agent
Pause or resume the agent, or change its budget. The response is the agent.
PATCH/v1/monitors/{monitor_id}/agent
Send your API key as Authorization: Bearer. See Authentication. How each option works: Monitors.
Path parameter
monitor_id- The ID of a monitor that has an agent.
Request body
Send status, budget or both.
statuspausedpauses the monitor.activeresumes it.ready, the older word, also resumes it.budget- The monitor's own budget, in US dollars per tick, per chat and per day, and limits on a tick's size and run time. Send only the fields to change: the others keep their values.
Response
200The agent, as Get the agent returns it.
monitor_id- The ID of the monitor.
status- The agent's status:
compiling,ready,failed,paused,endedordeleted. query- The monitor's query.
frequency- How often the agent runs.
spec_version- The version of the agent's plan. It goes up each time the plan changes.
spec- The plan the agent follows: the kind of object it looks for, the criteria each one must meet, and where it searches.
nullbefore the first plan. counts- How many objects the agent found, by status, and its alerts in the last 24 hours.
ticks[]- The agent's latest ticks: when each ran, what it cost, why it stopped and what it found.
next_tick_at- When the agent runs next, or
null. spend_usd- What the agent has spent on this monitor, in US dollars.
budget- The monitor's own budget, as set with Update the agent, or
null. source_health[]- How each source of the plan did: its rows, new objects, cost and status.
compile- The agent's latest plan job: its
job_id,statusanderror. See Get a job. running_job- The job that runs now, or
null. suggested_prompts[]- Messages you can send the agent to start a chat.
Errors
| Status | Code | When |
|---|---|---|
400 | invalid_request | The body has neither status nor budget. |
401 | unauthorized | The API key is missing or not valid. |
403 | forbidden | The API key cannot read monitors (a GET) or change them (the other methods). |
404 | not_found | The monitor is not in your key's project, or it has no agent. |
409 | monitor_ended | The monitor has ended. What the agent found stays readable, but nothing can change. |
422 | invalid_request | A parameter or the body is not valid. error.param names it. |
429 | rate_limited | Your key or account sent too many requests. Wait for the seconds in Retry-After, then try again. |
What each error means and what to do: Errors.