Skip to main content

Maintenance API

Check agent health and trigger maintenance restarts. These endpoints operate on the authenticated user’s deployed agent instance.

Get agent health

Requires session authentication. Returns liveness and readiness status for the user’s agent container by probing the agent’s /healthz and /readyz endpoints.

Response

Status values

Response when no agent is deployed

When the authenticated user has no deployed agent:
The health check uses a 5-second timeout for the /healthz probe and a 4-second timeout for the /readyz probe. Agents that are slow to start may report as unreachable or starting until fully initialized.

Errors

Restart agent

Requires session authentication. Triggers a restart of the user’s agent container. The agent automatically runs openclaw doctor --fix on startup, which performs health checks and applies any pending migrations.

Response

Error responses

When the user has no deployed agent:
When the backend restart call fails:
Restarting an agent causes a brief period of downtime while the container reinitializes. The openclaw doctor --fix process runs automatically during startup and may take additional time depending on the number of pending fixes or migrations.