> For the complete documentation index, see [llms.txt](https://www.aevo.xyz/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.aevo.xyz/docs/api-reference/urls/private-api/getsubaccounts.md).

# GET /subaccounts

List the authenticated account's subaccounts, with each subaccount's balances and positions. See [Subaccounts](/docs/api-reference/subaccounts.md).

`GET https://api.aevo.xyz/subaccounts`

> **Authentication required.** Include your `AEVO-KEY` and `AEVO-SECRET` headers. See [Authentication](/docs/api-reference/urls/authentication.md). Read-only API keys can call this endpoint.

Call it with the main account's API key and no `AEVO-SUBACCOUNT` header. If the authenticated account is itself a subaccount, `parent` is returned and `subaccounts` is empty.

## Example Request

```bash
curl --request GET \
     --url https://api.aevo.xyz/subaccounts \
     --header 'accept: application/json' \
     --header 'AEVO-KEY: <your-api-key>' \
     --header 'AEVO-SECRET: <your-api-secret>'
```

## Responses

**`200`** — The account's subaccounts.

| Field                      | Type    | Required | Description                                                                                                                       |
| -------------------------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `account`                  | string  | Yes      | The authenticated account. Example: `0xYourMainAccountAddress`                                                                    |
| `parent`                   | string  | No       | The main account. Only returned when the authenticated account is a subaccount.                                                   |
| `max_subaccounts`          | integer | No       | Maximum number of active subaccounts per main account. Omitted while subaccounts are not enabled. Example: `10`                   |
| `subaccounts`              | array   | Yes      | The account's subaccounts, including archived ones.                                                                               |
| `subaccounts[].subaccount` | string  | Yes      | Subaccount address. Example: `0xYourSubaccountAddress`                                                                            |
| `subaccounts[].name`       | string  | Yes      | Subaccount name. Example: `Market Making`                                                                                         |
| `subaccounts[].archived`   | boolean | Yes      | True if the subaccount is archived. Example: `false`                                                                              |
| `subaccounts[].balances`   | array   | Yes      | Collateral balances, in the same format as `collaterals` in [`GET /account`](/docs/api-reference/urls/private-api/getaccount.md). |
| `subaccounts[].positions`  | array   | Yes      | Open positions, in the same format as [`GET /positions`](/docs/api-reference/urls/private-api/getpositions.md).                   |

```json
{
  "account": "0xYourMainAccountAddress",
  "max_subaccounts": 10,
  "subaccounts": [
    {
      "subaccount": "0xYourSubaccountAddress",
      "name": "Market Making",
      "archived": false,
      "balances": [],
      "positions": []
    }
  ]
}
```

**`401`** — Unauthorized.

| Field   | Type   | Required | Description                            |
| ------- | ------ | -------- | -------------------------------------- |
| `error` | string | Yes      | Error message. Example: `UNAUTHORIZED` |

**`429`** — Rate limit exceeded.

| Field   | Type   | Required | Description                                   |
| ------- | ------ | -------- | --------------------------------------------- |
| `error` | string | Yes      | Error message. Example: `RATE_LIMIT_EXCEEDED` |

**`500`** — Internal server error.

| Field   | Type   | Required | Description                              |
| ------- | ------ | -------- | ---------------------------------------- |
| `error` | string | Yes      | Error message. Example: `INTERNAL_ERROR` |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.aevo.xyz/docs/api-reference/urls/private-api/getsubaccounts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
