## Get an agent deployment

`client.deploy.retrieve(stringdeploymentID, RequestOptionsoptions?): AgentexCloudDeploy`

**get** `/v5/agentex/deployments/{deployment_id}`

Get a single agent deployment by ID, including its current status and Kubernetes events.

Returns the deployment record with its latest status and the associated
Kubernetes events (`deploy_events`) observed for the release, which are useful
for diagnosing why a deployment is still pending or unhealthy. Poll this after
`POST /v5/agentex/deployments` to track the asynchronous deploy to completion.
For the incremental log output rather than status and events, use
`GET /v5/agentex/deployments/{deployment_id}/logs`. Returns 404 if no deployment
with this ID exists for the caller's account.

### Parameters

- `deploymentID: string`

### Returns

- `AgentexCloudDeploy`

  - `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.

  - `created_by: Identity`

    The identity that created the entity.

    - `id: string`

    - `type: "user" | "service_account"`

      - `"user"`

      - `"service_account"`

    - `object?: "identity"`

      - `"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?: string`

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

  - `deploy_events?: Array<AgentexCloudDeployEvent>`

    Kubernetes events for this deployment.

    - `message?: string`

      Full event message.

    - `reason?: string`

      Short reason, e.g. 'Pulling', 'Scheduled'.

    - `timestamp?: string`

      When the event was observed.

    - `type?: string`

      Event type, e.g. 'Normal' or 'Warning'.

  - `expires_at?: 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.

  - `helm_release_name?: string`

    Helm release name after successful deployment.

  - `object?: "agentex_cloud_deploy"`

    - `"agentex_cloud_deploy"`

  - `preview_label?: 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.

### Example

```typescript
import SGPClient from 'scale-gp';

const client = new SGPClient({
  accountID: 'My Account ID',
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

const agentexCloudDeploy = await client.deploy.retrieve('deployment_id');

console.log(agentexCloudDeploy.id);
```

#### Response

```json
{
  "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"
}
```
