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

# v2

**Supported Networks:** All networks on the main delegate.xyz website are supported

**Rate Limits:** 25 requests per 10 seconds.

To obtain an API key to remove rate limits, you can create one here: <https://delegate.xyz/developer/api-keys>

### Authentication

If you have an API Key, you can add it to the request headers like so:

```javascript
fetch(URL, { headers: { "X-API-KEY": "abc123" } }) 
```

### Delegations by wallet

## Get a list of incoming and outgoing delegations for a specific wallet.

<mark style="color:blue;">`GET`</mark> `https://api.delegate.xyz/registry/v2/:wallet`

#### Path Parameters

| Name                                     | Type    | Description                   |
| ---------------------------------------- | ------- | ----------------------------- |
| wallet<mark style="color:red;">\*</mark> | Address | The wallet to get delegations |

#### Query Parameters

| Name    | Type   | Description               |
| ------- | ------ | ------------------------- |
| chainId | number | Defaults to `1` (mainnet) |

{% tabs %}
{% tab title="200: OK Delegation\[]" %}

```typescript
type Delegation = {
    type: "NONE" | "ALL" | "CONTRACT" | "TOKEN";
    from: string;
    to: string;
    contract: string | null;
    tokenId: number | null;
};

// returns Delegation[]
```

{% endtab %}
{% endtabs %}

**Delegations by wallet Example**

```
curl https://api.delegate.xyz/registry/v2/0x0000000000000000000000000000000000000000
```

***

### Delegation Checks

## Returns true if delegate is granted to act on the from's behalf

<mark style="color:blue;">`GET`</mark> `https://api.delegate.xyz/registry/v2/check/all`

#### Query Parameters

| Name                                   | Type    | Description                               |
| -------------------------------------- | ------- | ----------------------------------------- |
| to<mark style="color:red;">\*</mark>   | Address | The hot wallet to act on your behalf      |
| from<mark style="color:red;">\*</mark> | Address | The cold wallet who issued the delegation |
| chainId                                | number  | Defaults to `1` (mainnet)                 |
| rights                                 | string  | bytes32 of rights string                  |

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

{% endtab %}
{% endtabs %}

**Check All Example**

```
curl https://api.delegate.xyz/registry/v2/check/all?to=0x0000000000000000000000000000000000000000&from=0x0000000000000000000000000000000000000001
```

***

## Returns true if delegate is granted to act on from's behalf for entire wallet or that specific contract

<mark style="color:blue;">`GET`</mark> `https://api.delegate.xyz/registry/v2/check/contract`

#### Query Parameters

| Name                                       | Type    | Description                                    |
| ------------------------------------------ | ------- | ---------------------------------------------- |
| from<mark style="color:red;">\*</mark>     | Address | The hot wallet to act on your behalf           |
| to<mark style="color:red;">\*</mark>       | Address | The cold wallet who issued the delegation      |
| contract<mark style="color:red;">\*</mark> | Address | The address for the contract you're delegating |
| chainId                                    | number  | Defaults to `1` (mainnet)                      |
| rights                                     | string  | bytes32 of rights string                       |

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

{% endtab %}
{% endtabs %}

**Check Contract Example**

```
curl https://api.delegate.xyz/registry/v2/check/contract?to=0x0000000000000000000000000000000000000000&from=0x0000000000000000000000000000000000000001&contract=0x0000000000000000000000000000000000000003
```

***

## Returns true if delegate is granted to act on from's behalf for entire wallet, that contract, or that specific tokenId

<mark style="color:blue;">`GET`</mark> `https://api.delegate.xyz/registry/v2/check/erc721`

#### Query Parameters

| Name                                       | Type    | Description                                    |
| ------------------------------------------ | ------- | ---------------------------------------------- |
| delegate<mark style="color:red;">\*</mark> | Address | The hot wallet to act on your behalf           |
| vault<mark style="color:red;">\*</mark>    | Address | The cold wallet who issued the delegation      |
| contract<mark style="color:red;">\*</mark> | Address | The address for the contract you're delegating |
| tokenId<mark style="color:red;">\*</mark>  | Number  | The token id for the token you're delegating   |
| chainId                                    | number  | Defaults to `1` (mainnet)                      |
| rights                                     | string  | bytes32 of rights string                       |

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

{% endtab %}
{% endtabs %}

**Check ERC721 Example**

```
curl https://api.delegate.xyz/registry/v2/check/contract?to=0x0000000000000000000000000000000000000000&from=0x0000000000000000000000000000000000000001&contract=0x0000000000000000000000000000000000000003&tokenId=1
```

***

## Returns the delegated balance, which will be 0 if the delegation does not exist

<mark style="color:blue;">`GET`</mark> `https://api.delegate.xyz/registry/v2/check/erc1155`

#### Query Parameters

| Name                                       | Type    | Description                                    |
| ------------------------------------------ | ------- | ---------------------------------------------- |
| delegate<mark style="color:red;">\*</mark> | Address | The hot wallet to act on your behalf           |
| vault<mark style="color:red;">\*</mark>    | Address | The cold wallet who issued the delegation      |
| contract<mark style="color:red;">\*</mark> | Address | The address for the contract you're delegating |
| tokenId<mark style="color:red;">\*</mark>  | Number  | The token id for the token you're delegating   |
| chainId                                    | number  | Defaults to `1` (mainnet)                      |
| rights                                     | string  | bytes32 of rights string                       |

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

{% endtab %}
{% endtabs %}

**Check ERC1155 Example**

```
curl https://api.delegate.xyz/registry/v2/check/erc1155?to=0x0000000000000000000000000000000000000000&from=0x0000000000000000000000000000000000000001&contract=0x0000000000000000000000000000000000000003&tokenId=1
```

***

## Returns the delegated balance, which will be 0 if the delegation does not exist

<mark style="color:blue;">`GET`</mark> `https://api.delegate.xyz/registry/v2/check/erc20`

#### Query Parameters

| Name                                       | Type    | Description                                    |
| ------------------------------------------ | ------- | ---------------------------------------------- |
| delegate<mark style="color:red;">\*</mark> | Address | The hot wallet to act on your behalf           |
| vault<mark style="color:red;">\*</mark>    | Address | The cold wallet who issued the delegation      |
| contract<mark style="color:red;">\*</mark> | Address | The address for the contract you're delegating |
| chainId                                    | number  | Defaults to `1` (mainnet)                      |
| rights                                     | string  | bytes32 of rights string                       |

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

{% endtab %}
{% endtabs %}

**Check ERC20 Example**

```
curl https://api.delegate.xyz/registry/v2/check/erc20?to=0x0000000000000000000000000000000000000000&from=0x0000000000000000000000000000000000000001&contract=0x0000000000000000000000000000000000000003
```
