Deployments API

Deployment records are exposed through /deployments, and creation is currently available both through /deployments and the agent deploy route.

Current Implementation Notes

  • POST /deployments creates a deployment when given an owned agent_id.

  • POST /agents/{agent_id}/deploy is still available as the agent-centric create path.

  • Deployment restart, logs, and metrics routes exist in the current FastAPI app.

  • POST /deployments/{deployment_id}/scale only succeeds when the deployment status is running or ready.

Routes

Route
Purpose

GET /deployments

List deployments

POST /deployments

Create a deployment for an owned agent

GET /deployments/{deployment_id}

Get one deployment

GET /deployments/{deployment_id}/events

Get paginated lifecycle history for one deployment

GET /deployments/{deployment_id}/logs

Get deployment logs

GET /deployments/{deployment_id}/metrics

Get deployment metrics

POST /deployments/{deployment_id}/restart

Restart a stopped or failed deployment

POST /deployments/{deployment_id}/scale

Change replica count

DELETE /deployments/{deployment_id}

Mark deployment as killed

Create a Deployment

That returns a deployment id you can use with the routes below.

Direct deployment creation is also available:

List Deployments

Supported query parameters:

  • skip

  • limit

  • agent_id

  • status

Get a Deployment

Example response:

Deployment Event History

Supported query parameters:

  • skip

  • limit

  • event_type

  • status

Example response:

This route returns newest-first lifecycle history and makes it possible to page through deployment state transitions over time. The top-level deployment_id and deployment_status fields let operators render history context without making a second deployment-detail request.

Scale a Deployment

If the deployment is not running or ready, the API returns 400 with Can only scale running deployments.

Restart a Deployment

Current implementation note: restart only succeeds from stopped or failed deployment states.

Deployment Logs

Deployment Metrics

Delete a Deployment

Current implementation note: delete marks the deployment as killed, sets ended_at, and updates the parent agent to stopped when found.

Status Values Seen in the Codebase

Deployments may show statuses such as:

  • deploying

  • running

  • ready

  • stopped

  • failed

  • killed

Last updated