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.
- GET/timeServer time, no auth
- GET/meThe calling key
- POST/signalsSend a signal
- POST/signals/batchSend up to 10, all or nothing
- POST/signals/testValidate without storing
- GET/signals/{signal_id}One signal
- GET/signals/by-client-id/{client_signal_id}Look up by your id
- GET/signalsList and page
- POST/signals/{signal_id}/cancelCancel
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 header | Value |
|---|---|
X-Request-Id | req_ + 24 hex characters, on every response. Log it and quote it to the desk. |
X-MQ-API-Version | 1 |
Cache-Control | no-store |
X-RateLimit-Limit, -Remaining, -Reset | On authenticated responses. See Rate limit headers. |
X-RateLimit-Day-Remaining | On write responses. |
Retry-After | On every 429, in whole seconds. |
Idempotent-Replayed | true 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#
/api/v1/timeThe 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.
| Field | Meaning |
|---|---|
server_time_ms | Server time, Unix epoch milliseconds |
server_time | The same time as ISO 8601 UTC |
recv_window_ms | How far behind the server your timestamp may be (5000) |
future_skew_ms | How far ahead of the server your timestamp may be (1000) |
Responses
- 200Server time.
- 429
rate_limited,ip_temporarily_blockedorauth_lockedfor your IP.
curl -sS https://app.mquant.in/api/v1/timeimport requests
print(requests.get("https://app.mquant.in/api/v1/time", timeout=10).json())const response = await fetch('https://app.mquant.in/api/v1/time')
console.log(await response.json()){"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#
/api/v1/meDescribes 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
| Field | Meaning |
|---|---|
caller_ip | The address MQuant sees for this request. Compare it with ip_allowlist. |
expires_at | When the key stops working. |
rotation_grace_until | During a rotation, when the previous secret stops working; otherwise null. |
limits | Rate limits and risk caps on this key. See Rate limits and Risk caps. |
usage_today.signals | Signals counted against signals_per_day since midnight IST. |
intake_paused | true while the desk has paused new signals. Sends return 503 intake_paused; reads and cancels still work. |
api_version | The API version the key is pinned to. |
Responses
- 200The key.
- 400
body_not_allowed: a GET was sent with a body.
./mq.sh GET /api/v1/meme = mq.get("/api/v1/me")
print(me["mode"], me["caller_ip"], me["limits"])const me = await mq.get('/api/v1/me')
console.log(me.mode, me.caller_ip, me.limits){"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#
/api/v1/signalsValidates 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. - 400
invalid_json,duplicate_json_key,invalid_number. - 409
idempotency_conflict, withexisting_signal_idindetails. - 413
payload_too_large. - 415
unsupported_media_type. - 422
invalid_signalwith fielddetails, or a risk cap code witherror_type: "RiskException". - 503
intake_paused: the desk has paused new signals.
./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"}'signal = mq.send_signal({
"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",
})
print(signal["signal_id"], signal["status"], signal["replayed"])const signal = await mq.sendSignal({
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',
})
console.log(signal.signal_id, signal.status, signal.replayed){"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#
/api/v1/signals/batchSends 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 field | Rule |
|---|---|
items | Array 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 withreplayed: true. - 200Every item was a replay.
batch_idisnull. - 409
idempotency_conflict: an item reuses an id with a different payload. Nothing stored. - 413
payload_too_large. - 422
invalid_signal,batch_too_large,duplicate_client_signal_id, or a risk cap code. - 429
rate_limited: the items would exceed a write limit. Nothing stored. - 503
intake_paused.
./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"}]}'batch = mq.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"},
]})
print(batch["batch_id"], [item["signal_id"] for item in batch["items"]])const batch = await mq.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' },
] })
console.log(batch.batch_id, batch.items.map((item) => item.signal_id)){"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#
/api/v1/signals/testRuns 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.
normalisedshows exactly what would be stored. - 400
invalid_json,duplicate_json_key,invalid_number. - 413
payload_too_large. - 415
unsupported_media_type. - 422
invalid_signalor a risk cap code.
./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"}'check = mq.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",
})
print(check["valid"], check["warnings"])const check = await mq.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',
})
console.log(check.valid, check.warnings){"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#
/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 parameter | Rule |
|---|---|
signal_id | sig_ 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.
- 404
not_found.
./mq.sh GET /api/v1/signals/sig_9f2c4e1a7b3d5f60a1b2c3d4signal = mq.signal("sig_9f2c4e1a7b3d5f60a1b2c3d4")
print(signal["status"], signal["status_history"])const signal = await mq.signal('sig_9f2c4e1a7b3d5f60a1b2c3d4')
console.log(signal.status, signal.status_history){"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#
/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 parameter | Rule |
|---|---|
client_signal_id | 1 to 64 characters from A-Z a-z 0-9 _ - |
Responses
- 200The signal.
- 404
not_found: this key never stored a signal with that id.
./mq.sh GET /api/v1/signals/by-client-id/nifty-0001signal = mq.signal_by_client_id("nifty-0001")
print(signal["signal_id"], signal["status"])const signal = await mq.signalByClientId('nifty-0001')
console.log(signal.signal_id, signal.status){"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#
/api/v1/signalsYour signals, newest first, across all of your keys in the same mode. Pages are cursor-based.
- Scope
signals:read - Rate class Read
| Query parameter | Rule |
|---|---|
status | received, accepted, rejected, cancel_requested, cancelled or mapped |
exchange | NSE, BSE, NFO, BFO or MCX |
symbol | Exact symbol; upper-cased before matching |
client_signal_id | Exact match |
batch_id | A bat_… id from a batch response |
from, to | YYYY-MM-DD, IST calendar days, inclusive, on received_at |
limit | 1 to 100, default 20 |
starting_after | A 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.
- 400
invalid_query_paramorinvalid_cursor.
./mq.sh GET '/api/v1/signals?status=received&limit=20'params = {"status": "received", "limit": 100}
page = mq.get("/api/v1/signals", params)
while True:
for signal in page["items"]:
print(signal["signal_id"], signal["client_signal_id"], signal["status"])
if not page["has_more"]:
break
page = mq.get("/api/v1/signals", {**params, "starting_after": page["next_starting_after"]})const params = { status: 'received', limit: 100 }
let page = await mq.get('/api/v1/signals', params)
while (true) {
for (const signal of page.items) console.log(signal.signal_id, signal.client_signal_id, signal.status)
if (!page.has_more) break
page = await mq.get('/api/v1/signals', { ...params, starting_after: page.next_starting_after })
}{"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#
/api/v1/signals/{signal_id}/cancelWithdraws 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 field | Rule |
|---|---|
reason | Optional, 1 to 200 characters. Send no body at all to cancel without a reason. |
| Current status | Result |
|---|---|
received, accepted | cancelled; cancel_reason is your reason or trader_request |
mapped | cancel_requested (reserved for routing) |
cancel_requested | Returned unchanged with 200 |
cancelled, rejected | 409 signal_not_cancellable |
Cancelling works while intake is paused.
Responses
- 200The signal after the change.
- 404
not_found. - 409
signal_not_cancellable. - 413
payload_too_large. - 415
unsupported_media_type. - 422
invalid_signal: the reason is empty, too long or not a string.
./mq.sh POST /api/v1/signals/sig_9f2c4e1a7b3d5f60a1b2c3d4/cancel '{"reason":"stop hit on signal side"}'signal = mq.cancel("sig_9f2c4e1a7b3d5f60a1b2c3d4", "stop hit on signal side")
print(signal["status"], signal["cancel_reason"])const signal = await mq.cancel('sig_9f2c4e1a7b3d5f60a1b2c3d4', 'stop hit on signal side')
console.log(signal.status, signal.cancel_reason){"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"}
]
}}