Handler for `DELETE /api/v1/agents/{id}`.
DELETE/api/v1/agents/:id
Performs a full graceful shutdown of the agent:
- Transitions to
Stopping(emitsAgentStoppingevent for observers). - Unregisters the
ExecutionCoordinatorfrom theTaskRouterso no new tasks can be submitted to this agent. - Transitions to
Stopped(emitsAgentStoppedevent).
This mirrors the sequence performed by [ShutdownController::stop_agents]
during full system shutdown. The Stopping intermediate state is preserved
so that event-bus subscribers (dashboard, SSE streams) observe the correct
lifecycle.
Accepts both a UUID and a human-readable agent name (e.g. apollia-reviewer).
Returns 409 Conflict if the agent is already stopped or stopping.
Returns 404 if the agent does not exist.
Request
Responses
- 200
- 404
- 409
Agent stopped
Agent not found
Agent already stopped or stopping