Errors and Limits
Error format
Every error response has the same JSON body. id repeats the HTTP status, error names the error and message explains it. requestId matches the X-Request-Id response header: include it when you report a problem.
{
"id": 404,
"error": "NotFoundError",
"message": "Account not found",
"requestId": "4f7c2a9e-1b3d-4c8e-9a6f-2d5b8e1c0a47"
}Some errors add details (which field failed, or the id of an existing account) or metadata (for example when a blocked login lifts, or the code of a trading error).
You can send your own X-Request-Id header (8 to 64 letters, digits, dashes or underscores). The API echoes it back, so your logs and ours share one id.
HTTP errors
| Status | Error | When it happens | What to do | Retryable |
|---|---|---|---|---|
| 400 | ValidationError | A field is missing, has the wrong type, or a date is not ISO 8601. details lists each problem. The path or query string contains a null byte (%00). Trading calls also return it without a valid Idempotency-Key (E_IDEMPOTENCY_KEY_MISSING) or for a volume outside the symbol's limits (E_INVALID_VOLUME). | Fix the request using details and metadata. | No |
| 400 | CredentialsBlockedError | The broker rejected this exact login, password and server a short time ago. metadata.blockedUntil says when you can try again. | Check the login, investor password and server name. Retrying the same details before blockedUntil is refused. | After blockedUntil, with corrected details |
| 401 | UnauthorizedError | The API key is missing, wrong, revoked or expired. An expired key gets the message This API key expired on 4 Mar 2026. Create a new key in the API portal. The date is in UTC. | Send Authorization: Bearer fo_live_... with an active key from the API keys page. | No |
| 402 | PaymentRequiredError | Deploying this account needs more credit than your balance holds. Creating an account is also refused while 20 accounts wait for payment (metadata.waitingAccounts, metadata.limit). | Add funds on the Billing page, then deploy again. | After adding funds |
| 403 | ForbiddenError | The API key is read-only and the request is not a GET, or the key is limited to chosen accounts and the endpoint covers your whole developer account (creating accounts, billing). On trading calls: the account cannot trade (E_ACCOUNT_CANNOT_TRADE), or its platform and margin mode cannot trade (E_TRADING_NOT_SUPPORTED). | Use a key with the access you need. Keys are set when you create them on the API keys page. For E_ACCOUNT_CANNOT_TRADE, connect the account with its master password. | No |
| 404 | NotFoundError | The account does not exist, belongs to another developer, or your API key is limited to other accounts. On prices: the broker has no symbol with that name (Symbol not found), or no quote for it yet (No quote). | Check the account id. List the accounts your key can see with GET /v1/accounts. | No |
| 409 | ConflictError | The account already exists (details.existingAccountId has its id), is being deleted, or cannot make that change from its current state. | Use the existing account, or read the account and act on its state. | No |
| 413 | PayloadTooLargeError | The body of a POST, PUT or PATCH request, MCP requests included, is larger than 1 MiB (1,048,576 bytes). | Send a smaller body. | No |
| 422 | TradeRejectedError | The broker rejected a trade. metadata has code, brokerCode, retryable and tradeRequestId. | See trading errors. | When retryable is true, with a new Idempotency-Key |
| 422 | IdempotencyKeyReusedError | The Idempotency-Key was already used for a different trading request. | Use a new key for a new request. | No |
| 429 | TooManyRequestsError | Too many requests per second, 3 accounts are already deploying, or 50 trade requests are already waiting for the account (E_QUEUE_FULL). | Wait for the number of seconds in the Retry-After header. The deploy limit and the full trade queue send no Retry-After: wait for a deploy to finish, or for this account's trade requests to finish. | Yes |
| 500 | InternalError | Something failed on our side. | Retry with a short backoff. If it keeps failing, report the requestId. | Yes |
| 502 | InternalError | The payment provider failed while creating a checkout. | Retry the checkout. | Yes |
| 503 | ServiceUnavailableError | A deploy could not be queued. On trading calls: the account is not connected or has not reported yet whether it can trade (E_ACCOUNT_NOT_CONNECTED), or the trade request expired before it was sent (E_REQUEST_EXPIRED). On prices: the account is not deployed and connected (E_ACCOUNT_NOT_CONNECTED), or it cannot read prices right now or did not answer within about 10 seconds (E_PRICES_UNAVAILABLE). | Retry with a short backoff. A trade that expired was never sent: send it again with a new Idempotency-Key. | Yes |
Account connection errors
Connecting to the broker happens after POST /v1/accounts returns. If it fails, the account's error field explains why, and retryable tells you whether deploying again can help.
{
"code": "E_AUTH",
"message": "Invalid account",
"retryable": false
}| Code | Meaning | What to do | Retryable |
|---|---|---|---|
E_AUTH | The broker rejected the login. message is the broker's own reason. | Delete the account and create it again with the correct login, password and server. | No |
E_SRV_NOT_FOUND | The broker server name was not found. suggestions lists the closest known names, and is empty for a name longer than 100 characters. | Delete the account and create it again with the right name. Find it with GET /v1/servers?query=... or in the MetaTrader login window. | No |
E_BROKER_UNREACHABLE | The broker server did not answer. | Deploy again later. | Yes |
E_TIMEOUT | The broker took too long to log in. | Deploy again. | Yes |
E_NO_CAPACITY | No connection slot was free. | Deploy again later. | Yes |
E_INSUFFICIENT_CREDIT | Your credit does not cover the deploy. | Add funds on the Billing page, then deploy again. | No |
E_PROVISIONING_PAUSED | New deployments are paused for a short time. | Deploy again later. | Yes |
E_INTERNAL | Something failed on our side. | Deploy again. If retryable is false, wait before retrying. | Usually |
Trading errors
Trading calls add a stable code to metadata. The calls below are refused before anything is stored. Fix the cause, then send the request again: with the same Idempotency-Key, except after E_IDEMPOTENCY_KEY_REUSED, which needs a new key.
| Status | Code | Meaning |
|---|---|---|
| 400 | E_IDEMPOTENCY_KEY_MISSING | The Idempotency-Key header is missing or invalid. |
| 400 | E_INVALID_VOLUME | The volume is outside the symbol's range or off its lot step. metadata has volumeMin, volumeMax and volumeStep. |
| 400 | E_TRADE_DISABLED | The broker does not allow this trade on the symbol. |
| 400 | E_CLOSE_ONLY | The symbol only allows closing positions. |
| 400 | E_INVALID_CLOSE_BY | Close Position By: the two tickets are the same, are on different symbols or are in the same direction. details names oppositeTicket. |
| 403 | E_ACCOUNT_CANNOT_TRADE | The account is connected with its investor password, or the broker has disabled trading. |
| 403 | E_TRADING_NOT_SUPPORTED | Trading is not available for the account's platform and margin mode. |
| 422 | E_IDEMPOTENCY_KEY_REUSED | The key was used for a different request. |
| 429 | E_QUEUE_FULL | 50 trade requests are already waiting for the account. |
| 503 | E_ACCOUNT_NOT_CONNECTED | The account is not deployed and connected, or its connection has not reported yet whether it can trade. Also returned by Get Quote, Get Quotes, List Candles, the calculations and Check Order. |
| 503 | E_PRICES_UNAVAILABLE | Get Quote, Get Quotes, List Candles, the calculations or Check Order: the account cannot answer right now or did not answer within about 10 seconds; retry shortly. For one symbol of Get Quotes this is that symbol's entry in errors, not a failed call. |
The codes below are outcomes of a stored trade request, returned as 422 TradeRejectedError (or 503 for E_REQUEST_EXPIRED) and kept in the trade request's error.code. brokerCode is the broker's own code: an MT5 return code or an MT4 error number, negative for FundedOps codes. Send a retryable trade again with a new Idempotency-Key.
| Code | Meaning | Retryable |
|---|---|---|
E_REQUOTE | The price changed before the broker could fill the request. | Yes |
E_REJECTED | The broker rejected the request. | No |
E_BROKER_TIMEOUT | The broker did not answer in time. Check the order state before retrying. | Yes |
E_INVALID_REQUEST | The broker did not accept the request parameters. | No |
E_INVALID_VOLUME | The volume is not valid for this symbol. | No |
E_INVALID_PRICE | The price is not valid. | No |
E_INVALID_STOPS | The stop loss or take profit is too close to the market price, or invalid. | No |
E_INVALID_EXPIRATION | The expiration could not be used. | No |
E_INVALID_FILL | The broker does not support this filling mode for the symbol. | No |
E_INVALID_CLOSE_VOLUME | The close volume is larger than the position volume. Nothing was sent. | No |
E_INVALID_CLOSE_BY | Close Position By: the two positions are not open on the same symbol in opposite directions. | No |
E_TRADE_DISABLED | Trading is disabled for this symbol or account, also when the broker's server disables automated trading. | No |
E_CLOSE_ONLY | The broker only allows closing positions for this symbol. | No |
E_MARKET_CLOSED | The market is closed. | No |
E_NO_MONEY | There is not enough free margin for this request. | No |
E_NO_QUOTES | The broker has no prices for this symbol right now. | Yes |
E_ORDER_LOCKED | The order or position is being processed. | Yes |
E_FROZEN | The order or position is frozen because it is too close to the market price. | Yes |
E_TOO_MANY_REQUESTS | Too many requests were sent to the broker. | Yes |
E_TOO_MANY_ORDERS | The account reached the broker's limit for orders or positions. | No |
E_AUTOTRADING_DISABLED | Automated trading is disabled for this account. | Yes |
E_NO_CONNECTION | The account has no connection to the broker. Returned for changes and cancels only: an open or a close ends unknown instead. | Yes |
E_BUSY | The trade context is busy. | Yes |
E_FIFO | The broker requires positions to be closed in FIFO order. | No |
E_POSITION_NOT_FOUND | The position does not exist. It may already be closed. | No |
E_ORDER_NOT_FOUND | The order does not exist. It may already be filled or cancelled. | No |
E_SOME_POSITIONS_NOT_CLOSED | Close Positions: some positions were not closed. result.positions has the details. | No |
E_NOT_SENT | The request was not sent and nothing changed on the account. | Yes |
E_REQUEST_EXPIRED | The request expired before it was sent to the broker. Nothing happened: send it again with a new key. Always a 503. | Yes |
E_ACCOUNT_CANNOT_TRADE | Trading is not allowed on this account. | No |
E_TRADING_NOT_SUPPORTED | This connection does not support trading. | No |
E_BROKER_ERROR | Any other broker code. brokerCode has it. | No |
Broker codes map to these codes by meaning. For example, MT4 errors 4051 and 4106 (unknown symbol) are E_INVALID_REQUEST, 4107 is E_INVALID_PRICE, and 4110 and 4111 (buys or sells not allowed) are E_TRADE_DISABLED. MT5 code 10026 and MT4 error 4112 (the broker's server disabled automated trading) are also E_TRADE_DISABLED and not retryable, while MT5 code 10027 is E_AUTOTRADING_DISABLED.
A trade request can also end unknown: it reached the broker but no outcome came back, or the connection to the broker dropped while an open or a close was sent. Check the account's positions and orders before you send it again, as the Trading guide explains.
Rate limits
| Limit | Value | When you exceed it |
|---|---|---|
| Requests per second, per developer account | 25, with bursts up to 100 | 429 TooManyRequestsError with a Retry-After header |
| Accounts deploying at the same time | 3 | 429 TooManyRequestsError until one finishes |
| Trade requests waiting per account | 50 | 429 TooManyRequestsError with E_QUEUE_FULL until some finish |
| Active API keys | 5 | Revoke a key before creating another |
| Results per page on list endpoints | 100 by default, up to 1,000 with limit | Read the next page from X-Next-Offset |
| WebSocket connections per developer account | 5, shared by all your keys | The new connection closes with code 4429 |
| Accounts per WebSocket connection | 50 | The extra subscribe gets an error frame; the connection stays open |
| Price subscriptions per WebSocket connection | 50, quote symbols and candle streams together | The subscribe gets a 429 error frame; nothing new is subscribed |
| Bars per List Candles call | 100 by default, up to 1,000 with limit | 400 ValidationError |
| Symbols per Get Quotes call | 50 | 400 ValidationError |
Request body of a POST, PUT or PATCH | 1 MiB (1,048,576 bytes) | 413 PayloadTooLargeError |
Every response to a request with a valid key carries the current budget:
| Header | Meaning |
|---|---|
X-RateLimit-Limit | The most requests you can send in a burst (100). |
X-RateLimit-Remaining | Whole requests left after this one. |
X-RateLimit-Reset | Seconds until the budget is full again (0 when it is full). |
List endpoints that take offset and limit (GET /v1/accounts, history-deals, history-orders, history-positions) add X-Total-Count, the number of matching rows, and X-Next-Offset when there is another page. Send that value as offset to read it. offset can be at most 1,000,000,000.
All your API keys share the same limits. See WebSockets for close codes and keepalive rules.
Check System Status when requests fail unexpectedly.
Retrying safely
Retry only when the table says so, and wait longer each time: for example 1, 2, 4 and 8 seconds. A trading call you are unsure about is safe to send again with the same Idempotency-Key: it returns the first outcome instead of trading twice. That includes a 502 or 504 from a proxy on the way, whose body is not the error format above: the trade may have been stored or sent, so send it again with the same key, never a new one. On a 429, always wait at least the Retry-After seconds. Repeating deploy, undeploy or DELETE on an account that is already in that state returns the account unchanged, and creating an account that already exists returns 409 with its id instead of a second copy.