# Address

## Module endpoints

* [`GET /addresses`](#get-addresses)
* [`GET /addresses/:address`](#get-addresses-address)
* [`POST /addresses`](#post-addresses)

### `GET /addresses`

> `GET` <https://api.slyk.i&#x6F;**/addresses>\*\*

Returns a paginated list of `addresses`.

{% tabs %}
{% tab title="Available Filters" %}

| Name          |      Type      | Example                                                                                         |
| ------------- | :------------: | ----------------------------------------------------------------------------------------------- |
| **address**   |     `like`     | `filter[address]=1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2`                                            |
| **assetCode** | `=` `in` `nin` | `filter[assetCode]=in:BTC`                                                                      |
| **walletId**  | `=` `in` `nin` | `filter[walletId]=in:3cfd3110-0b19-4e57-a1db-60f7fd602ebc,69d6ecb8-5248-4602-8754-4572a0e2042c` |

{% hint style="info" %}
The `address` filter performs a `SQL` query using the `like` operator.
{% endhint %}
{% endtab %}

{% tab title="Available Sorts" %}

| Name          | Example                                                            |
| ------------- | ------------------------------------------------------------------ |
| **createdAt** | <p><code>sort=createdAt</code><br><code>sort=-createdAt</code></p> |
| {% endtab %}  |                                                                    |

{% tab title="Paginate Options" %}

| Name         | Description                                             | Example          |
| ------------ | ------------------------------------------------------- | ---------------- |
| **size**     | Defines the number of results per page. Default = 30.   | `page[size]=2`   |
| **number**   | Defines the number of the page to retrieve. Default = 1 | `page[number]=2` |
| {% endtab %} |                                                         |                  |

{% tab title="Response" %}

```javascript
{
  "data": [
    {
      "address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2",
      "assetCode": "btc",
      "createdAt": "2019-06-20T14:30:37.483Z",
      "customData": { 
        "name": "Main BTC address" 
      }
      "metadata": {},
      "updatedAt": "2019-06-20T14:30:37.483Z",
      "walletId": "00697fea-f309-4b5e-99cc-f480cc9fc424"
    },
    {
      "address": "0xe167954e37d028564907442e8FA2512b5Ffd2c1F",
      "assetCode": "eth",
      "createdAt": "2019-06-20T14:30:37.483Z",
      "customData": { 
        "name": "Main ETH address" 
      }
      "metadata": {},
      "updatedAt": "2019-06-20T14:30:37.483Z",
      "walletId": "00697fea-f309-4b5e-99cc-f480cc9fc424"
    }
  ],
  "total": 2
}
```

{% endtab %}
{% endtabs %}

### `GET /addresses/:address`

> `GET` <https://api.slyk.i&#x6F;**/addresses/:address>\*\*

Returns the `address` details of the given `address`.

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

```javascript
{
  "data": {
    "address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2",
    "assetCode": "btc",
    "createdAt": "2019-06-21T14:30:37.483Z",
    "customData": { 
        "name": "Main BTC address" 
      }
    "metadata": {},
    "updatedAt": "2019-06-21T14:30:37.483Z",
    "walletId": "f2519340-3aaf-4101-8e66-3324fb0da0eb"
  }
}
```

{% endtab %}
{% endtabs %}

### `POST /addresses`

> `POST` <https://api.slyk.i&#x6F;**/addresses>\*\*

Creates a new `address`.

{% tabs %}
{% tab title="Request Parameters" %}

| Name           | Type     | Required                          | Description                                                          |
| -------------- | -------- | --------------------------------- | -------------------------------------------------------------------- |
| **address**    | `string` | `true` if `provider` is not given | Address identifier.                                                  |
| **assetCode**  | `string` | `true` if `provider`is given      | Asset code.                                                          |
| **customData** | `object` | `false`                           | Can store any additional information.                                |
| **provider**   | `string` | `true` if `address` is not given  | Address provider.                                                    |
| **walletId**   | `string` | `false`                           | Identifier of the wallet the address will belong to. Format: `uuid`. |
| {% endtab %}   |          |                                   |                                                                      |

{% tab title="Providers" %}

| Provider   | Available Assets                                    |
| ---------- | --------------------------------------------------- |
| `coinbase` | `bch`, `btc`, `dai`, `eth`, `etc`, `ltc` and `usdc` |

{% hint style="info" %}
In order to use the `coinbase` provider its payment method has to be **configured** and **enabled** on the dashboard.
{% endhint %}
{% endtab %}

{% tab title="Request" %}

```javascript
{
    "assetCode": "ltc",
    "customData": {
      "name": "Main LTC address"
    },
    "provider": "coinbase",
    "walletId": "f2519340-3aaf-4101-8e66-3324fb0da0eb"
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "address": "Ld9KeZdsDBt8AZXEwGuSTRySw4d2EVDPBq",
    "assetCode": "ltc",
    "createdAt": "2019-06-21T14:30:37.483Z",
    "customData": { 
        "name": "Main LTC address" 
      }
    "metadata": {},
    "updatedAt": "2019-06-21T14:30:37.483Z",
    "walletId": "f2519340-3aaf-4101-8e66-3324fb0da0eb"
  }
}
```

{% endtab %}
{% endtabs %}


---

# 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://developers.slyk.io/slyk/reference/endpoints/address.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.
