Auto-register sub-account
Sub-Accounts & White-Label Retail KYC
/auto-register
Auto-register sub-account
createAutoRegisterSingle-call convenience endpoint that creates a sub-account and returns an API token for it. Idempotent on uid — calling twice with the same uid returns the existing sub-account and a fresh token. Equivalent to POST /users but returns auth context in one round trip.
Parameters
This endpoint has no path or query parameters.
Headers
AuthorizationstringRequiredBearer sk_sandbox_<your_key> for sandbox requests.
Idempotency-KeystringheaderRequiredUnique string that makes write calls safe to retry on network failure. Required for money movement, trading, KYC, subscriptions, and webhook creation. Deduplicated for 24 hours -- duplicate keys return the cached response. HTTP 409 if a concurrent request with the same key is still in progress.
Example: dep_user42_1743152580
Request body
uidstringRequiredYour internal user identifier. Idempotency key -- calling twice with the same uid returns the same sub-account.
Example: "user_42"
emailstringEmail address for the sub-account user.
Example: "alice@yourapp.com"
namestringFull name shown in the MyStocks admin console.
Example: "Alice K."
phonestringUser phone number in E.164 format.
Example: "+254712345678"
countrystringISO 3166-1 alpha-2 country code.
Example: "KE"
Response fields
subAccountIdstringtokenstringShort-lived auth token for the sub-account.
isNewbooleantrue if this call created the account, false if it already existed.
Response codes
200Sub-account created or retrieved.