## Get Accounts `AccountGetAccountsResponse v1().accounts().getAccounts(AccountGetAccountsParamsparams = AccountGetAccountsParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **get** `/v1/accounts` List accounts the authenticated user has permission to access ### Parameters - `AccountGetAccountsParams params` - `Optional pageSize` The number of items to return per page. Only used when page_token is not provided. - `Optional pageToken` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. ### Returns - `class AccountGetAccountsResponse:` - `List data` - `long id` The unique identifier for the account - `long accountHolderEntityId` The account holder entity identifier - `String fullName` The full legal name of the account - `LocalDate openDate` The date the account was opened - `long optionsLevel` The options level of the account - `String shortName` The short name of the account - `AccountStatus status` The current status of the account - `ACTIVE("ACTIVE")` - `INACTIVE("INACTIVE")` - `CLOSED("CLOSED")` - `AccountSubtype subtype` The sub-type of account - `CASH("CASH")` - `MARGIN("MARGIN")` - `OTHER("OTHER")` - `AccountType type` The type of account - `CUSTOMER("CUSTOMER")` - `OTHER("OTHER")` - `Optional closeDate` The date the account was closed, if applicable ### Example ```java package com.clear_street.api.example; import com.clear_street.api.client.ClearStreetClient; import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams; import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse; public final class Main { private Main() {} public static void main(String[] args) { ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() .apiKey("My API Key") .build(); AccountGetAccountsResponse response = client.v1().accounts().getAccounts(); } } ``` #### Response ```json { "data": [ { "account_holder_entity_id": 987654321, "close_date": null, "full_name": "Test Trading Account", "id": 19816, "open_date": "2023-01-15", "short_name": "TST-ACCOUNT-01", "status": "ACTIVE", "subtype": "MARGIN", "type": "CUSTOMER" }, { "account_holder_entity_id": 987654322, "close_date": "2024-08-01", "full_name": "Old Test Account", "id": 19817, "open_date": "2021-05-20", "short_name": "TST-ACCOUNT-02-CLOSED", "status": "CLOSED", "subtype": "CASH", "type": "CUSTOMER" } ], "error": null, "metadata": { "next_page_token": "cGFnZT0yJmxhc3RfaWQ9MTk4MTc=", "page_number": 1, "request_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "total_items": 25, "total_pages": 3 } } ```