Before calling any private method you must authenticate. Please refer to API Authentication Guide for more information regarding authentication.
Overview
Subaccounts are separate trading accounts that belong to a main account. They share the same KYC verification status as the main account but operate independently for trading, positions, and wallet balances. Subaccounts are useful for:- Risk management: Isolating different trading strategies
- Client segregation: Managing multiple clients under one account
- Organizational structure: Separating different departments or teams
Creating a Subaccount
To create a new subaccount, use theprivate/create_subaccount method. This method takes no parameters and creates a new subaccount with a default name.
Example Request
Response
On success, the API returns an object containing:id- The unique subaccount ID (user ID)username- The default username for the subaccounttype- Account type (e.g., “subaccount”)email- Email address (if assigned)system_name- System-generated nameis_password- Whether password is setis_otp_enabled- Whether 2FA is enabledlogin_enabled- Whether login is enabledportfolio- Portfolio information (if available)
The subaccount ID (
id) is required for all subsequent subaccount management operations. Store this value for future reference.Retrieving Subaccount Information
List All Subaccounts
To retrieve information about all subaccounts, use theprivate/get_subaccounts method.
Example Request
Parameters
with_portfolio(optional): Set totrueto include portfolio information (equity, available funds, maintenance margin). Defaults tofalse.
Response
The response includes an array of subaccounts, each containing:id- Subaccount IDusername- Usernameemail- Email address (if assigned)login_enabled- Whether login is enablednotifications_enabled- Whether notifications are enabledportfolio- Portfolio information (ifwith_portfolioistrue)
Get Subaccount Positions
To retrieve positions and trading details for all subaccounts, use theprivate/get_subaccounts_details method.
Example Request
Parameters
currency(required): The currency symbol (e.g., “BTC”, “ETH”)with_open_orders(optional): Set totrueto include open orders. Defaults tofalse.
Response
Returns detailed information including positions, balances, and optionally open orders for all subaccounts in the specified currency.Configuring Subaccount Settings
Change Subaccount Name
To change the display name of a subaccount, use theprivate/change_subaccount_name method.
Example Request
Parameters
sid(required): The subaccount IDname(required): The new display name
Assign Email Address
To assign an email address to a subaccount, use theprivate/set_email_for_subaccount method. The subaccount user will receive a confirmation email.
Example Request
Parameters
sid(required): The subaccount IDemail(required): The email address to assign
Enable or Disable Login
To control whether a subaccount can log in through the web interface, use theprivate/toggle_subaccount_login method.
Example Request
Parameters
sid(required): The subaccount IDstate(required): Either"enable"or"disable"
Enable or Disable Notifications
To control whether a subaccount receives email notifications, use theprivate/toggle_notifications_from_subaccount method.
Example Request
Parameters
sid(required): The subaccount IDstate(required):trueto enable notifications,falseto disable
Switching Between Subaccounts
To perform operations on behalf of a subaccount, you need to switch your authentication context using thepublic/exchange_token method.
Example Request
Response
The API returns a new access token and refresh token for the specified subaccount:After switching to a subaccount context, all subsequent API calls will operate on that subaccount’s data until you switch back or authenticate with a different token.
Accessing Subaccount Data via Other Endpoints
Many API endpoints support accessing subaccount data by including thesubaccount_id parameter. This allows you to query subaccount information without switching authentication context.
Examples
Get Subaccount Positions
Get Subaccount Account Summary
Get Subaccount Trades
When using the
subaccount_id parameter, you must have appropriate permissions (account:read or trade:read scopes) and the request must be made from the main account.Removing a Subaccount
To remove a subaccount, use theprivate/remove_subaccount method.
Example Request
Response
Transferring Funds Between Subaccounts
Subaccounts can transfer funds between each other and to/from the main account. See the Managing Transfers via API guide for detailed information on:- Transferring from main account to subaccount
- Transferring between subaccounts
- Checking transfer status
Moving Positions Between Subaccounts
You can move positions from one subaccount to another using theprivate/move_positions method. See the Moving Positions via API guide for details.
Position moves have distinct rate limiting requirements: sustained rate of 6 requests/minute. See Rate Limits for more information.
Best Practices
1. Store Subaccount IDs
Always store the subaccount ID returned when creating a subaccount. This ID is required for all management operations.2. Use Descriptive Names
Assign meaningful names to subaccounts to easily identify their purpose (e.g., “Arbitrage Strategy”, “Client A”, “Risk Management”).3. Manage Permissions Carefully
Ensure API keys used for subaccount management have theaccount:read_write scope and are created on the main account, not on subaccounts.
4. Monitor Subaccount Activity
Regularly check subaccount positions, balances, and trading activity usingget_subaccounts_details and other endpoints with the subaccount_id parameter.
5. Handle 2FA Requirements
Several subaccount management operations require 2FA. Ensure your application flow supports providing the second factor when needed. See Security Keys for implementation details.6. Empty Subaccounts Before Removal
Before removing a subaccount, ensure it has:- No open positions
- No open orders
- Zero balance in all currencies
7. Use Appropriate Scopes
When creating API keys for subaccount operations:- Use
account:readfor read-only operations (listing, viewing details) - Use
account:read_writefor management operations (creating, modifying, removing)
Troubleshooting
Cannot Create Subaccount
- Error:
invalid_scopeorinsufficient_permissions- Solution: Ensure your API key has the
account:read_writescope and was created on the main account.
- Solution: Ensure your API key has the
Cannot Access Subaccount Data
- Error:
invalid_subaccount_idorsubaccount_not_found- Solution: Verify the subaccount ID is correct and belongs to your main account. Use
get_subaccountsto list all available subaccounts.
- Solution: Verify the subaccount ID is correct and belongs to your main account. Use
2FA Required Error
- Error:
security_key_authorization_error(code: 13668)- Solution: Operations like setting email, toggling login, or removing subaccounts require 2FA. Provide the second factor in your API request. See Security Keys.
Cannot Remove Subaccount
- Error:
subaccount_not_emptyor similar- Solution: Ensure the subaccount has no positions, open orders, or balances. Transfer or close all positions and cancel all orders before removal.
Subaccount Login Disabled
- Issue: Subaccount cannot log in through web interface
- Solution: Check if login is enabled using
get_subaccounts. If disabled, usetoggle_subaccount_loginwithstate: "enable"to re-enable it.
- Solution: Check if login is enabled using
Related Articles
- Managing Transfers via API - Transfer funds between accounts
- Moving Positions via API - Move positions between subaccounts
- API Authentication Guide - Authentication and token management
- Security Keys - Two-Factor Authentication for sensitive operations
- Creating API Key - Setting up API keys with appropriate scopes