Cloud SaaS deployments expose runtime lifecycle operations through the deployment API namespace: pause idle agents, resume them on demand, create and list state backups, and restore from a backup.
All endpoints live under /api/cloud-saas/deployments/:id.
GET /manifest returns the deployment's linked template, manifest revision, config hash, and drift state (up-to-date, template-updated, missing-template, unlinked, or unknown). The normal deployment list remains redacted; use this endpoint when a dashboard or CLI needs to explain where a running deployment came from.
POST /template saves the deployed config snapshot as an editable template. Owned draft/rejected community templates are updated in place; official, approved, or pending templates are forked.
POST /redeploy still accepts an empty body for the existing snapshot redeploy behavior. It also accepts:
| Field | Type | Required | Description |
|---|---|---|---|
mode | snapshot or template | No | Use the deployed snapshot or the latest linked template content. |
templateSlug | string | No | Redeploy from a specific accessible template. |
configSnapshot | object | No | Redeploy from an explicit config snapshot after server-side policy validation. |
envVars | object | No | Override declared template env vars for this redeploy. |
| Field | Type | Required | Description |
|---|---|---|---|
agentId | string | No | Target agent ID. Defaults to the first agent in the deployment config. |
Pauses a running agent-sandbox workload by scaling its Sandbox to 0. The PVC is retained for later resume or restore. Only the current deployment in a namespace can be paused.
Response (200):
Possible errors: 404 deployment not found, 409 cannot pause a historical deployment, 422 unsupported status.
| Field | Type | Required | Description |
|---|---|---|---|
agentId | string | No | Target agent ID. Defaults to the first agent in the deployment config. |
Resumes a paused agent-sandbox workload by scaling its Sandbox back to 1. The agent will pick up from its saved state on the PVC.
Response (200):
Possible errors: 404 deployment not found, 409 cannot resume a historical deployment, 422 unsupported status, 502 resume failed.
| Query | Type | Description |
|---|---|---|
agentId | string | Filter backups by agent ID. |
Returns all backup records for the deployment, including status and phase fields that track progress through snapshot creation, object archive upload, PVC restore, and sandbox resume.
Response:
| Field | Type | Required | Description |
|---|---|---|---|
agentId | string | No | Target agent ID. Defaults to the first agent in the deployment config. |
driver | string | No | Backup driver: volumeSnapshot (default if available) or restic for object archive fallback. |
retentionDays | number | No | Days before the backup artifact expires (1–365). |
Creates a state backup for the deployment. When the cluster supports CSI VolumeSnapshot and the target PVC is backed by a CSI StorageClass with a matching VolumeSnapshotClass, the API creates a VolumeSnapshot. Otherwise it falls back to an object archive (pod-based tar.gz, optionally encrypted).
The backup runs asynchronously. The response returns 202 with the backup record. Check the backup phase field to track progress: queued → snapshot-creating or object-archiving → completed.
Response (202):
Possible errors: 404 deployment not found, 409 another operation is already running in this namespace, 422 unsupported status or VolumeSnapshot not available.
| Field | Type | Required | Description |
|---|---|---|---|
agentId | string | No | Target agent ID. Defaults to the first agent in the deployment config. |
backupId | string | No | Backup record ID. If omitted, the most recent succeeded backup is used. |
Restores deployment state from a backup. The restore process:
The operation runs asynchronously and returns 202. Check the backup phase field to track progress: restoring-pausing → restoring-pvc → restoring-resuming → completed.
Response (202):
Possible errors: 404 deployment or backup not found, 409 another operation is running in this namespace, 422 unsupported status or backup driver.
Cloud deployments that are paused will automatically resume when the platform detects activity:
| Trigger | Event | Behavior |
|---|---|---|
| Message mention | A user @mentions a Buddy in a channel or thread | The Buddy's paused deployment resumes so it can respond. |
| Agent heartbeat | An agent sends a heartbeat or usage snapshot | If the agent's owner has a paused deployment, it resumes to serve the heartbeat. |
| App proxy request | A user opens a URL-type app or proxies a request through the app | The deployment resumes. If the timeout is reached, a 503 with Retry-After: 5 is returned. |
App proxy auto-resume is synchronous (waits up to 25s). Message mention and agent heartbeat auto-resumes are fire-and-forget.
Deployments progress through these statuses:
The resuming status is transient between paused and deployed. The failed status with reasons like cancelled by user or superseded-by-newer-deployment is not shown to users.
sandbox command group.