Skip to main content
POST
/
agent
Terminate / restore agent
curl --request POST \
  --url https://api.example.com/agent \
  --header 'Content-Type: application/json' \
  --data '
{
  "action": "<string>",
  "agent_id": "<string>",
  "termination_status": "<string>"
}
'

Request

{
  "action": "terminate",
  "agent_id": "uuid",
  "termination_status": "terminated"
}
action
string
required
Must be "terminate".
agent_id
string
required
The agent UUID.
termination_status
string
required
One of: active, terminated, idle.

Response

{
  "agent_id": "uuid",
  "termination_status": "terminated",
  "terminated_at": "2026-03-28T07:00:00Z"
}
Setting terminated blocks all tool calls immediately. The agent’s plugin receives the update via Supabase Realtime within seconds.

Errors

CodeHTTPMeaning
AGENT_NOT_FOUND404Agent ID doesn’t exist or you don’t have access.
AUTH_REQUIRED401Missing or invalid user token.
FORBIDDEN403You don’t have permission to terminate this agent (requires Operator role or above).
RATE_LIMITED429Too many requests.

What the agent sees

When terminated, every tool call from the agent is blocked with:
Agent terminated by user. Re-enable from Celerflow Dashboard.
In-flight tool calls complete before blocking takes effect. The plugin checks termination status at the start of each before_tool_call hook.