<aside> ⚠️ Subaccounts are currently in limited access. Please contact [email protected] for more information.

</aside>

Authentication

There are three ways to log in as a subaccount: through the main account, using a wallet login, or using an API key.

Wallet logins

There are endpoints to create and list wallet login invites. These will be created in a pending state, with an id and a secret attached. Given a wallet login invite and a wallet address, a user can request an auth challenge as normal, and pass it to a new endpoint along with the id and secret to complete the invite. The invite will then transition to the active state, and the wallet address will be linked to the subaccount. While in the pending state, these invites can be revoked.

API Keys

Subaccounts cannot create, edit, or delete their own API keys. A main account can list, create, and delete API keys for a subaccount. The ENCLAVE-SUBACCOUNT-ID header is not currently supported for requests authenticated with an API key from a main account.

Main-as-subaccount JWT authentication

When using JWT auth, you can authenticate as any subaccount of your main account by passing the ENCLAVE-SUBACCOUNT-ID header with a value of the subaccount’s ID. In this mode, you can access disabled subaccounts, but you are still subject to the subaccount’s restrictions on markets. This is implemented on the Enclave Markets frontend UI, but likely not relevant to external users.

Error Codes

The subaccounts API returns the following error codes: