Skip to main content
POST
/
api
/
v1
/
accounts
/
{account_id}
/
subaccount
/
create
Create subaccount
curl --request POST \
  --url https://staging.zerolatencylabs.com/api/v1/accounts/{account_id}/subaccount/create \
  --header 'Content-Type: application/json' \
  --data '
{
  "payload": "AQABAAAAAAB4m2tQz9KvX1Yk2mN3oQ4rS5tU6vW7xZ8aB9cD0eF1gH2iJ3kL5mN7oP9qR1sT3uV5wX7yZ9a=",
  "public_key": "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=",
  "signature": "AAcOFRwjKjE4P0ZNVFtiaXB3foWMk5qhqK+2vcTL0tng5+71/AMKERgfJi00O0JJUFdeZWxzeoGIj5adpKuyuQ=="
}
'
{
  "main_portfolio_index": 1,
  "status": "created",
  "subaccount_index": 1
}

Path Parameters

account_id
integer<int64>
required

Parent account id (informational; the authoritative account id is carried in the signed body)

Required range: x >= 0

Body

application/json

Signed write request. The JSON body is a Base64SignedPayload; its base64 payload decodes to the binary layout [Header(8) || RequestId(16) || Body || Auth] the client signs — see spec/signing.md for the byte layout, signature types, and signing procedure. The decoded Body is:

  • CreateSubaccount when Header.request_type = create_subaccount (24).

JSON envelope for a signed request: the base64-encoded canonical payload plus the base64 signature and public_key of the signing credential. Session-key (Ed25519) endpoints accept exactly these fields; master-key (Secp256k1 / Passkey) endpoints sign the same payload and may carry additional signature material. Endpoints also accept the equivalent application/octet-stream binary frame.

payload
string
required

Base64-encoded bytes of the canonical request payload.

Example:

"AQABAAAAAAB4m2tQz9KvX1Yk2mN3oQ4rS5tU6vW7xZ8aB9cD0eF1gH2iJ3kL5mN7oP9qR1sT3uV5wX7yZ9a="

public_key
string
required

Base64-encoded public key of the signing credential.

Example:

"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8="

signature
string
required

Base64-encoded signature over the payload.

Example:

"AAcOFRwjKjE4P0ZNVFtiaXB3foWMk5qhqK+2vcTL0tng5+71/AMKERgfJi00O0JJUFdeZWxzeoGIj5adpKuyuQ=="

Response

Subaccount creation processed; inspect the status field

Result of a subaccount creation request.

Only outcomes that are actually possible for CreateSubaccount are represented, avoiding impossible states like RejectedInvalidMarket.

main_portfolio_index
integer<int32>
required

The index of the default (main) portfolio that was created alongside the subaccount.

Required range: x >= 0
status
enum<string>
required
Available options:
created
subaccount_index
integer<int32>
required

The allocated subaccount index.

Required range: x >= 0