# Subaccounts

Subaccount reads, members, invites, activity.

`client.SubAccounts` contains API-key-safe reads and private streams. Mutations and member/invite administration are JWT/session-only and are not included.

| Method                        | Purpose                                   |
| ----------------------------- | ----------------------------------------- |
| `List`                        | Visible subaccounts                       |
| `Get`                         | One subaccount with optional related data |
| `ListMembers` / `ListInvites` | Membership reads                          |
| `ListActivity`                | Paginated audit activity                  |
| `Subscribe`                   | Subaccount state stream                   |
| `SubscribeAPIKeys`            | API-key metadata stream                   |

```go
subs, err := client.SubAccounts.List(ctx)
if err != nil { log.Fatal(err) }
for _, subaccount := range subs.Subaccounts {
	fmt.Println(subaccount.SubaccountID, subaccount.Label, subaccount.Status)
}

subID := "123"
detail, err := client.SubAccounts.Get(
	ctx, nil, &subID,
	false, true, false, true, true, "",
)
```

Use `Config.DefaultSubAccountID`, an `AccountScope`, or the method `subAccountID` argument to scope trading. Subaccount IDs are not the root Account ID used in private channel names.

Activity page tokens are opaque and must be replayed unchanged. Private subscribe methods require API key + root Account ID.
