## Get Accounts `client.V1.Accounts.GetAccounts(ctx, query) (*V1AccountGetAccountsResponse, error)` **get** `/v1/accounts` List accounts the authenticated user has permission to access ### Parameters - `query V1AccountGetAccountsParams` - `PageSize param.Field[int64]` The number of items to return per page. Only used when page_token is not provided. - `PageToken param.Field[string]` Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored. ### Returns - `type V1AccountGetAccountsResponse struct{…}` - `Data AccountList` - `ID int64` The unique identifier for the account - `AccountHolderEntityID int64` The account holder entity identifier - `FullName string` The full legal name of the account - `OpenDate Time` The date the account was opened - `OptionsLevel int64` The options level of the account - `ShortName string` The short name of the account - `Status AccountStatus` The current status of the account - `const AccountStatusActive AccountStatus = "ACTIVE"` - `const AccountStatusInactive AccountStatus = "INACTIVE"` - `const AccountStatusClosed AccountStatus = "CLOSED"` - `Subtype AccountSubtype` The sub-type of account - `const AccountSubtypeCash AccountSubtype = "CASH"` - `const AccountSubtypeMargin AccountSubtype = "MARGIN"` - `const AccountSubtypeOther AccountSubtype = "OTHER"` - `Type AccountType` The type of account - `const AccountTypeCustomer AccountType = "CUSTOMER"` - `const AccountTypeOther AccountType = "OTHER"` - `CloseDate Time` The date the account was closed, if applicable ### Example ```go package main import ( "context" "fmt" "github.com/clear-street/clear-street-go" "github.com/clear-street/clear-street-go/option" ) func main() { client := clearstreet.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.V1.Accounts.GetAccounts(context.TODO(), clearstreet.V1AccountGetAccountsParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### 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 } } ```