# Node Provisioning APIs

### What are the Node Provisioning APIs?

1. [**Provision Request API:**](#provisioning-request)\
   The client calls this API to initiate a request which creates the transaction objects that the client needs to sign.
2. [**Get Validator Objects API:**](#get-validator-objects)\
   The client calls this API to retrieve the transaction objects used to stake with the Beacon deposit contract.
3. [Add Stake API:](#add-stake-request)

   The client calls this API add more stake to an existing validator by retrieving the transaction objects used to stake with the Beacon deposit contract.
4. [**Get Deposit Details API:**](#get-deposit-details)

   The client invokes this API to fetch deposit data, which can subsequently be utilized for staking with the Beacon deposit contract.
5. [**Get Validator and Provision API:**](#get-validator-and-provision-ids)

   The client calls this API to receive the validator objects which were created along with their respective provision IDs.&#x20;
6. [**Get Validator Count API:**](#get-validator-count)

   The client invokes this API to get the number of validators by their validator status.

In essence, the Node Provisioning APIs allow clients to spin up new Ethereum nodes via REST APIs. These APIs can be used to generate and receive the transaction objects which must be signed using the Beacon deposit contract. A detailed account of the APIs involved is provided in the following section.

## API Reference

* [Supported Environments](#supported-environments)&#x20;
* [Provision Request](#provisioning-request)
  * [Sample Request](#sample-request)
  * [Types](#types)
    * [Attributes Object](#attributes-object)
    * [Provision Response Object](#provision-response-object)
* [Get Validator Objects](#get-validator-objects)
  * [Sample Request](#sample-request-1)
  * [Types](#types-1)
    * [Paginated Response Object](#paginated-response-object)
    * [Validator Result Object](#validator-result-object)
    * [Provision Status Enum](#provision-status-enum)
    * [Validator Status Enum](#validator-status-enum)
* [Add Stake ](#add-stake-request)
  * [Sample Request](#sample-request-2)
  * [Types](#types-2)
    * [Add Stake Response Object](#id-200-ok-add-stake-response-object)
* [Get Deposit Details](#get-deposit-details)
  * [Sample Request](#sample-request-2)
  * [Types](#types-2)
    * [Paginated Response Object](#paginated-response-object-1)
    * [Deposit Details Object](#deposit-details-object)
* [Get Validator and Provision ID](#get-validator-and-provision-ids)
  * [Sample Request](#sample-request-2)
  * [Types](#types-2)
    * [Paginated Response Object](#paginated-response-object-1)
    * [Validator Result Object](#validator-result-object-1)
* [Get Validator Count](#get-validator-count)
  * [Sample Request](#sample-request-4)
  * [Types](#types-4)
    * [Result Object](#result-object)&#x20;
    * [Status Object](#status-object)

### Supported Environments

Luganodes supports the following environments on ETH, as defined below

<table data-header-hidden><thead><tr><th width="356">Base URL</th><th>ETH Network</th></tr></thead><tbody><tr><td><a href="https://holesky.eth-staking.lgns.net/api
">https://testnet.eth-staking.lgns.net</a></td><td>Hoodi Testnet</td></tr><tr><td><a href="https://mainnet.eth-staking.lgns.net/api">https://mainnet.eth-staking.lgns.net</a></td><td>Ethereum Mainnet </td></tr></tbody></table>

## Provisioning Request

<mark style="color:green;">`POST`</mark> `/api/provision`

Submits a provision request to our secure node systems to generate the required files based on the withdrawal address and the number of validators sent in the request.

The response will contain a UUID which can be used to track the provision request.

#### Headers

| Name                                      | Type   | Description                   |
| ----------------------------------------- | ------ | ----------------------------- |
| api-key<mark style="color:red;">\*</mark> | String | API Key provided by Luganodes |

#### Request Body

| Name                                         | Type   | Description                             |
| -------------------------------------------- | ------ | --------------------------------------- |
| attributes<mark style="color:red;">\*</mark> | Object | [Attributes Object](#attributes-object) |

{% tabs %}
{% tab title="200: OK Provision Response Object" %}

```json
{
    "result": {
        "created": "2024-02-15T05:19:18.942Z",
        "status": "CREATED",
        "provisionId": "f1575191-0b13-4c6c-ae7b-61adfbea0d98",
        "validatorsCount": 3,
        "withdrawalAddress": "0xa08c6C9e3d0E28E0E9Ef17cE67899e8E06501dD2",
        "controllerAddress": "0x918D92fc2cA24379ba1EEa1dd1CA385Fc5C8df7c", //or null
        "feeRecipient": "0x2A0e48522876DbD8B414E938cbE4e05FD6A23811" //or null
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
A maximum of 100 validators can be requested in a single provision request. To provision more nodes, a new provision request must be sent.
{% endhint %}

#### **Sample Request**

```bash
curl --location '{{url}}/api/provision' \
--header 'api-key: ee908371-d13b-43dd-ae33-b854dade5e9d' \
--data '{
    "attributes": {
        "withdrawalAddress": "0xa08c6C9e3d0E28E0E9Ef17cE67899e8E06501dD2",
        "controllerAddress": "0x918D92fc2cA24379ba1EEa1dd1CA385Fc5C8df7c", //optional
        "feeRecipient": "0x2A0e48522876DbD8B414E938cbE4e05FD6A23811", //optional
        "validatorsCount": 3,
        "batch":true
        "compounding":true, //optional 
        "amountPerValidator":33 //optional 
    }
}'
```

#### **Types**

#### **Attributes Object**

<table><thead><tr><th width="204.33333333333331">Property</th><th width="480">Description</th><th>Type</th></tr></thead><tbody><tr><td>withdrawalAddress<mark style="color:red;">*</mark></td><td>Ethereum wallet address which will be used to create withdrawal credentials for the validator</td><td>String</td></tr><tr><td>controllerAddress</td><td>Address that can be used to sign the exit message. This field is optional</td><td>String</td></tr><tr><td>feeRecipient</td><td>Fee Recipient address of the validator that receive EL rewards. This field is optional</td><td>String</td></tr><tr><td>validatorsCount<mark style="color:red;">*</mark></td><td>Number of validators required</td><td>Number</td></tr><tr><td>batch<mark style="color:red;">*</mark></td><td><code>true</code> will return transaction objects for a batch deposit of all validators<br><code>false</code> will return individual transaction objects for each validators</td><td>Boolean</td></tr><tr><td>compounding</td><td><p><code>true</code> will return transaction objects for 0x02 type withdrawal credentials</p><p><br><code>false</code> will return transactions objects for 0x01 type withdrawal credentials<br><br>NOTE: 0x02 type validators can accommodate stake between 32 - 2048 ETH and are eligible for partial withdrawals.</p></td><td>Boolean</td></tr><tr><td>amountPerValidator</td><td>Stake amount that can be set for each validator with 0x02 type withdrawal credentials.<br><br>Default is 32 ETH</td><td>Number</td></tr></tbody></table>

#### Provision Response Object

<table><thead><tr><th width="194.33333333333331">Property</th><th width="469">Description</th><th>Type</th></tr></thead><tbody><tr><td>provisionId</td><td>Unique identifier of provisioning request</td><td>String</td></tr><tr><td>withdrawalAddress</td><td>Withdrawal address specified by user</td><td>String</td></tr><tr><td>status</td><td>status = "CREATED" will be sent as an acknowledgement</td><td>String</td></tr><tr><td>created</td><td>Timestamp of the creation of the provision request</td><td>String</td></tr><tr><td>validatorsCount</td><td>Number of validators</td><td>Number</td></tr><tr><td>controllerAddress</td><td>Address that can be used to sign the exit message</td><td>String</td></tr><tr><td>feeRecipient</td><td>Fee Recipient address of the validator that receive EL rewards</td><td>String</td></tr></tbody></table>

{% hint style="info" %}
If user is unable to sign exit transactions with their withdrawal address, we have added provisions to give signing privileges to controller address
{% endhint %}

## Get Validator Objects

<mark style="color:blue;">`GET`</mark> `/api/validators`

Retrieve the transaction objects that require signing by sending the UUID received in the Provisioning Request API.

#### Query Parameters

| Name                                          | Type   | Description                           |
| --------------------------------------------- | ------ | ------------------------------------- |
| provisionId<mark style="color:red;">\*</mark> | String | provisioning\_request\_uuid:YOUR UUID |
| page                                          | Number | page number to be fetched             |
| per\_page                                     | Number | Number of results per page            |

#### Headers

| Name                                      | Type   | Description                   |
| ----------------------------------------- | ------ | ----------------------------- |
| api-key<mark style="color:red;">\*</mark> | String | API Key provided by Luganodes |

{% tabs %}
{% tab title="200: OK Batch Contract Response" %}

```javascript
{
  "batch": true,
  "depositInput": "0xc82655b70000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000006083651cfd972c2170c85754cdcbf5b0ffe31ad96a37835a695d533b951cf2189aa86e4d8b3b4c84e59d0376570e41d31baa3ae8f0d1716cd13ef9874633b42157a43d95fb661457c7b85ba344709458e020491d852264e65c23f39d6d0374057e0000000000000000000000000000000000000000000000000000000000000020010000000000000000000000f345a81af5b23ae1fd0d08f97af1ac05ffad825c00000000000000000000000000000000000000000000000000000000000000c08bd5db0506969f1040e1f0bd0609eaf2d927a500cddf2298cfe8bb56112bd46bcf525f24fe9523fc99e0695f3076a40e01f3f95b6af3c3da0971b68cf3083a204819f55d803fa751d3c1e7c7cf220af12afda0f8bcc138c2dad69eee3ec2885c93bb41fc4e793ea1acb34034181d473c6f48c0591955fbf8d178701469b5f1b543c29a5a5eb4b58470ff44822a977a46010730e3869215ae7ddcb1b0efa4f6cc94705b24cd4c44932c92cd689a310bcd28c131704e98c9ded92bd5d02101ea870000000000000000000000000000000000000000000000000000000000000002e238a9ddbe247c643233a004fb0eae0d9682ee367580549ea0912880201c13f2c30fef3c554b82e5399bff17b31104e60be991af835b236a41c949d436d6c69e",
  "withdrawalAddress": "0xF345A81Af5b23Ae1fD0D08f97AF1aC05fFAd825c",
  "withdrawal_credentials": "0x010000000000000000000000a08c6c9e3d0e28e0e9ef17ce67899e8e06501dd2",
  "validatorsCount": 2,
  "clientId": "0c14fc15-9562-4fbe-bf02-f86e56a57d83",
  "provisionId": "321e7857-f81c-4d0c-9750-17a84d631aed",
  "provisionStatus": "CREATED",
  "results": [
    {
      "validatorIndex": null,
      "validatorAddress": "0x83651cfd972c2170c85754cdcbf5b0ffe31ad96a37835a695d533b951cf2189aa86e4d8b3b4c84e59d0376570e41d31b",
      "amount": 32000000000,
      "created": "2024-01-24T11:37:40.202Z",
      "status": "CREATED",
      "depositInput": null
    },
    {
      "validatorIndex": null,
      "validatorAddress": "0xaa3ae8f0d1716cd13ef9874633b42157a43d95fb661457c7b85ba344709458e020491d852264e65c23f39d6d0374057e",
      "amount": 32000000000,
      "created": "2024-01-24T11:37:40.202Z",
      "status": "CREATED",
      "depositInput": null
    }
  ],
  "page": null,
  "per_page": null,
  "total": 2,
  "pages": null
}
```

{% endtab %}

{% tab title="200: OK Non-Batch Contract Response" %}

```javascript
{
  "batch": false,
  "depositInput": null,
  "withdrawalAddress": "0xF345A81Af5b23Ae1fD0D08f97AF1aC05fFAd825c",
  "withdrawal_credentials": "0x010000000000000000000000a08c6c9e3d0e28e0e9ef17ce67899e8e06501dd2",
  "validatorsCount": 2,
  "clientId": "0c14fc15-9562-4fbe-bf02-f86e56a57d83",
  "provisionId": "b8b3fee5-dcdd-48f9-b706-a5d5a4e8ca87",
  "provisionStatus": "CREATED",
  "results": [
    {
      "validatorIndex": null,
      "validatorAddress": "0xb98a5ce144b937c578c76fd29b6e4cd8931a64409be40d07c2c155ed246d80d7be811c2c2a82f38614939df34bf5e389",
      "amount": 32000000000,
      "created": "2024-01-24T11:47:38.493Z",
      "status": "CREATED",
      "depositInput": "0x22895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120f26b4af336055faad90f23008dee3762b4c31832f87dc8768911939145554f5e0000000000000000000000000000000000000000000000000000000000000030b98a5ce144b937c578c76fd29b6e4cd8931a64409be40d07c2c155ed246d80d7be811c2c2a82f38614939df34bf5e389000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020010000000000000000000000f345a81af5b23ae1fd0d08f97af1ac05ffad825c00000000000000000000000000000000000000000000000000000000000000609772ef64086dd85016a0cdb924d7bef185d2b5406d656bfef23def9bf79057b5ba425b0dc662085338d66ff3c485b53f16a670b32a03172754db5c02cf38e2b7b6a713aa9bd02995c6b67f4d50eaf536bac3411ba199343d0d01fc267a5f756b"
    },
    {
      "validatorIndex": null,
      "validatorAddress": "0x8b085da6c957e3494d72f54f593031c8087ec10a2ae969693c1bc18e61d4d2073e54d70ffdec997260998f6359c2cf47",
      "amount": 32000000000,
      "created": "2024-01-24T11:47:38.493Z",
      "status": "CREATED",
      "depositInput": "0x22895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120147bbc9232026fc3617044feef15f28a499e24aa02f572c00b8ca5b592fc81d800000000000000000000000000000000000000000000000000000000000000308b085da6c957e3494d72f54f593031c8087ec10a2ae969693c1bc18e61d4d2073e54d70ffdec997260998f6359c2cf47000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020010000000000000000000000f345a81af5b23ae1fd0d08f97af1ac05ffad825c00000000000000000000000000000000000000000000000000000000000000609132e6942a666d11257f110697e3b563bba66e0a0400be618de95ef8a6dcee4d0e462a5db4071076164fa7a8120e4bd60566fd1f0e9373a21138ba9f9b5cc86866d06ef618fa502c7b60630dfeddf926e6819022196be242b8894361d7f5979d"
    }
  ],
  "page": null,
  "per_page": null,
  "total": 2,
  "pages": null
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Validators are provisioned asynchronously, and the automation script processes provision requests, generating the required files. Therefore, an empty array response is received until the script execution is completed.
{% endhint %}

#### Sample Request

{% code overflow="wrap" %}

```bash
curl --location '{{url}}/api/validators?per_page=10&page=1&provisionId=cd127302-570d-4b38-ba19-26ccf3a5dd2e' \
--header 'api-key: rNmE773fXgApKKAw$2btnNC9p5BdILMsDxxodrepgoU='
```

{% endcode %}

#### Types

#### Paginated Response Object

<table><thead><tr><th width="191.33333333333331">Field</th><th width="447">Description</th><th>Type</th></tr></thead><tbody><tr><td>batch</td><td>Batch Deposit</td><td>Boolean</td></tr><tr><td>depositInput</td><td>Data for executing the unsigned deposit transaction on the Beacon Deposit contract. Returns <code>null</code> for non-batch contract staking.</td><td>String</td></tr><tr><td>withdrawalAddress</td><td>Withdrawal address as specified by user</td><td>String</td></tr><tr><td>withdrawal_credentials</td><td>Withdrawal credential is derived from the withdrawal address that's used for deposit to beacon deposit contract</td><td>String</td></tr><tr><td>validatorsCount</td><td>Number of validators created</td><td>Number</td></tr><tr><td>clientId</td><td>Partner identifier associated with the API key</td><td>String</td></tr><tr><td>provisionId</td><td>Unique identifier of provisioning request</td><td>String</td></tr><tr><td>provisionStatus</td><td><a href="#provision-status-enum">Status of provision request</a></td><td>String</td></tr><tr><td>result</td><td>Array of <a href="#validator-result-object">validator objects</a></td><td>Array</td></tr><tr><td>page</td><td>Page number of fetched results</td><td>Number</td></tr><tr><td>per_page</td><td>Number of results per page</td><td>Number</td></tr><tr><td>pages</td><td>Total number of pages</td><td>Number</td></tr><tr><td>total</td><td>Number of results in total</td><td>Number</td></tr></tbody></table>

#### Validator Result Object

<table><thead><tr><th width="172.33333333333331">Field</th><th width="449">Description</th><th>Type</th></tr></thead><tbody><tr><td>amount</td><td>amount of ETH to be deposited </td><td>Number</td></tr><tr><td>validatorIndex</td><td>Index of validator on Ethereum chain</td><td>Number</td></tr><tr><td>status</td><td><a href="#validator-status-enum">Validator Status</a></td><td>String</td></tr><tr><td>validatorAddress</td><td>Validator public key</td><td>String</td></tr><tr><td>created</td><td>Delegation object creation time</td><td>String</td></tr><tr><td>depositInput </td><td>Unsigned deposit object for executing the transaction on the Beacon deposit contract. This field is applicable for non-batch contract staking.</td><td>String</td></tr></tbody></table>

#### Validator Status Enum

<table><thead><tr><th width="174">Field</th><th>Description</th></tr></thead><tbody><tr><td>CREATED</td><td>Validator was provisioned through Luganodes API</td></tr><tr><td>DEPOSITED</td><td>The deposit is waiting to be seen by the ETH chain</td></tr><tr><td>PENDING</td><td>Validator is in the queue waiting to go live</td></tr><tr><td>ACTIVE</td><td>Validator is participating and earning rewards</td></tr><tr><td>EXIT_REQUESTED</td><td>Exit has been requested by the client to the validator node</td></tr><tr><td>EXIT_SENT</td><td>Exit transaction for the validator is issued to the beacon chain</td></tr><tr><td>EXITED</td><td>Validator has exited from the network</td></tr><tr><td>UNKNOWN</td><td>Error while fetching the status of validator</td></tr></tbody></table>

#### Provision Status Enum

<table><thead><tr><th width="174">Field</th><th>Description</th></tr></thead><tbody><tr><td>IN_PROGRESS</td><td>Provision request is in progress</td></tr><tr><td>CREATED</td><td>Provision request successfully created</td></tr><tr><td>FAILED</td><td>Provision request failed</td></tr></tbody></table>

## Add Stake Request

<mark style="color:green;">`POST`</mark> `/validators/add-stake`

Submits a request to generate the transaction objects required to stake with the beacon deposit contract. This request allows users to add more stake to only active validators having 0x02 type withdrawal credentials. If validator does not have 0x02 type withdrawal credentials, it can be switched through the [Switch API](/apis/ethereum/consolidation-and-switch.md#switch-request).<br>

#### Headers

| Name                                      | Type   | Description                   |
| ----------------------------------------- | ------ | ----------------------------- |
| api-key<mark style="color:red;">\*</mark> | String | API Key provided by Luganodes |

#### Request Body

| Name                                     | Type   | Description                 |
| ---------------------------------------- | ------ | --------------------------- |
| pubKey<mark style="color:red;">\*</mark> | String | Public address of validator |
| amount<mark style="color:red;">\*</mark> | Number | Amount to be staked         |

{% tabs %}
{% tab title="200: OK Add Stake Response Object" %}

```json
{
    "validatorAddress": "0x81d90c9600a4fc1f69dfe4b4e3e708abb162b2122f2ef56ea79b48708c809005cc105b8e554856ce16a5c597dbfe1770",
    "addStakeAmount": 33000000000,
    "depositInput": "0x22895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120a7d807a1cac3d595c52f7b56aa5c17883e405ed1d654929dce97754ecef25170000000000000000000000000000000000000000000000000000000000000003081d90c9600a4fc1f69dfe4b4e3e708abb162b2122f2ef56ea79b48708c809005cc105b8e554856ce16a5c597dbfe17700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200200000000000000000000008c24b68141552e0844354b0b638031918caafaeb0000000000000000000000000000000000000000000000000000000000000060906721ab6235bc3d9f4291fe35faf9e579c1de843b3c421ff2fbc0e7eaccd80d7389969970b5ca69f43ecd644df9107d0995880a9bf7028f2f31b425cff23a735f7d29f1488443ba96d579d6db8371527757a73030b2d1f6e6832cfbea231c03"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Add stake operations can only be performed on active validators and cannot exceed a balance of 2048 ETH.  Additionally. this operation can only be performed on 0x02 type validators.
{% endhint %}

#### **Sample Request**

```bash
curl --location '{{url}}/api/validators/add-stake' \
--header 'api-key: ee908371-d13b-43dd-ae33-b854dade5o9d' \
--data '{
    "pubKey":"0x81d90c9600a4fc1f69dfe4b4e3e708abb162b2122f2ef56ea79b48708c809005cc105b8e554856ce16a5c597dbfe1770",
    "amount":33
}'
```

### **Types**

#### Add Stake Response Object

<table><thead><tr><th width="216.13020833333331">Property</th><th width="469">Description</th><th>Type</th></tr></thead><tbody><tr><td>validatorAddress</td><td>Public address of validator</td><td>String</td></tr><tr><td>addStakeAmount</td><td>Amount which needs to be staked </td><td>Object</td></tr><tr><td>depositInput</td><td>Unsigned deposit object for executing the transaction on the Beacon deposit contract.</td><td>String</td></tr></tbody></table>

## Get Deposit Details&#x20;

<mark style="color:blue;">`GET`</mark> `/api/deposit-details`

Retrieve the deposit data details that are required to staking in the Ethereum staking contract by sending the UUID received in the Provisioning Request API.

#### Query Parameters

| Name                                          | Type   | Description                           |
| --------------------------------------------- | ------ | ------------------------------------- |
| provisionId<mark style="color:red;">\*</mark> | String | provisioning\_request\_uuid:YOUR UUID |
| page                                          | Number | page number to be fetched             |
| per\_page                                     | Number | Number of results per page            |

#### Headers

| Name                                      | Type   | Description                   |
| ----------------------------------------- | ------ | ----------------------------- |
| api-key<mark style="color:red;">\*</mark> | String | API Key provided by Luganodes |

{% tabs %}
{% tab title="200: OK Response with deposit details " %}

```javascript
{
  "batch": false,
  "withdrawal_credentials": "0x010000000000000000000000a08c6c9e3d0e28e0e9ef17ce67899e8e06501dd2",
  "controllerAddress": "0x918D92fc2cA24379ba1EEa1dd1CA385Fc5C8df7c",
  "feeRecipient": "0x2A0e48522876DbD8B414E938cbE4e05FD6A23811",
  "validatorsCount": 2,
  "clientId": "1e40716f-b684-4dc7-a5a3-ba573a2a05de",
  "provisionId": "566afafa-4154-436e-a0aa-941de7e9bc53",
  "results": [
    {
      "validatorIndex": null,
      "validatorAddress": "0xb032c4194075e73126626e4d6a24a2f01db41f7cfc45e34a48a3f4dc38c52db790ef8818ea5b227277fa3747d312694e",
      "amount": 32000000000,
      "created": "2024-02-15T10:13:24.110Z",
      "status": "CREATED",
      "signature": "0x8fb4ce023e81d1113ee8f5cc962b248352c3ef9be0768e1262b5d0ec5c6d10ed59de826777cba411a2956c083885b05c18f574959c18f3b3ba7c1ca78420f1ee2f81195ff2441a517c36eedff25af86088e65057c57a91a0b4fbe51a8f448bbe",
      "deposit_data_root": "0x2bb2748126b0545b98001e36336952710a792a07fcd99f2462cf3c5c946394f4",
      "deposit_message_root": "0xaa28abd59101232a2eec07c97dfd38b7a0166f767202e56dc45dd99591388610",
      "fork_version": "0x00001020"
    },
    {
      "validatorIndex": null,
      "validatorAddress": "0x99f5759a47651b49b4a3ac6e718ba5e08a01d48c1ff6419bf561659e76c481f9fe93fb4b48dcad13a8ed21058c3d8a33",
      "amount": 32000000000,
      "created": "2024-02-15T10:13:24.110Z",
      "status": "CREATED",
      "signature": "0xafe703147da666044cc276e1cbae2543cf83578e814e692e7aab2cb9ed58679005c31fd7330a7bd8bf379d8ae326467b18f2515f053cc77cb3cbecc479c1cd00ad23054c71a1a40b4e7e2e555c7249628909176b2219bd5bf26aab70c948e490",
      "deposit_data_root": "0x123a26e89fcae9286fedd4ffe0caba245cfbe4f4a98a70c7016919bc77a76495",
      "deposit_message_root": "0x1f563a358f970e2d182d25f1b94f182b97b20cb912d457120ef06eb60a9f6f5b",
      "fork_version": "0x00001020"
    }
  ],
  "page": 1,
  "per_page": 10,
  "total": 2,
  "pages": 1
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The validator index will be set to `null` until the validator gets activated on the Ethereum network.
{% endhint %}

### Sample Request

```bash
curl --location '{{url}}/api/deposit-details?page=1&per_page=10&provisionId=cd127302-570d-4b38-ba19-26ccf3a5dd2e' \
--header 'api-key: moSAd1Rk/dVJSjm/baRSq7RIfZW5c1PS0PngJL04nHs='
```

#### Types

#### Paginated Response Object

<table><thead><tr><th width="191.33333333333331">Field</th><th width="447">Description</th><th>Type</th></tr></thead><tbody><tr><td>batch</td><td>Batch Deposit. <code>batch</code> is set to <code>false</code> in this API</td><td>Boolean</td></tr><tr><td>withdrawal_credentials</td><td>Withdrawal credential is derived from the withdrawal address that's used for deposit to beacon deposit contract</td><td>String</td></tr><tr><td>controllerAddress</td><td>Address that can be used to sign the exit message</td><td>String</td></tr><tr><td>feeRecipient</td><td>fee Recipient address of the validator that receive EL rewards</td><td>String</td></tr><tr><td>validatorsCount</td><td>Number of validators created</td><td>Number</td></tr><tr><td>clientId</td><td>Partner identifier associated with the API key</td><td>String</td></tr><tr><td>provisionId</td><td>Unique identifier of provisioning request</td><td>String</td></tr><tr><td>result</td><td>Array of <a href="#deposit-details-object">deposit details objects</a></td><td>Array</td></tr><tr><td>page</td><td>Page number of fetched results</td><td>Number</td></tr><tr><td>per_page</td><td>Number of results per page</td><td>Number</td></tr><tr><td>pages</td><td>Total number of pages</td><td>Number</td></tr><tr><td>total</td><td>Number of results in total</td><td>Number</td></tr></tbody></table>

#### Deposit Details Object

<table><thead><tr><th width="216.33333333333331">Field</th><th width="449">Description</th><th>Type</th></tr></thead><tbody><tr><td>validatorIndex</td><td>Index of validator in associated provisioning request</td><td>Number</td></tr><tr><td>validatorAddress</td><td>Validator public key</td><td>String</td></tr><tr><td>amount</td><td>32 ETH </td><td>Number</td></tr><tr><td>created</td><td>Delegation object creation time</td><td>String</td></tr><tr><td>status</td><td><a href="#validator-status-enum">Validator Status</a></td><td>String</td></tr><tr><td>signature</td><td>Validator signature</td><td> String</td></tr><tr><td>deposit_data_root</td><td>Hash of the deposit data</td><td>String</td></tr><tr><td>deposit_message_root</td><td>Hash of the Merkle tree’s root</td><td>String</td></tr><tr><td>fork_version</td><td>The version of Ethereum fork</td><td>String</td></tr></tbody></table>

## Get Validator and Provision IDs

<mark style="color:blue;">`GET`</mark> `/api/users`

Fetch the provision IDs of validators associated with a client API key.

#### Query Parameters

| Name              | Type   | Description                             |
| ----------------- | ------ | --------------------------------------- |
| withdrawalAddress | String | withdrawal address as specified by user |
| page              | Number | page number to be fetched               |
| per\_page         | Number | Number of results per page              |

#### Headers

| Name                                      | Type   | Description                   |
| ----------------------------------------- | ------ | ----------------------------- |
| api-key<mark style="color:red;">\*</mark> | String | API key provided by Luganodes |

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

```javascript
{
  "clientId": "5eccab77-2e4a-4b93-98d7-f179567bcd7e",
  "result": [
    {
      "validatorAddress": "0xb3db9b4688155a52d752ff58d97a80b860e56136d94b97c5e088561085f55cb1c389eb46b5eb2d42c873d608441f561f",
      "provisionId": "a4be819b-5035-4219-b4b7-838c972bc753",
      "withdrawalAddress": "0xa08c6C9e3d0E28E0E9Ef17cE67899e8E06501dD2",
      "withdrawal_credentials": "0x010000000000000000000000a08c6c9e3d0e28e0e9ef17ce67899e8e06501dd2",
      "controllerAddress": "0x918D92fc2cA24379ba1EEa1dd1CA385Fc5C8df7c",
      "feeRecipient": "0x2A0e48522876DbD8B414E938cbE4e05FD6A23811",
      "status": "CREATED",
      "createdAt": "2024-02-15T10:28:59.551Z",
      "validatorIndex": 0
    },
    {
      "validatorAddress": "0xadf01960b6accc2367f7532ec74719028907208c916e7be22b0bb0fe755df4a0e7e247969b964c4f7e5bd23a895c02e3",
      "provisionId": "a4be819b-5035-4219-b4b7-838c972bc753",
      "withdrawalAddress": "0xa08c6C9e3d0E28E0E9Ef17cE67899e8E06501dD2",
      "withdrawal_credentials": "0x010000000000000000000000a08c6c9e3d0e28e0e9ef17ce67899e8e06501dd2",
      "controllerAddress": "0x918D92fc2cA24379ba1EEa1dd1CA385Fc5C8df7c",
      "feeRecipient": "0x2A0e48522876DbD8B414E938cbE4e05FD6A23811",
      "status": "CREATED",
      "createdAt": "2024-02-15T10:28:59.551Z",
      "validatorIndex": 0
    }
  ]
}
```

{% endtab %}
{% endtabs %}

#### Sample Request

```bash
curl --location --globoff '{{url}}/api/users?page=1&per_page=10' \
--header 'api-key: ee908371-d13b-43dd-ae33-b854dade5e9d'
```

#### Types

#### Paginated Response Object

<table><thead><tr><th width="143.33333333333331">Field</th><th width="447">Description</th><th>Type</th></tr></thead><tbody><tr><td>clientID</td><td>Partner identifier associated with api key</td><td>String</td></tr><tr><td>result</td><td>Array of <a href="#validator-result-object-1">Validator Objects</a></td><td>Array</td></tr><tr><td>page</td><td>Page of fetched results</td><td>Number</td></tr><tr><td>per_page</td><td>Number of results per page</td><td>Number</td></tr><tr><td>pages</td><td>Total number of pages</td><td>Number</td></tr><tr><td>total</td><td>Number of results in total</td><td>Number</td></tr></tbody></table>

#### Validator Result Object

<table><thead><tr><th width="198.33333333333331">Field</th><th width="447">Description</th><th>Type</th></tr></thead><tbody><tr><td>validatorAddress</td><td>Validator Public Key</td><td>String</td></tr><tr><td>withdrawalAddress</td><td>Withdrawal address as specified by user</td><td>String</td></tr><tr><td>controllerAddress</td><td>Address that can be used to sign the exit message</td><td>String</td></tr><tr><td>feeRecipient</td><td>fee Recipient address of the validator that receive EL rewards</td><td>String</td></tr><tr><td>provisionId</td><td>Unique identifier of provisioning request</td><td>String</td></tr><tr><td>created-at</td><td>Timestamp of the creation of the provision request</td><td>String</td></tr><tr><td>status</td><td><a href="#validator-status-enum">Validator Status</a></td><td>String</td></tr><tr><td>validatorIndex</td><td>Index of Validator on Ethereum chain. "0" if not deposited on chain. </td><td>Number</td></tr></tbody></table>

&#x20;

## Get Validator Count

<mark style="color:blue;">`GET`</mark> `/api/validators/count`

Returns the number of validators by their status.&#x20;

#### Query Parameters

| Name              | Type   | Description                             |
| ----------------- | ------ | --------------------------------------- |
| withdrawalAddress | String | withdrawal address as specified by user |
| page              | Number | page number to be fetched               |
| per\_page         | Number | Number of results per page              |

**Headers**

| Name                                      | Type   | Description                   |
| ----------------------------------------- | ------ | ----------------------------- |
| api-key<mark style="color:red;">\*</mark> | String | API key provided by Luganodes |

**Response**

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

```json
{
  "result": {
      "total": 100,
      "by_status": {
        "pending_initialized": 1,
        "pending_queued": 1,
        "active_ongoing": 0,
        "active_slashed": 0,
        "exited_unslashed": 0,
        "exited_slashed": 0,
        "withdrawal_possible": 94,
        "withdrawal_done": 1,
    }
  }
}
```

{% endtab %}
{% endtabs %}

#### Sample Request

```bash
curl --location --globoff '{{url}}/api/validators/count' \
--header 'api-key: ee908371-d13b-43dd-ae33-b854dade5e9d'
```

#### Types

#### Result Object

<table><thead><tr><th width="143.33333333333331">Field</th><th width="447">Description</th><th>Type</th></tr></thead><tbody><tr><td>total</td><td>Total number of validators provisioned</td><td>Number</td></tr><tr><td>by_status</td><td>Array of validator count by status</td><td>Array</td></tr></tbody></table>

#### Status Object

<table><thead><tr><th width="201.33333333333331">Field</th><th width="447">Description</th><th>Type</th></tr></thead><tbody><tr><td>pending_initialized</td><td>First deposit is processed, but not enough funds are available to get validator into activation queue</td><td>Number</td></tr><tr><td>pending_queued</td><td>Validator is waiting to get activated, has enough funds while in the queue</td><td>Number</td></tr><tr><td>active_ongoing</td><td>Validator is currently active and has not initiated any exit</td><td>Number</td></tr><tr><td>active_slashed</td><td>Validator is still active but has a slashed status and is scheduled to exit</td><td>Number</td></tr><tr><td>exited_unslashed</td><td>Validator has reached exit epoch, currently not attesting and not slashed</td><td>Number</td></tr><tr><td>exited_slashed</td><td>Validator has reached exit epoch and was slashed</td><td>Number</td></tr><tr><td>withdrawal_possible</td><td>After validator has exited, the staked balance can be withdrawn </td><td>Number</td></tr><tr><td>withdrawal_done</td><td>Withdrawal has been processed </td><td>Number</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.luganodes.com/apis/ethereum/node-provisioning-apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
