MQuant Developers v1
Open MQuant

API reference

Nine endpoints under https://app.mquant.in/api/v1. Paths below are written in full, starting at /api/v1, because that is the path you sign.

The examples use the clients from Code examples: mq.sh for the shell, and an MQuantClient named mq in Python and Node.js. Pick a language once and every page remembers it.

Download the OpenAPI 3.1 description (openapi-v1.json) to generate a client or import the API into your tools. Its server URL already includes /api/v1, so its paths start at /time, /me and so on; sign the full path.

Conventions#

Response headerValue
X-Request-Idreq_ + 24 hex characters, on every response. Log it and quote it to the desk.
X-MQ-API-Version1
Cache-Controlno-store
X-RateLimit-Limit, -Remaining, -ResetOn authenticated responses. See Rate limit headers.
X-RateLimit-Day-RemainingOn write responses.
Retry-AfterOn every 429, in whole seconds.
Idempotent-Replayedtrue when a create call returned an existing signal.

Errors that any signed endpoint can return, in addition to those listed per endpoint: 401 auth_headers_invalid, timestamp_out_of_window, auth_failed, nonce_reused, key_expired, key_suspended, trader_inactive; 403 ip_not_allowed, scope_denied; 429 rate_limited, key_temporarily_blocked, ip_temporarily_blocked, auth_locked; 503 api_disabled, dependency_unavailable; 500 internal_error. An unknown path returns 404 not_found and a wrong method returns 405 method_not_allowed. See Errors.

Server time#

GET/api/v1/time

The server clock and the timestamp window. The only endpoint that needs no signature. Call it at start-up and every few minutes to check your clock.

  • Auth None
  • Scope None
  • Rate class Per-IP limit only

It keeps answering when the API is switched off for maintenance, so you can tell a clock problem from an outage.

FieldMeaning
server_time_msServer time, Unix epoch milliseconds
server_timeThe same time as ISO 8601 UTC
recv_window_msHow far behind the server your timestamp may be (5000)
future_skew_msHow far ahead of the server your timestamp may be (1000)

Responses

  • 200Server time.
  • 429rate_limited, ip_temporarily_blocked or auth_locked for your IP.
Shell
curl -sS https://app.mquant.in/api/v1/time
Response 200
{"status": "success", "data": {
  "server_time_ms": 1796184000123,
  "server_time": "2026-12-02T04:00:00.123Z",
  "recv_window_ms": 5000,
  "future_skew_ms": 1000
}}

The calling key#

GET/api/v1/me

Describes the key that signed the request: its mode, scopes, allowlist, limits, today's usage and whether the desk has paused intake. Use it as a health check when your system starts.

  • Scope Any
  • Rate class Read
  • Body None
FieldMeaning
caller_ipThe address MQuant sees for this request. Compare it with ip_allowlist.
expires_atWhen the key stops working.
rotation_grace_untilDuring a rotation, when the previous secret stops working; otherwise null.
limitsRate limits and risk caps on this key. See Rate limits and Risk caps.
usage_today.signalsSignals counted against signals_per_day since midnight IST.
intake_pausedtrue while the desk has paused new signals. Sends return 503 intake_paused; reads and cancels still work.
api_versionThe API version the key is pinned to.

Responses

  • 200The key.
  • 400body_not_allowed: a GET was sent with a body.
Shell, using mq.sh
./mq.sh GET /api/v1/me
Response 200
{"status": "success", "data": {
  "object": "api_key",
  "key_id": "mq_live_pk_7Lq2Wd9XcR4tVb1N0ZpKfE",
  "mode": "live",
  "label": "Algo box 1",
  "status": "active",
  "scopes": ["signals:read", "signals:write"],
  "expires_at": "2027-03-01T10:15:00.000Z",
  "ip_allowlist": ["203.0.113.10/32"],
  "caller_ip": "203.0.113.10",
  "rotation_grace_until": null,
  "trader": {"id": 12, "name": "Ravi Kumar"},
  "limits": {
    "signals_per_second": 10,
    "signals_per_minute": 400,
    "signals_per_day": 5000,
    "reads_per_second": 10,
    "reads_per_minute": 300,
    "max_quantity": 100000,
    "max_lots": 1000,
    "max_notional": "50000000.00"
  },
  "usage_today": {"signals": 37},
  "intake_paused": false,
  "api_version": "2026-12-01"
}}

Send a signal#

POST/api/v1/signals

Validates one signal, checks it against your risk caps and stores it with status received. The body is one signal object.

  • Scope signals:write
  • Rate class Write, cost 1
  • Max body 16,384 bytes

Sending the same client_signal_id again with an identical body returns the stored signal with 200, replayed: true and the header Idempotent-Replayed: true. A different body under the same id returns 409. See Idempotency.

Responses

  • 202Stored. replayed: false.
  • 200Replay of an existing signal. replayed: true.
  • 400invalid_json, duplicate_json_key, invalid_number.
  • 409idempotency_conflict, with existing_signal_id in details.
  • 413payload_too_large.
  • 415unsupported_media_type.
  • 422invalid_signal with field details, or a risk cap code with error_type: "RiskException".
  • 503intake_paused: the desk has paused new signals.
Shell, using mq.sh
./mq.sh POST /api/v1/signals '{"client_signal_id":"nifty-0001","exchange":"NFO","symbol":"NIFTY","instrument_type":"CE","expiry":"2026-12-29","strike":"24500","side":"BUY","lots":2,"order_type":"LIMIT","price":"112.50","product":"NRML","tag":"momo1"}'
Response 202
{"status": "success", "data": {
  "object": "signal",
  "signal_id": "sig_9f2c4e1a7b3d5f60a1b2c3d4",
  "client_signal_id": "nifty-0001",
  "batch_id": null,
  "status": "received",
  "mode": "live",
  "exchange": "NFO",
  "segment": "FNO",
  "symbol": "NIFTY",
  "instrument_type": "CE",
  "expiry": "2026-12-29",
  "strike": "24500.00",
  "side": "BUY",
  "quantity": null,
  "lots": 2,
  "order_type": "LIMIT",
  "price": "112.50",
  "trigger_price": null,
  "product": "NRML",
  "validity": "DAY",
  "tag": "momo1",
  "strategy_id": null,
  "algo_id": null,
  "notes": null,
  "warnings": ["outside_market_hours"],
  "reject_reason": null,
  "cancel_reason": null,
  "received_at": "2026-12-02T04:00:00.123Z",
  "updated_at": "2026-12-02T04:00:00.123Z",
  "replayed": false,
  "status_history": [
    {"status": "received", "at": "2026-12-02T04:00:00.123Z", "by": "trader", "note": null}
  ]
}}

Send a batch#

POST/api/v1/signals/batch

Sends 1 to 10 signals in one request, all or nothing: either every item is stored or none is. Use it for legs that belong together, such as a pair or a spread.

  • Scope signals:write
  • Rate class Write, cost = number of items
  • Max body 65,536 bytes
Body fieldRule
itemsArray of 1 to 10 signal objects, and no more than your key's signals_per_second. No other top-level fields.

Every item is validated first. If any fail, 422 invalid_signal lists each problem with its index, for example {"index": 2, "field": "items[2].price", "code": "price_required", …}. Items come back in request order. A failed batch still uses one unit of write budget; a stored batch uses one unit per item.

Responses

  • 202Stored. New items share one batch_id; exact repeats come back with replayed: true.
  • 200Every item was a replay. batch_id is null.
  • 409idempotency_conflict: an item reuses an id with a different payload. Nothing stored.
  • 413payload_too_large.
  • 422invalid_signal, batch_too_large, duplicate_client_signal_id, or a risk cap code.
  • 429rate_limited: the items would exceed a write limit. Nothing stored.
  • 503intake_paused.
Shell, using mq.sh
./mq.sh POST /api/v1/signals/batch '{"items":[{"client_signal_id":"pair-0001-a","exchange":"NSE","symbol":"HDFCBANK","instrument_type":"EQ","side":"BUY","quantity":50,"order_type":"LIMIT","price":"1712.40","product":"MIS"},{"client_signal_id":"pair-0001-b","exchange":"NSE","symbol":"ICICIBANK","instrument_type":"EQ","side":"SELL","quantity":60,"order_type":"LIMIT","price":"1281.05","product":"MIS"}]}'
Response 202
{"status": "success", "data": {
  "object": "batch",
  "batch_id": "bat_3e8a1f6c2d9b4a7e5c0f1d2b",
  "items": [
    {"object": "signal", "signal_id": "sig_51c0a7e29b3f4d68e1a2b3c4", "client_signal_id": "pair-0001-a",
     "batch_id": "bat_3e8a1f6c2d9b4a7e5c0f1d2b", "status": "received", "replayed": false, "...": "..."},
    {"object": "signal", "signal_id": "sig_a2d4f6b8c0e1f3a5b7c9d1e3", "client_signal_id": "pair-0001-b",
     "batch_id": "bat_3e8a1f6c2d9b4a7e5c0f1d2b", "status": "received", "replayed": false, "...": "..."}
  ]
}}

Dry-run a signal#

POST/api/v1/signals/test

Runs every validation rule and your risk caps on one signal and returns the normalised signal and its warnings. Nothing is stored and client_signal_id is not checked for reuse, so you can call it as often as you like within your read limits.

  • Scope signals:write
  • Rate class Read
  • Max body 16,384 bytes

It works while intake is paused, so you can keep testing during a pause.

Responses

  • 200Valid. normalised shows exactly what would be stored.
  • 400invalid_json, duplicate_json_key, invalid_number.
  • 413payload_too_large.
  • 415unsupported_media_type.
  • 422invalid_signal or a risk cap code.
Shell, using mq.sh
./mq.sh POST /api/v1/signals/test '{"client_signal_id":"nifty-0001","exchange":"NFO","symbol":"NIFTY","instrument_type":"CE","expiry":"2026-12-29","strike":"24500","side":"BUY","lots":2,"order_type":"LIMIT","price":"112.50","product":"NRML","tag":"momo1"}'
Response 200
{"status": "success", "data": {
  "object": "signal_validation",
  "valid": true,
  "normalised": {
    "client_signal_id": "nifty-0001", "exchange": "NFO", "segment": "FNO", "symbol": "NIFTY",
    "instrument_type": "CE", "expiry": "2026-12-29", "strike": "24500.00", "side": "BUY",
    "quantity": null, "lots": 2, "order_type": "LIMIT", "price": "112.50", "trigger_price": null,
    "product": "NRML", "validity": "DAY", "tag": "momo1", "strategy_id": null, "algo_id": null,
    "notes": null
  },
  "warnings": ["notional_unchecked"]
}}

Get a signal#

GET/api/v1/signals/{signal_id}

One signal by its MQuant id, with its current status and full history. You can read any signal sent by any of your keys in the same mode.

  • Scope signals:read
  • Rate class Read
Path parameterRule
signal_idsig_ followed by 24 lowercase hex characters

A signal that belongs to another trader or to the other mode returns 404, never 403.

Responses

  • 200The signal.
  • 404not_found.
Shell, using mq.sh
./mq.sh GET /api/v1/signals/sig_9f2c4e1a7b3d5f60a1b2c3d4
Response 200
{"status": "success", "data": {
  "object": "signal",
  "signal_id": "sig_9f2c4e1a7b3d5f60a1b2c3d4",
  "client_signal_id": "nifty-0001",
  "batch_id": null,
  "status": "received",
  "mode": "live",
  "exchange": "NFO",
  "segment": "FNO",
  "symbol": "NIFTY",
  "instrument_type": "CE",
  "expiry": "2026-12-29",
  "strike": "24500.00",
  "side": "BUY",
  "quantity": null,
  "lots": 2,
  "order_type": "LIMIT",
  "price": "112.50",
  "trigger_price": null,
  "product": "NRML",
  "validity": "DAY",
  "tag": "momo1",
  "strategy_id": null,
  "algo_id": null,
  "notes": null,
  "warnings": ["outside_market_hours"],
  "reject_reason": null,
  "cancel_reason": null,
  "received_at": "2026-12-02T04:00:00.123Z",
  "updated_at": "2026-12-02T04:00:00.123Z",
  "status_history": [
    {"status": "received", "at": "2026-12-02T04:00:00.123Z", "by": "trader", "note": null}
  ]
}}

Look up by your id#

GET/api/v1/signals/by-client-id/{client_signal_id}

Finds a signal by your own client_signal_id. It matches only signals sent with the calling key. Use it after a timeout to learn whether a signal was stored before you send it again.

  • Scope signals:read
  • Rate class Read
Path parameterRule
client_signal_id1 to 64 characters from A-Z a-z 0-9 _ -

Responses

  • 200The signal.
  • 404not_found: this key never stored a signal with that id.
Shell, using mq.sh
./mq.sh GET /api/v1/signals/by-client-id/nifty-0001
Response 200
{"status": "success", "data": {
  "object": "signal",
  "signal_id": "sig_9f2c4e1a7b3d5f60a1b2c3d4",
  "client_signal_id": "nifty-0001",
  "batch_id": null,
  "status": "received",
  "mode": "live",
  "exchange": "NFO",
  "segment": "FNO",
  "symbol": "NIFTY",
  "instrument_type": "CE",
  "expiry": "2026-12-29",
  "strike": "24500.00",
  "side": "BUY",
  "quantity": null,
  "lots": 2,
  "order_type": "LIMIT",
  "price": "112.50",
  "trigger_price": null,
  "product": "NRML",
  "validity": "DAY",
  "tag": "momo1",
  "strategy_id": null,
  "algo_id": null,
  "notes": null,
  "warnings": ["outside_market_hours"],
  "reject_reason": null,
  "cancel_reason": null,
  "received_at": "2026-12-02T04:00:00.123Z",
  "updated_at": "2026-12-02T04:00:00.123Z",
  "status_history": [
    {"status": "received", "at": "2026-12-02T04:00:00.123Z", "by": "trader", "note": null}
  ]
}}

List signals#

GET/api/v1/signals

Your signals, newest first, across all of your keys in the same mode. Pages are cursor-based.

  • Scope signals:read
  • Rate class Read
Query parameterRule
statusreceived, accepted, rejected, cancel_requested, cancelled or mapped
exchangeNSE, BSE, NFO, BFO or MCX
symbolExact symbol; upper-cased before matching
client_signal_idExact match
batch_idA bat_… id from a batch response
from, toYYYY-MM-DD, IST calendar days, inclusive, on received_at
limit1 to 100, default 20
starting_afterA sig_… id from a previous page. Returns signals older than that one.

While has_more is true, pass next_starting_after as starting_after to get the next page. Unknown or repeated parameters return 400 invalid_query_param. Sign the query string exactly as you send it.

Responses

  • 200A page of signals.
  • 400invalid_query_param or invalid_cursor.
Shell, using mq.sh
./mq.sh GET '/api/v1/signals?status=received&limit=20'
Response 200
{"status": "success", "data": {
  "object": "list",
  "items": [
    {"object": "signal", "signal_id": "sig_9f2c4e1a7b3d5f60a1b2c3d4", "status": "received", "...": "..."}
  ],
  "has_more": true,
  "next_starting_after": "sig_9f2c4e1a7b3d5f60a1b2c3d4"
}}

Cancel a signal#

POST/api/v1/signals/{signal_id}/cancel

Withdraws a signal you sent. This changes the stored status only: in v1 there is no order at a broker to cancel.

  • Scope signals:write
  • Rate class Write, cost 1
  • Max body 16,384 bytes
Body fieldRule
reasonOptional, 1 to 200 characters. Send no body at all to cancel without a reason.
Current statusResult
received, acceptedcancelled; cancel_reason is your reason or trader_request
mappedcancel_requested (reserved for routing)
cancel_requestedReturned unchanged with 200
cancelled, rejected409 signal_not_cancellable

Cancelling works while intake is paused.

Responses

  • 200The signal after the change.
  • 404not_found.
  • 409signal_not_cancellable.
  • 413payload_too_large.
  • 415unsupported_media_type.
  • 422invalid_signal: the reason is empty, too long or not a string.
Shell, using mq.sh
./mq.sh POST /api/v1/signals/sig_9f2c4e1a7b3d5f60a1b2c3d4/cancel '{"reason":"stop hit on signal side"}'
Response 200
{"status": "success", "data": {
  "object": "signal",
  "signal_id": "sig_9f2c4e1a7b3d5f60a1b2c3d4",
  "client_signal_id": "nifty-0001",
  "batch_id": null,
  "status": "cancelled",
  "mode": "live",
  "exchange": "NFO",
  "segment": "FNO",
  "symbol": "NIFTY",
  "instrument_type": "CE",
  "expiry": "2026-12-29",
  "strike": "24500.00",
  "side": "BUY",
  "quantity": null,
  "lots": 2,
  "order_type": "LIMIT",
  "price": "112.50",
  "trigger_price": null,
  "product": "NRML",
  "validity": "DAY",
  "tag": "momo1",
  "strategy_id": null,
  "algo_id": null,
  "notes": null,
  "warnings": ["outside_market_hours"],
  "reject_reason": null,
  "cancel_reason": "stop hit on signal side",
  "received_at": "2026-12-02T04:00:00.123Z",
  "updated_at": "2026-12-02T04:03:11.502Z",
  "status_history": [
    {"status": "received", "at": "2026-12-02T04:00:00.123Z", "by": "trader", "note": null},
    {"status": "cancelled", "at": "2026-12-02T04:03:11.502Z", "by": "trader", "note": "stop hit on signal side"}
  ]
}}