Account architecture
All API credentials and webhook settings are configured once at the master account level and apply to all subaccounts. To create subaccounts, see Account Onboarding.
List connected accounts
Call the List Connected Accounts API to retrieve all subaccounts linked to your master account.account_id field — you’ll use this value when making requests on behalf of that subaccount.
Acting on behalf of a subaccount
To scope an API request to a specific subaccount, include thex-on-behalf-of header set to the subaccount’s account_id.
If you omit
x-on-behalf-of, the request is treated as initiated by the master account by default.x-on-behalf-of header ensures that operations are scoped to the correct account.
When NOT to send x-on-behalf-of
The header is intended for endpoints that operate on subaccount-scoped resources. Do not include it on master-account-level operations — for example, listing connected accounts or minting an access token. If a request does not target a subaccount-scoped resource, omit x-on-behalf-of.
Error handling
If thex-on-behalf-of value is invalid or the subaccount is deactivated, the API returns:
account_id is correct and that the target subaccount is active.

