Skip to content

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_idstring
The ID of a monitor that has an agent.

Request body

Send status, budget or both.

statusstringone of paused, active, ready
paused pauses the monitor. active resumes it. ready, the older word, also resumes it.
budgetobject
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_idstring
The ID of the monitor.
statusstring
The agent's status: compiling, ready, failed, paused, ended or deleted.
querystring
The monitor's query.
frequencystring
How often the agent runs.
spec_versioninteger
The version of the agent's plan. It goes up each time the plan changes.
specobject or null
The plan the agent follows: the kind of object it looks for, the criteria each one must meet, and where it searches. null before the first plan.
countsobject
How many objects the agent found, by status, and its alerts in the last 24 hours.
ticks[]object[]
The agent's latest ticks: when each ran, what it cost, why it stopped and what it found.
next_tick_atstring or null
When the agent runs next, or null.
spend_usdnumber
What the agent has spent on this monitor, in US dollars.
budgetobject or null
The monitor's own budget, as set with Update the agent, or null.
source_health[]object[]
How each source of the plan did: its rows, new objects, cost and status.
compileobject
The agent's latest plan job: its job_id, status and error. See Get a job.
running_jobobject or null
The job that runs now, or null.
suggested_prompts[]string[]
Messages you can send the agent to start a chat.

Errors

StatusCodeWhen
400invalid_requestThe body has neither status nor budget.
401unauthorizedThe API key is missing or not valid.
403forbiddenThe API key cannot read monitors (a GET) or change them (the other methods).
404not_foundThe monitor is not in your key's project, or it has no agent.
409monitor_endedThe monitor has ended. What the agent found stays readable, but nothing can change.
422invalid_requestA parameter or the body is not valid. error.param names it.
429rate_limitedYour 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.

Was this page helpful?