# List clusters

URL: https://docs.hanzo.ai/docs/openapi/deploy/get-deploy-clusters

> Returns the argocd ClusterList of the destinations the caller's applications reconcile into: one entry per distinct destination server, carrying the count of applications reconciling into it.

`GET /v1/deploy/clusters`

> [Deploy →](https://docs.hanzo.ai/docs/openapi/deploy) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                           |
| ------------- | ----------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/deploy/clusters` |
| **Method**    | `GET`                                     |
| **Operation** | `get_deploy_clusters`                     |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`    |

Returns the argocd ClusterList of the destinations the
caller's applications reconcile into: one entry per distinct destination
server, carrying the count of applications reconciling into it. The in-cluster
destination is always present, so an empty fleet still answers one cluster, and
no cluster credential can appear — the projected type physically has no config
field.

It is TENANT-SCOPED and reads the SAME App CRs the applications list reads: a
platform SuperAdmin counts the whole fleet, a validated org member counts only
its own org's applications, anyone else is refused.

## Request

`GET /v1/deploy/clusters` takes no parameters and no body — the credential is the whole request.

## Response

| Status    | Body                   | Meaning |
| --------- | ---------------------- | ------- |
| `200`     | deploy.argoClusterList | ok      |
| `default` | problem-details        | refused |

`200` body — 16 fields.

| Field                                      | In   | Type                       | Always | Description                                                                                                                                                                        |
| ------------------------------------------ | ---- | -------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `items`                                    | body | deploy.argoCluster\[]      | —      | Items is one entry per distinct destination server, in first-seen order with the in-cluster destination first.                                                                     |
| `items[].connectionState`                  | body | deploy.argoConnectionState | —      |                                                                                                                                                                                    |
| `items[].connectionState.attemptedAt`      | body | string                     | —      | AttemptedAt is when the connection was last probed.                                                                                                                                |
| `items[].connectionState.message`          | body | string                     | —      | Message is why a connection failed.                                                                                                                                                |
| `items[].connectionState.status`           | body | string                     | —      | Status is ArgoCD's ConnectionStatus — Successful, Failed or Unknown.                                                                                                               |
| `items[].info`                             | body | deploy.argoClusterInfo     | —      |                                                                                                                                                                                    |
| `items[].info.applicationsCount`           | body | integer (int64)            | —      | ApplicationsCount is how many of THE CALLER'S applications reconcile into this cluster, so a tenant sees its own count and a SuperAdmin the fleet's.                               |
| `items[].info.connectionState`             | body | deploy.argoConnectionState | —      |                                                                                                                                                                                    |
| `items[].info.connectionState.attemptedAt` | body | string                     | —      | AttemptedAt is when the connection was last probed.                                                                                                                                |
| `items[].info.connectionState.message`     | body | string                     | —      | Message is why a connection failed.                                                                                                                                                |
| `items[].info.connectionState.status`      | body | string                     | —      | Status is ArgoCD's ConnectionStatus — Successful, Failed or Unknown.                                                                                                               |
| `items[].info.serverVersion`               | body | string                     | —      | ServerVersion is the kubernetes version of the destination.                                                                                                                        |
| `items[].name`                             | body | string                     | —      | Name is what the Destination column shows: "in-cluster" for this cluster, otherwise whatever spec.destination.name declares, falling back to the server URL when it declares none. |
| `items[].server`                           | body | string                     | —      | Server is the destination's API URL, and the key the list is deduplicated by.                                                                                                      |
| `metadata`                                 | body | deploy.argoListMeta        | —      |                                                                                                                                                                                    |
| `metadata.resourceVersion`                 | body | string                     | —      | ResourceVersion is the k8s list version a watch would resume from.                                                                                                                 |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo deploy clusters
```

**SDK**

**.ts**

```ts
import { Configuration, DeployApi } from 'hanzoai';

const api = new DeployApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getDeployClusters();
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import DeployApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = DeployApi(client).get_deploy_clusters()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.DeployAPI.GetDeployClusters(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, deploy_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = deploy_api::get_deploy_clusters(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.DeployApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new DeployApi(client).getDeployClusters();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/deploy/clusters \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **deploy** through the `deploy` tool, which names its 11 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_deploy_applications"
         }
       }
     }'
```

---

[Deploy API](https://docs.hanzo.ai/docs/openapi/deploy) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
