Skip to content

Error Codes

When a request fails, the API returns an appropriate HTTP status code along with a JSON error body.

{
"error": "invalid_volume",
"message": "Volume 0.003 is below minimum 0.01 for EURUSD"
}

All error responses include an error code string and a human-readable message.

HTTP StatusError CodeDescription
400invalid_requestMalformed request body or missing required parameters
400invalid_symbolThe specified symbol does not exist or is not tradeable
400invalid_volumeVolume does not respect the symbol’s min, max, or step constraints
400rejectedThe trade was rejected by the MT5 server (e.g., insufficient margin)
401unauthorizedMissing or invalid API key
403forbiddenAPI key does not have permission for this operation
404position_not_foundThe specified position ticket does not exist or is already closed
429rate_limit_exceededRate limit budget exhausted. See Rate Limits
503bridge_unavailableThe MT5 bridge is temporarily unavailable. Retry after a brief delay
504mt5_timeoutThe MT5 server did not respond within the timeout period

Keep these limits in mind when building your integration:

ConstraintValue
Maximum open positions200
Maximum history range90 days (custom date range)
Maximum comment length27 characters (ASCII only)
Bridge timeout7 seconds
Rate limit budget600 weight per minute
Idempotency key TTL120 seconds
WebSocket connections per key10
WebSocket subscriptions per connection1000

Trade-related endpoints return an MT5 retcode in the response. Common values:

RetcodeMeaning
10008Order placed (pending confirmation)
10009Order executed successfully
10004Requote
10006Request rejected
10007Request canceled by trader
10010Order partially filled
10013Invalid request
10014Invalid volume
10015Invalid price
10016Invalid stops
10019Not enough money
  • 400 errors: Fix the request parameters and retry.
  • 401/403 errors: Verify your API key is valid, active, and has the required permissions.
  • 404 errors: The position may have been closed by SL/TP or another process. Refresh your position list.
  • 429 errors: Wait for retry_after_sec seconds before retrying. See Rate Limits.
  • 503/504 errors: These are transient. Retry with an idempotency key to prevent duplicates.