Skip to main content
POST
/
accounts
Create Account
curl --request POST \
  --url https://api.example.com/accounts

Create Account

Creates a new sub-account under your Prime Account. Each sub-account gets its own on-chain wallet (Quark Wallet) on all supported networks.

Request

POST /accounts

Body parameters

ParameterTypeRequiredDescription
signer_typestringYesType of signer. Currently supported: "eoa"
signer_addressstringYes (for EOA)Ethereum address of the EOA signer (0x-prefixed, 40 hex chars)

Examples

curl -X POST https://prime-api.legend.xyz/accounts \
  -H "Authorization: Bearer $LEGEND_QUERY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "signer_type": "eoa",
    "signer_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18"
  }'
Response (201 Created)
{
  "external_id": "acc_2o0yiljtp378",
  "signer_type": "eoa",
  "signer_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
  "legend_wallet_address": "0xc40897f38bc3d4e4d17f9daf46d2a13b4c47642f",
  "created_at": "2025-06-15T10:30:00Z"
}

Response fields

FieldTypeDescription
external_idstringUnique identifier for the sub-account (acc_ prefix)
signer_typestringSigner type used for this account
signer_addressstringEthereum address of the signer
legend_wallet_addressstringOn-chain wallet address (deterministic from the signer)
created_atstringISO 8601 timestamp

Errors

StatusCodeDescription
400invalid_paramsInvalid signer_type or malformed signer_address
409account_already_existsA sub-account with this signer already exists
Error example
{
  "error": "account_already_exists",
  "message": "An account already exists with this configuration"
}

Notes

  • The legend_wallet_address is deterministic — it’s computed from the signer address using CREATE2. This means you can predict the wallet address before creating the account.
  • Quark Wallets are created on all supported networks simultaneously.
  • The signer’s private key never touches Legend’s servers. You or your end-user retain full custody.