> For the complete documentation index, see [llms.txt](https://docs.dexpal.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dexpal.io/for-partners/endpoints/user-accounts.md).

# User Accounts

Returns all accounts the DEX associates with the given address. DexPal calls this endpoint for each of a user's connected wallets to build a complete picture of their accounts before querying positions, orders, history, or holdings.

> **Collection endpoint:** Return accounts for any requested address the DEX can read, even if the wallet has not used DexPal's affiliate code. Return `404 "Address not found"` only when the address is unknown to the DEX. See the [Overview](/for-partners/dex-api-spec.md).

## Overview

|                |                |
| -------------- | -------------- |
| **Method**     | GET            |
| **Auth**       | Bearer API key |
| **Rate limit** | 120 req/min    |

## Request

### Path Parameters

| Param     | Type   | Required | Description                                                                                                                                     |
| --------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `address` | string | yes      | A wallet address in any format supported by the DEX. The DEX handles format detection internally (EVM hex, Solana base58, Cosmos bech32, etc.). |

### Headers

| Header          | Required | Description        |
| --------------- | -------- | ------------------ |
| `Authorization` | yes      | `Bearer <api_key>` |

## Response

Returns a `data` array of all accounts associated with the given address on this DEX.

### Fields — Account Object

| Field     | Type   | Required | Description                                                                                    |
| --------- | ------ | -------- | ---------------------------------------------------------------------------------------------- |
| `address` | string | yes      | The account address. May differ from the path `{address}` for subaccounts and smart wallets.   |
| `label`   | string | no       | DEX-assigned human-readable label for this account e.g. `"Main Account"`, `"1-Click Trading"`. |

## Account Types

DexPal users may have several types of accounts on a given DEX. The DEX handles the distinction internally and returns all of them here. Common account types include:

* **Primary wallet** — the main EOA used to sign transactions
* **Subaccount** — a DEX-managed account linked to the primary wallet (e.g. dYdX subaccounts)
* **Smart wallet** — an ERC-4337 or equivalent smart contract wallet
* **One-click trading account** — a session wallet used for fast order execution without per-transaction signing (e.g. Vela one-click trading)

All of these are returned as flat entries in the `data` array. DexPal uses the returned addresses to query all other user endpoints.

## Example Response

```json
{
  "success": true,
  "data": [
    {
      "address": "0x1a2b3c4d5e6f7890abcdef1234567890abcdef12",
      "label": "Main Account"
    },
    {
      "address": "0x9c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d",
      "label": "1-Click Trading"
    },
    {
      "address": "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
      "label": "Subaccount 1"
    }
  ]
}
```

## Error Responses

| Status | Error                          | When                                |
| ------ | ------------------------------ | ----------------------------------- |
| `401`  | `"Invalid or missing API key"` | Bad or absent auth header           |
| `404`  | `"Address not found"`          | Address has no accounts on this DEX |
| `500`  | `"Internal server error"`      | Unexpected failure                  |

## Notes

* Always include the primary wallet itself in the response, not only subaccounts.
* Return `404` only when the address is completely unknown to the DEX. A known address with no subaccounts should return a single-item array containing the primary address.
* The `address` values returned here are used as input to the `?addr=` parameter on all other user-level endpoints.
