Guides
Guides

Errors

Error formats and codes for the Mudrex API. This page covers the public market-data endpoints first, then the authenticated trading API. REST errors (both surfaces) return success: false with an errors array of { code, text }. WebSocket errors use an error object of { code, msg }.

Market Data

REST (klines / mark-klines)

Error responses mirror the success envelope with success: false; each error has a code and a text.

{ "success": false, "errors": [{ "code": 400, "text": "assets are required" }] }
HTTP statusTextMeaning
400assets are requiredThe assets parameter was missing or empty.
400allowed assets size is 25More than 25 symbols were requested in one call.
400aggregation not supportedaggregation is not one of the allowed intervals.
400start and end time should be greater than 0start_time or end_time was missing or not positive.
400end time should be greater than start timeend_time was less than or equal to start_time.
400invalid assetsAn asset was not in valid <base>/<quote> format.
404asset not foundThe requested symbol is not recognised.
429Rate limit exceededMore than 300 requests per minute from your IP.
5xxsomething went wrongInternal server error; retry with backoff.

WebSocket (live streams)

Errors are returned in the response error object; codes are application-level, not HTTP status codes. With all-or-nothing semantics, an invalid stream rejects the whole request and changes no state.

{ "method": "SUBSCRIBE", "id": 1, "error": { "code": 400, "msg": "invalid stream name: kline@5m@btcusdt" } }
CodeMessageCause
400invalid JSONMalformed request body.
400unknown methodmethod is not one of the three valid values (SUBSCRIBE, UNSUBSCRIBE, LIST_SUBSCRIPTIONS).
400invalid stream name: <x>Unrecognised stream or unsupported interval.
400not subscribed: <x>Unsubscribing from a stream not currently active.
429subscription limit reachedWould exceed 15 active subscriptions on the connection.

Trading API

Errors mirror the success envelope with success: false and return an errors array; each entry has a code and a text.

{
  "success": false,
  "errors": [
    { "code": 400, "text": "Human readable message" }
  ]
}

HTTP status codes

HTTP statusMeaning
400Bad or missing parameter (invalid request).
401Invalid or missing X-Authentication.
403Scope / IP not allowed.
404Resource not found.
409Conflicting or duplicate action.
429Throttled by the rate limiter.
5xxInternal error; retry with backoff.

Common error reference

HTTPError textMeaning / how to fix
400Params errorMissing or invalid order parameters (e.g. missing leverage or order_price).
400invalid trigger typetrigger_type is not MARKET or LIMIT.
400invalid order typeorder_type is not LONG or SHORT.
400order price out of permissible rangeorder_price is outside the asset's min/max price.
400quantity not a multiple of the quantity stepquantity is not a multiple of the asset's quantity_step.
400leverage out of permissible rangeleverage is outside the asset's min/max (or 0/negative).
400order quantity out of permissible rangeOrder amend sent without quantity (both order_price and quantity are required), or quantity outside the allowed range.
400risk order id missingEditing SL/TP without stoploss_order_id / takeprofit_order_id. Fetch them from the open position.
400Position is not in OPEN stateActing on a position that is not currently open.
400insufficient balanceSource wallet lacks funds — or INR was sent to the USDT transfer path (use POST /futures/transfers/inr).
400Invalid trade currencytrade_currency / currency is not USDT or INR. Use a supported value.
404order not foundThe order id is invalid or does not exist.
404Position not foundThe position id is invalid or does not exist.
404leverage not foundLeverage has never been set for that (asset, currency) pair. Set it first via POST /futures/{asset_id}/leverage.

Currency-related examples

Invalid trade currency — any trade_currency (or currency) value other than USDT or INR.

{ "success": false, "errors": [{ "code": 400, "text": "Invalid trade currency" }] }

Status: 400 Bad Request

Leverage not set in this currency — querying leverage for an (asset, currency) pair never set.

{ "success": false, "errors": [{ "code": 404, "text": "leverage not found" }] }

Status: 404 Not Found

Missing risk order id — editing SL/TP without the existing order ids.

{ "success": false, "errors": [{ "code": 400, "text": "risk order id missing" }] }

Status: 400 Bad Request


What’s Next

Did this page help you?