# Move an account to another server

URL: https://docs.fxapis.com/api-reference/accounts/move-an-account-to-another-server

> Move an account to another server. For a login refused because it was added under the wrong server name: keeps the stored password and tries it on server…

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

For a login refused because it was added under the wrong server name: keeps the stored password and tries it on `server` instead, so the password is not sent again. The broker's likely servers are in the account's `problem.otherServers`. With `connect: true` (the default) the account is brought online straight away, so the answer comes back in seconds — watch `state`, or the account's events.

`409 ACCOUNT_EXISTS` when that login is already connected on that server here; `409 NO_PASSWORD` when no password is stored (send one to `/password` instead).

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

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string (uuid) | yes |  |

#### Request body (application/json, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `server` | string | yes | Exactly as MetaTrader shows it. Example: `"JustMarkets-Demo"` |
| `connect` | boolean | no |  |

#### Responses

- `200`
- `400`
- `401`
- `402`
- `403`
- `404`
- `409`
- `503`

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.id` | string (uuid) | no |  |
| `data.label` | null \| string | no | Yours, for telling accounts apart. |
| `data.login` | string | no | The MT5 account number. |
| `data.server` | string | no | The broker server name, exactly as MetaTrader shows it. |
| `data.mode` | "always_on" \| "warm_on_demand" \| "cold" | no |  |
| `data.state` | "created" \| "provisioning" \| "standby" \| "starting" \| "connecting" \| "synchronizing" \| "ready" \| "executing" \| "cooling" \| "offline" \| "degraded" \| "reconnecting" \| "invalid_credentials" \| "trading_disabled" \| "needs_2fa" \| "needs_certificate" \| "error" | no | Online: `ready` (can trade) and `executing` (an order is in flight). Connecting: `provisioning`, `starting`, `connecting`, `synchronizing`, `reconnecting` — poll until `ready`. Offline: `created`, `standby`, `cooling` (going offline) and `offline` (after a disconnect, send the account's credentials again to reconnect). `degraded`: online but misbehaving — restart the connection. Need a human: `invalid_credentials`, `needs_2fa`, `needs_certificate`, `trading_disabled`. `error`: see `stateDetail`. |
| `data.stateDetail` | null \| string | no | Why it is in that state, when there is more to say. |
| `data.stateChangedAt` | string (date-time) | no |  |
| `data.problem` | null \| object | no | Set when the account needs you, null otherwise: what is wrong in words, what the broker said, and what fixes it. For a refused login it names the broker's other servers, most likely first — a login only works on the server it was opened on. |
| `data.problem.code` | "LOGIN_REFUSED" \| "TRADING_DISABLED" \| "NEEDS_2FA" \| "NEEDS_CERTIFICATE" \| "CONNECTION_FAILED" | yes |  |
| `data.problem.title` | string | yes | Example: `"The broker refused the login"` |
| `data.problem.explanation` | string | yes |  |
| `data.problem.detail` | null \| string | yes | What the broker or terminal reported, verbatim. |
| `data.problem.otherServers` | string[] | yes | Example: `["JustMarkets-Demo","JustMarkets-Demo2"]` |
| `data.problem.actions` | object[] | yes | `switch_server`: `POST /v1/accounts/{id}/server` with that server. `replace_credentials`: send the account's corrected credentials (see Accounts in the reference). `connect`: `POST /v1/accounts/{id}/warm`. `contact_support`: write to support. |
| `data.problem.actions[].kind` | "switch_server" \| "replace_credentials" \| "connect" \| "contact_support" | yes |  |
| `data.problem.actions[].server` | string | no |  |
| `data.currency` | null \| string | no |  |
| `data.leverage` | null \| integer | no |  |
| `data.marginMode` | null \| string | no |  |
| `data.tradeAllowed` | null \| boolean | no |  |
| `data.brokerName` | null \| string | no |  |
| `data.environment` | "demo" \| "contest" \| "live" \| null | no | Demo, contest or live — from the terminal once it has logged in, or from the server's name until then. Plans give demo accounts free up to an allowance; a trial connects demo accounts only. |
| `data.tradingDisabled` | boolean | no | Set by us or by the broker. No order is accepted while true. |
| `data.createdAt` | string (date-time) | no |  |