Create a portfolio
Handles the creation of a new portfolio for an existing account.
Endpoint
POST /api/v1/accounts/{account_id}/portfolio
Authentication
Requires a session-key signed request.
Returns
200 OKwithPortfolioCreationResponsecarrying the allocated portfolio index.- Rejections surface as
success: falsein the body; the HTTP status codes below cover the common error surface shared by all signed-request handlers.
Path Parameters
Account that will own the portfolio (informational; the authoritative account id is carried in the signed body)
x >= 0Body
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:
CreatePortfoliowhenHeader.request_type=create_portfolio(11).
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.
Base64-encoded bytes of the canonical request payload.
"AQABAAAAAAB4m2tQz9KvX1Yk2mN3oQ4rS5tU6vW7xZ8aB9cD0eF1gH2iJ3kL5mN7oP9qR1sT3uV5wX7yZ9a="
Base64-encoded public key of the signing credential.
"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8="
Base64-encoded signature over the payload.
"AAcOFRwjKjE4P0ZNVFtiaXB3foWMk5qhqK+2vcTL0tng5+71/AMKERgfJi00O0JJUFdeZWxzeoGIj5adpKuyuQ=="
Response
Portfolio creation processed; inspect the status field
- Option 1
- Option 2
- Option 3
Result of a portfolio creation request.
This enum only represents outcomes that are valid for portfolio creation,
preventing impossible states like RejectedInvalidMarket.
A system-generated unique identifier for an account.
x >= 0A unique identifier for a portfolio within a subaccount.
x >= 0A unique identifier for a subaccount within an account.
x >= 0Server-generated default name ("Main" for index 0, "Portfolio N" otherwise).
"Main"
created