# Validator

## Get all validators

<mark style="color:blue;">`GET`</mark> `https://www.allnodes.com/api/v1/node`

This endpoint allows to get list of all your hosted validators.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

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

```
[
  {
    id: string;
    ip: string;
    name: string;
    currencySymbol: string;
    createdAt: string;
    payoutFrequencySeconds: number | null;
    apr: string | null;
    instance: {
      version: string;
      status: string;
      uptimeSeconds: number | null;
      lastSeenAt: string | null;
    };
    address: {
      collateralAddress: string;
      collateralHash: string;
      collateralIndex: number;
      payeeAddress: string;
      balanceAmount: number;
      rewardsEarned: number;
      lastRewardAt: string | null;
    };
    settings: {
      walletType: 'ledger' | 'trezor' | 'core' | null;
    };
  }
]
```

{% endtab %}
{% endtabs %}

## Get a validator

<mark style="color:blue;">`GET`</mark> `https://www.allnodes.com/api/v1/node/{id}`

This endpoint allows to get info about specific validator on your account.

#### Path Parameters

| Name                                 | Type   | Description                                                                                  |
| ------------------------------------ | ------ | -------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark> | string | Validator you want to get info about. ID can be extracted from the “Get all validators” call |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

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

```typescript
{
  id: string;
  ip: string;
  name: string;
  currencySymbol: string;
  createdAt: string;
  payoutFrequencySeconds: number | null;
  apr: string | null;
  instance: {
    version: string;
    status: string;
    uptimeSeconds: number | null;
    lastSeenAt: string | null;
  };
  address: {
    collateralAddress: string;
    collateralHash: string;
    collateralIndex: number;
    payeeAddress: string;
    balanceAmount: number;
    rewardsEarned: number;
    lastRewardAt: string | null;
  };
  settings: {
    walletType: 'ledger' | 'trezor' | 'core' | null;
  };
}
```

{% endtab %}

{% tab title="404 Validator not found" %}

```javascript
{
  "error": "NODE_NOT_FOUND"
}
```

{% endtab %}
{% endtabs %}

## Remove a validator

<mark style="color:red;">`DELETE`</mark> `https://www.allnodes.com/api/v1/node/{id}`

This endpoint allows you to remove validator from hosting.

#### Path Parameters

| Name                                 | Type   | Description                                                                          |
| ------------------------------------ | ------ | ------------------------------------------------------------------------------------ |
| id<mark style="color:red;">\*</mark> | string | Validator you want to remove. ID can be extracted from the “Get all validators” call |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

{% tabs %}
{% tab title="204 Validator successfully removed" %}

```
```

{% endtab %}

{% tab title="404 Example of error response" %}

```javascript
{
  "error": "NODE_NOT_FOUND"
}
```

{% endtab %}
{% endtabs %}
