## List Deployments

**get** `/agents/{agent_id}/deployments`

List deployments for an agent, newest first.

### Path Parameters

- `agent_id: string`

### Query Parameters

- `limit: optional number`

  Limit

- `order_by: optional string`

  Field to order by

- `order_direction: optional string`

  Order direction (asc or desc)

- `page_number: optional number`

  Page number

### Returns

- `id: string`

  The unique identifier of the deployment.

- `agent_id: string`

  The agent this deployment belongs to.

- `docker_image: string`

  Full Docker image URI.

- `is_production: boolean`

  Whether this is the production deployment.

- `status: "Pending" or "Ready" or "Failed"`

  Current deployment status.

  - `"Pending"`

  - `"Ready"`

  - `"Failed"`

- `acp_url: optional string`

  ACP URL set when agent registers.

- `created_at: optional string`

  When the deployment was created.

- `expires_at: optional string`

  When marked for cleanup.

- `helm_release_name: optional string`

  Helm release name for cleanup.

- `promoted_at: optional string`

  When promoted to production.

- `registration_metadata: optional map[unknown]`

  Git/build metadata from the agent pod.

- `sgp_deploy_id: optional string`

  Correlates to SGP's agentex_deploys.id.

### Example

```http
curl http://localhost:5003/agents/$AGENT_ID/deployments \
    -H "Authorization: Bearer $AGENTEX_SDK_API_KEY"
```

#### Response

```json
[
  {
    "id": "id",
    "agent_id": "agent_id",
    "docker_image": "docker_image",
    "is_production": true,
    "status": "Pending",
    "acp_url": "acp_url",
    "created_at": "2019-12-27T18:11:19.117Z",
    "expires_at": "2019-12-27T18:11:19.117Z",
    "helm_release_name": "helm_release_name",
    "promoted_at": "2019-12-27T18:11:19.117Z",
    "registration_metadata": {
      "foo": "bar"
    },
    "sgp_deploy_id": "sgp_deploy_id"
  }
]
```
