v1

latestOpenAPI 3.1.02026-08-04151221521.2 KB
Branches

Rollback Environment

Roll back an environment to a previous version.

Resolves environment to branch via branch rules.
Only works for environments with a single, literal branch rule (no wildcards).

Key behavior:
- EnvVar table is NOT modified (remains pending state for next deploy)
- Uses Version.secrets_snapshot as deployed state
post/agents/{namespace_slug}/{agent_name}/environments/{env_name}/rollback

Path parameters

namespace_slugstring required
agent_namestring required
env_namestring required

Request body

target_version_idstring nullable

Version ID to rollback to (defaults to previous version if not specified)

Response

Successful Response

branch_idstring required

Branch ID

from_git_hashstring required

Git hash of the previous version

from_version_idstring required

Version ID that was rolled back FROM

messagestring required

Human-readable status message

to_git_hashstring required

Git hash of the target version

to_version_idstring required

Version ID that was rolled back TO

version_status'DEPLOYING' | 'ACTIVE' | 'FAILED' | 'UNHEALTHY' | 'DRAINING' | 'RETIRED' | 'ROLLED_BACK' required

Status of a version in its lifecycle.