Skip to content

Deploy a built agent image

POST/v5/agentex/deployments

Deploy a successfully built agent image to Kubernetes as a Helm release.

Takes a completed build (referenced by build_id, or by image_name + image_tag) together with the agent manifest and environment config, then starts an asynchronous Temporal workflow that provisions the agent as a Helm release. The call returns immediately with the deployment record in PENDING status — it does not wait for the release to become healthy; poll GET /v5/agentex/deployments/{deployment_id} for status and Kubernetes events and GET /v5/agentex/deployments/{deployment_id}/logs for progress. This is the deploy counterpart to POST /v5/agentex/builds: a build produces the container image, a deployment runs that image. The referenced build must have finished successfully, and the manifest’s agent name must match the build’s agent.

Set preview=True for an ephemeral deployment: it gets a globally unique Helm release name (so concurrent redeploys never collide), an optional preview_label for grouping, and an expiry (expires_at, defaulting to 8 hours from now); preview_label and expires_at are rejected on non-preview deploys. A non-preview (production) deploy instead supersedes any prior active deployment that shares its Helm release name. Fails with a client error if the build is missing or not in a successful state, if the manifest or environment YAML is invalid or their agent names disagree, or if a secret referenced by the manifest does not exist.

Body ParametersJSONExpand Collapse
environment_config: string

YAML content of environment configuration from the environment config file.

manifest_file: string

YAML content of manifest configuration.

build_id: optional string

The build_id of the cloud build. Required if image_name and image_tag are not provided.

expires_at: optional string

ISO 8601 expiry timestamp. Only valid for preview deployments. If omitted on a preview deployment, defaults to 8 hours from now. Previews are always ephemeral and always have an expires_at.

formatdate-time
image_name: optional string

Name of the image to deploy. Required if build_id is not provided.

image_tag: optional string

Tag of the image to deploy. Required if build_id is not provided.

preview: optional boolean

When True, creates a preview deployment with a unique deployment-id suffix appended to the helm release name.

preview_label: optional string

Non-unique grouping label for the preview (e.g. branch name, PR number). Persisted on the deployment record so callers can list all deploys for a given label via GET /v5/agentex/deployments?preview_label=X&limit=1 (get the latest). Sanitized to lowercase alphanumeric + hyphens for K8s DNS-label compatibility (max 30 characters after sanitization). Each deploy still gets a unique helm release name regardless of label, so concurrent redeploys never share K8s resources. Only valid when preview=True.

ReturnsExpand Collapse
AgentexCloudDeploy object { id, account_id, created_at, 11 more }
id: string

The unique identifier of the deployment.

account_id: string

The ID of the account that owns the given entity.

created_at: string

The date and time when the entity was created in ISO format.

formatdate-time
created_by: Identity { id, type, object }

The identity that created the entity.

id: string
type: "user" or "service_account"
One of the following:
"user"
"service_account"
object: optional "identity"
environment_config: string

YAML content of environment configuration from the environment config file.

manifest_file: string

YAML content of manifest configuration.

namespace: string

Kubernetes namespace where the deployment is deployed.

status: string

Deployment status: pending, running, completed, failed, or cancelled.

build_id: optional string

The build_id of the cloud build that produced the deployed image.

deploy_events: optional array of AgentexCloudDeployEvent { message, reason, timestamp, type }

Kubernetes events for this deployment.

message: optional string

Full event message.

reason: optional string

Short reason, e.g. ‘Pulling’, ‘Scheduled’.

timestamp: optional string

When the event was observed.

formatdate-time
type: optional string

Event type, e.g. ‘Normal’ or ‘Warning’.

expires_at: optional string

When this deployment will be cleaned up. Always set on preview deployments (defaults to 8 hours from creation if the request omits it). Null on non-preview deployments — they have no TTL.

formatdate-time
helm_release_name: optional string

Helm release name after successful deployment.

object: optional "agentex_cloud_deploy"
preview_label: optional string

Non-unique grouping label for preview deployments. Filter ?preview_label=X&limit=1 returns the latest deploy for the label. Sanitized (lowercase alphanumeric + hyphens) and capped at 30 characters.

Deploy a built agent image

curl https://api.egp.scale.com/v5/agentex/deployments \
    -H 'Content-Type: application/json' \
    -H "x-api-key: $SGP_API_KEY" \
    -d '{
          "environment_config": "environment_config",
          "manifest_file": "manifest_file"
        }'
{
  "id": "id",
  "account_id": "account_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "environment_config": "environment_config",
  "manifest_file": "manifest_file",
  "namespace": "namespace",
  "status": "status",
  "build_id": "build_id",
  "deploy_events": [
    {
      "message": "message",
      "reason": "reason",
      "timestamp": "2019-12-27T18:11:19.117Z",
      "type": "type"
    }
  ],
  "expires_at": "2019-12-27T18:11:19.117Z",
  "helm_release_name": "helm_release_name",
  "object": "agentex_cloud_deploy",
  "preview_label": "preview_label"
}
Returns Examples
{
  "id": "id",
  "account_id": "account_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "environment_config": "environment_config",
  "manifest_file": "manifest_file",
  "namespace": "namespace",
  "status": "status",
  "build_id": "build_id",
  "deploy_events": [
    {
      "message": "message",
      "reason": "reason",
      "timestamp": "2019-12-27T18:11:19.117Z",
      "type": "type"
    }
  ],
  "expires_at": "2019-12-27T18:11:19.117Z",
  "helm_release_name": "helm_release_name",
  "object": "agentex_cloud_deploy",
  "preview_label": "preview_label"
}