## List Deployments

`agents.deployments.list(stragent_id, DeploymentListParams**kwargs)  -> DeploymentListResponse`

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

List deployments for an agent, newest first.

### Parameters

- `agent_id: str`

- `limit: Optional[int]`

  Limit

- `order_by: Optional[str]`

  Field to order by

- `order_direction: Optional[str]`

  Order direction (asc or desc)

- `page_number: Optional[int]`

  Page number

### Returns

- `List[DeploymentListResponseItem]`

  - `id: str`

    The unique identifier of the deployment.

  - `agent_id: str`

    The agent this deployment belongs to.

  - `docker_image: str`

    Full Docker image URI.

  - `is_production: bool`

    Whether this is the production deployment.

  - `status: Literal["Pending", "Ready", "Failed"]`

    Current deployment status.

    - `"Pending"`

    - `"Ready"`

    - `"Failed"`

  - `acp_url: Optional[str]`

    ACP URL set when agent registers.

  - `created_at: Optional[datetime]`

    When the deployment was created.

  - `expires_at: Optional[datetime]`

    When marked for cleanup.

  - `helm_release_name: Optional[str]`

    Helm release name for cleanup.

  - `promoted_at: Optional[datetime]`

    When promoted to production.

  - `registration_metadata: Optional[Dict[str, object]]`

    Git/build metadata from the agent pod.

  - `sgp_deploy_id: Optional[str]`

    Correlates to SGP's agentex_deploys.id.

### Example

```python
import os
from agentex import Agentex

client = Agentex(
    api_key=os.environ.get("AGENTEX_SDK_API_KEY"),  # This is the default and can be omitted
)
deployments = client.agents.deployments.list(
    agent_id="agent_id",
)
print(deployments)
```

#### 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"
  }
]
```
