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

Delete an account.

DELETE
/api/accounts/{id}
curl --request DELETE \
--url 'https://api.tradr.cloud/api/accounts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0?cascade=demo'

Authed. Refused with 409 when the account holds positions — deleting one would take its trading history with it.

?cascade=demo asks instead for the sample-account teardown: the account and every position, fill and ledger entry booked against it, removed together in one transaction, leaving nothing orphaned behind. It is a request and not an authorisation — the server decides from the account’s own stored sample-data flag, so the same call against a real account holding positions is refused with 409 exactly as it is without the parameter. Nothing a client sends can reach the flag.

Teardown is idempotent: repeating it against a sample account that has already been removed answers 204, so two tabs pressing the same button settle on the same state. That applies only to the caller’s own former sample account; every other unknown id is a 404, as is any account belonging to another user.

id
required
string format: uuid
cascade
string
Allowed values: demo

demo requests the sample-account teardown. Any other value is a 400.

Deleted, or already torn down.

Validation error (a non-uuid id, or an unrecognised cascade value).

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

The account has positions and no cascade applies.