Skip to main content
Use this when a trader needs a fresh account on the same evaluation template: after a fail, a reset, or an administrative replacement. Tradara flattens the original account, closes it, then generates a new account for the same trader.
operationId: replaceFirmAccount Requires accounts:write. A firm API key is automatically scoped to its firm.

What it does

  1. Cancels working orders and flattens open positions on the original account.
  2. Sets the original account to closed and emits account.closed.
  3. Generates a replacement from the same evaluation template and trading user.
  4. Emits account.created for the new account.
If the original account is already closed (for example a retry after generation failed), flatten/close are skipped and only the replacement is created. The replacement is a new account_id. Store it before sending new orders.

Body

The request body is required. Send {} when you do not need a custom status.

Response — 200 OK

item is the new account. Use item.id on the Trading API.
This does not copy cash, session anchors, or live risk state from the closed account. The replacement starts from the evaluation template, the same way Generate account does.

Errors