Create an account.
const url = 'https://api.tradr.cloud/api/accounts';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"brokerageId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","currency":"example","defaultRiskPercent":"1.00","name":"example","startingBalance":"example","timezone":"America/New_York"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Request Bodyrequired
Section titled “Request Bodyrequired”object
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.
Example
1.00IANA 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.
Example
America/New_YorkResponses
Section titled “Responses”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).