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 status | Text | Meaning |
|---|---|---|
| 400 | assets are required | The assets parameter was missing or empty. |
| 400 | allowed assets size is 25 | More than 25 symbols were requested in one call. |
| 400 | aggregation not supported | aggregation is not one of the allowed intervals. |
| 400 | start and end time should be greater than 0 | start_time or end_time was missing or not positive. |
| 400 | end time should be greater than start time | end_time was less than or equal to start_time. |
| 400 | invalid assets | An asset was not in valid <base>/<quote> format. |
| 404 | asset not found | The requested symbol is not recognised. |
| 429 | Rate limit exceeded | More than 300 requests per minute from your IP. |
| 5xx | something went wrong | Internal 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" } }| Code | Message | Cause |
|---|---|---|
| 400 | invalid JSON | Malformed request body. |
| 400 | unknown method | method is not one of the three valid values (SUBSCRIBE, UNSUBSCRIBE, LIST_SUBSCRIPTIONS). |
| 400 | invalid stream name: <x> | Unrecognised stream or unsupported interval. |
| 400 | not subscribed: <x> | Unsubscribing from a stream not currently active. |
| 429 | subscription limit reached | Would 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 status | Meaning |
|---|---|
| 400 | Bad or missing parameter (invalid request). |
| 401 | Invalid or missing X-Authentication. |
| 403 | Scope / IP not allowed. |
| 404 | Resource not found. |
| 409 | Conflicting or duplicate action. |
| 429 | Throttled by the rate limiter. |
| 5xx | Internal error; retry with backoff. |
Common error reference
| HTTP | Error text | Meaning / how to fix |
|---|---|---|
| 400 | Params error | Missing or invalid order parameters (e.g. missing leverage or order_price). |
| 400 | invalid trigger type | trigger_type is not MARKET or LIMIT. |
| 400 | invalid order type | order_type is not LONG or SHORT. |
| 400 | order price out of permissible range | order_price is outside the asset's min/max price. |
| 400 | quantity not a multiple of the quantity step | quantity is not a multiple of the asset's quantity_step. |
| 400 | leverage out of permissible range | leverage is outside the asset's min/max (or 0/negative). |
| 400 | order quantity out of permissible range | Order amend sent without quantity (both order_price and quantity are required), or quantity outside the allowed range. |
| 400 | risk order id missing | Editing SL/TP without stoploss_order_id / takeprofit_order_id. Fetch them from the open position. |
| 400 | Position is not in OPEN state | Acting on a position that is not currently open. |
| 400 | insufficient balance | Source wallet lacks funds — or INR was sent to the USDT transfer path (use POST /futures/transfers/inr). |
| 400 | Invalid trade currency | trade_currency / currency is not USDT or INR. Use a supported value. |
| 404 | order not found | The order id is invalid or does not exist. |
| 404 | Position not found | The position id is invalid or does not exist. |
| 404 | leverage not found | Leverage 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
Updated about 1 month ago
