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

Set the default account.

PUT
/api/accounts/default
curl --request PUT \
--url https://api.tradr.cloud/api/accounts/default \
--header 'Content-Type: application/json' \
--data '{ "accountId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Authed. Moves the default-account designation — the account the app’s pickers preselect — to the named account. Exactly one account holds it at a time: setting a new default clears the old one in the same statement. The first account a user creates takes the designation automatically, and deleting the default hands it to the oldest remaining account, so this endpoint is only ever a move.

The account must belong to the current user (404 otherwise), and the sample account is refused with 400 DEMO_ACCOUNT_NOT_DEFAULTABLE — a preselected sample account would put invented data behind every new position by default.

Every account read carries a boolean isDefault; it is server-set and cannot be sent in on create or update.

Media typeapplication/json
object
accountId
required
string format: uuid
Examplegenerated
{
"accountId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

{ defaultAccountId } — the stored designation.

Validation error, or DEMO_ACCOUNT_NOT_DEFAULTABLE (the sample account).

Account not found (or not owned by the user).