# Delete an account and its history

URL: https://docs.fxapis.com/api-reference/accounts/delete-an-account-and-its-history

> Delete an account and its history. Removes the account for good: its terminal is stopped, its password erased, and the record deleted with its orders, deals…

`DELETE https://api.fxapis.com/v1/accounts/{id}`

Removes the account for good: its terminal is stopped, its password erased, and the record deleted with its orders, deals and positions. **This cannot be undone.** To stop trading on an account but keep its history readable, disconnect it instead.

Refused with `409` while an order is in flight (`ACCOUNT_EXECUTING`), while a multi-account order that includes it has not finished (`ACCOUNT_IN_WAVE`), and when our last look found open positions (`ACCOUNT_HAS_POSITIONS`): those stay open at the broker with their stops, but could no longer be shown or closed here. Close them first, or send `force=true` to delete anyway.

Alert hooks stop sending to the account; a hook left with no accounts is switched off. This month's usage is unaffected. The same login and server can be connected again afterwards, as a new account.

Authentication: `Authorization: Bearer <API key>`.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `force` | query | "true" \| "false" | no | `true` deletes even with open positions, which stay open at the broker. |
| `id` | path | string (uuid) | yes |  |

#### Responses

- `200`
- `401`
- `404`
- `409`

Failures return `{ "error": { "code", "message" } }`; every code is listed at https://docs.fxapis.com/errors.

#### 200 response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | object | no |  |
| `data.accountId` | string (uuid) | no |  |
| `data.deleted` | true | no |  |
| `data.removed` | object | no | What went with it. |
| `data.removed.orders` | integer | no |  |
| `data.removed.deals` | integer | no |  |
| `data.removed.positions` | integer | no |  |
| `data.removed.alertHooksUpdated` | integer | no |  |