Skip to content
These docs describe Tradr v0.14.0. Running an older release? Check the release notes for what changed.

Create an account.

POST
/api/accounts
curl --request POST \
--url https://api.tradr.cloud/api/accounts \
--header 'Content-Type: application/json' \
--data '{ "brokerageId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "currency": "example", "defaultRiskPercent": "1.00", "name": "example", "startingBalance": "example", "timezone": "America/New_York" }'

Authed. Creates a trading account for the current user. When feature gating is enabled and the user is a non-admin Free user at the account cap, the create is refused with 403 TIER_LIMIT_ACCOUNTS — admins and gating-off deployments pass through unchanged.

While the sample account exists the create is refused with 409 DEMO_ACCOUNT_EXISTS instead: sample and real data are mutually exclusive, because every aggregate scopes by currency and not by account. That check runs BEFORE the plan cap, so a Free user holding sample data is told to remove it rather than to upgrade — the sample account occupies their one slot. Remove it with DELETE /api/accounts/{id}?cascade=demo and retry.

Media typeapplication/json
object
brokerageId
string format: uuid
nullable
currency
required
string
>= 3 characters <= 3 characters
defaultRiskPercent

Share of the account balance risked per trade, as a decimal string above 0 and up to 100 with at most 2 decimal places. Seeds the position-size calculator. Omitted means no rule is set, which leaves the calculator’s field empty as before. Unlike PUT /api/accounts/{id}, an explicit null is a 400 here — there is no rule to clear on create.

string
Example
1.00
name
required
string
>= 1 characters
startingBalance
string
timezone

IANA zone name (canonical spelling, e.g. America/New_York, Etc/UTC). Defines the account’s trading day. Omitted defaults to America/New_York; an unknown zone is a 400.

string
Example
America/New_York

The created account, with isDemo: false.

Validation error.

TIER_LIMIT_ACCOUNTS (account cap reached on the current plan) or FORBIDDEN (cross-user brokerage).

DEMO_ACCOUNT_EXISTS (sample data present — remove it and retry) or CONFLICT (duplicate account name).