> For the complete documentation index, see [llms.txt](https://docs.clusters.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clusters.xyz/getting-started/api/v1/clusters.md).

# Clusters

### Create a Cluster

<mark style="color:green;">`POST`</mark> `/v1/clusters`

Create a cluster

<table><thead><tr><th width="385.23046875">Name</th><th>Description</th></tr></thead><tbody><tr><td>HEADER <code>Authorization: Bearer {AUTHKEY}</code></td><td><a href="/pages/6AGkfCSOcnx2jBGZ0ljQ">Authentication from wallet</a></td></tr></tbody></table>

**Example**

```bash
curl --request POST \
  --url https://api.clusters.xyz/v1/clusters \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer AUTHKEY'
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "id": "0x000049d953f88ab10f1b2778275028894602c41bbe6ea42bf46695d4edc5b6d6",
}
```

{% endtab %}
{% endtabs %}

***

### Cluster by ID

<mark style="color:green;">`GET`</mark> `/v1/clusters/id/:id`

Get the cluster from an id

| Name | Description   |
| ---- | ------------- |
| `id` | ID of cluster |

**Example**

```bash
curl --request GET \
  --url https://api.clusters.xyz/v1/clusters/id/0xa8d12b92b91fe0db3651ff2d45c1f47b1bb343054e9cd1e556c73f2330269224
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "id": "0xa8d12b92b91fe0db3651ff2d45c1f47b1bb343054e9cd1e556c73f2330269224",
  "createdBy": "0x5cff9c1362a71247da33887be2a44ac36a8724bb",
  "createdAt": "2024-02-14 21:39:05+00",
  "wallets": [
    {
      "address": "0x5cff9c1362a71247da33887be2a44ac36a8724bb",
      "name": "main",
      "isVerified": true,
      "isPrivate": false,
      "isBackedUp": false,
      "updatedAt": "2024-02-09 15:21:22+00",
      "updatedBy": "0x5cff9c1362a71247da33887be2a44ac36a8724bb",
      "createdAt": "2024-02-09 15:21:22+00"
    }
  ],
  "isTestnet": false
}
```

{% endtab %}
{% endtabs %}

***

### Cluster by Name

<mark style="color:green;">`GET`</mark> `/v1/clusters/name/:name`

Get the cluster from a name

| Name   | Description  |
| ------ | ------------ |
| `name` | Cluster name |

**Example**

```bash
curl --request GET \
  --url https://api.clusters.xyz/v1/clusters/name/clusters
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "id": "0xa8d12b92b91fe0db3651ff2d45c1f47b1bb343054e9cd1e556c73f2330269224",
  "createdBy": "0x5cff9c1362a71247da33887be2a44ac36a8724bb",
  "createdAt": "2024-02-14 21:39:05+00",
  "wallets": [
    {
      "address": "0x5cff9c1362a71247da33887be2a44ac36a8724bb",
      "name": "main",
      "isVerified": true,
      "isPrivate": false,
      "isBackedUp": false,
      "updatedAt": "2024-02-09 15:21:22+00",
      "updatedBy": "0x5cff9c1362a71247da33887be2a44ac36a8724bb",
      "createdAt": "2024-02-09 15:21:22+00"
    }
  ],
  "isTestnet": false
}
```

{% endtab %}
{% endtabs %}

***

### Cluster ID by address

<mark style="color:green;">`GET`</mark> `/v1/clusters/address/:address`

Get the cluster from an id

| Name      | Description                   |
| --------- | ----------------------------- |
| `address` | Verified address of a cluster |

**Example**

```bash
curl --request GET \
  --url https://api.clusters.xyz/v1/clusters/address/0x5cff9c1362a71247da33887be2a44ac36a8724bb
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "clusterId": "0xa8d12b92b91fe0db3651ff2d45c1f47b1bb343054e9cd1e556c73f2330269224"
}
```

{% endtab %}
{% endtabs %}

***

### Add wallets

<mark style="color:green;">`POST`</mark> `/v1/clusters/wallets`

Add wallets to the cluster the authenticated wallet is in

<table><thead><tr><th width="375.26171875">Name</th><th>Description</th></tr></thead><tbody><tr><td>HEADER <code>Authorization: Bearer {AUTHKEY}</code></td><td><a href="/pages/6AGkfCSOcnx2jBGZ0ljQ">Authentication from wallet</a></td></tr><tr><td><code>body</code></td><td>{ address: string, name: string, isPrivate: boolean }[]</td></tr></tbody></table>

**Example**

```bash
curl --request POST \
  --url 'https://api.clusters.xyz/v1/clusters/wallets' \
  --header 'Authorization: Bearer AUTHKEY' \
  --header 'Content-Type: application/json' \
  --data '[{
  "address": "0x0000000000000000000000000000000000000011",
  "name": "new",
  "isPrivate": false
}]'
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "success": true,
}
```

{% endtab %}
{% endtabs %}

***

## Generate wallet

<mark style="color:green;">`POST`</mark> `/v1/clusters/generate/wallet`

Generate a wallet in a cluster that the authenticated wallet is in

<table><thead><tr><th width="385.23046875">Name</th><th>Description</th></tr></thead><tbody><tr><td>HEADER <code>Authorization: Bearer {AUTHKEY}</code></td><td><a href="/pages/6AGkfCSOcnx2jBGZ0ljQ">Authentication from wallet</a></td></tr><tr><td><code>body</code></td><td>{ address: string, name: string, isPrivate: boolean }[]</td></tr></tbody></table>

**Example**

```javascript
curl --request POST \
  --url 'https://api.clusters.xyz/v1/clusters/generate/wallet' \
  --header 'Authorization: Bearer AUTHKEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "solana",
  "name": "test",
  "isPrivate": false
}'
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  type: "evm",
  address: "0x9D212340B4E5F3a38B171b2971D678B95083d928",
  name: "test",
  share: "0xdb87682d04e71c99bf8964e51cf5ec4843f2c588946bf749324819df0ba9ee1fb66e67bc21b440817310724abd1fb41676f6e2b30923819cf647bcb94a097c2b148257c58f38280682419af6c1fdab21cb94827bab4c0c4fa1d6ce153635b591a8b5c706f2db8307d08bc54022d381599a661c11dc5ab39fd0fbc167aac81ed48b211e98192cb0b6344232a4c577a7754339be",
}
```

{% endtab %}
{% endtabs %}

***

### Update wallets

<mark style="color:green;">`PUT`</mark> `/v1/clusters/wallets/names`

Update wallets in a cluster that the authenticated wallet is in

<table><thead><tr><th width="385.23046875">Name</th><th>Description</th></tr></thead><tbody><tr><td>HEADER <code>Authorization: Bearer {AUTHKEY}</code></td><td><a href="/pages/6AGkfCSOcnx2jBGZ0ljQ">Authentication from wallet</a></td></tr><tr><td><code>body</code></td><td>{ address: string, name: string }[]</td></tr></tbody></table>

**Example**

```bash
curl --request PUT \
  --url 'https://api.clusters.xyz/v1/clusters/wallets/names' \
  --header 'Authorization: Bearer AUTHKEY' \
  --header 'Content-Type: application/json' \
  --data '[{
  "address": "0x0000000000000000000000000000000000000011",
  "name": "new"
}]'
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "success": true,
}
```

{% endtab %}
{% endtabs %}

## Remove wallets

<mark style="color:green;">`DELETE`</mark> `/v1/clusters/wallets`

Remove an array of addresses from the cluster of the authenticated wallet

<table><thead><tr><th width="385.23046875">Name</th><th>Description</th></tr></thead><tbody><tr><td>HEADER <code>Authorization: Bearer {AUTHKEY}</code></td><td><a href="/pages/6AGkfCSOcnx2jBGZ0ljQ">Authentication from wallet</a></td></tr><tr><td><code>body</code></td><td>string[]</td></tr></tbody></table>

**Example**

```bash
curl --request DELETE \
  --url 'https://api.clusters.xyz/v1/clusters/wallets' \
  --header 'Authorization: Bearer AUTHKEY' \
  --header 'Content-Type: application/json' \
  --data '["0x0000000000000000000000000000000000000011"]
}]'
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "success": true,
}
```

{% endtab %}
{% endtabs %}

## Verify wallet

<mark style="color:green;">`POST`</mark> `/v1/clusters/verify/:clusterId`

Verify the authenticated wallet in a specific cluster

<table><thead><tr><th width="385.23046875">Name</th><th>Description</th></tr></thead><tbody><tr><td>HEADER <code>Authorization: Bearer {AUTHKEY}</code></td><td><a href="/pages/6AGkfCSOcnx2jBGZ0ljQ">Authentication from wallet</a></td></tr><tr><td><code>clusterId</code></td><td>The cluster id you want to verify the wallet in</td></tr></tbody></table>

**Example**

```bash
curl --request POST \
  --url https://api.clusters.xyz/v1/clusters/verify/0x0 \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer AUTHKEY' \
}'
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "success": true,
}
```

{% endtab %}
{% endtabs %}
