Appearance
staff.routing
11 methods on staff.routing. Each returns the answer's data and throws NoviqaError on a failed answer.
list
GET
/admin/v1/routingList routing rules
Every rule, disabled ones included, by position (the routing service walks them in this order and the first matching rule that decides ends the walk; delay and clear_stops change the request and let the walk go on). Not paged.
More details
Rights: the staff member needs every one of: config.routing.
Returns
Promise<RouteRule[]>The answer's
data.Errors
401
auth.session_expired: session expired, sign in again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.routing.list()bash
curl -X GET "$NOVIQA_API_URL/admin/v1/routing" \
-H "Authorization: Bearer $NOVIQA_TOKEN"json
{
"success": true,
"code": "ok",
"message": "done",
"data": [
{
"action": "confirm_request_price",
"action_value": "string",
"conditions": [
{}
],
"created_at": "2026-09-25T10:15:00Z",
"dealers": [
1
],
"enabled": true,
"id": 1,
"name": "Ann Smith",
"order_kinds": [
"market"
],
"position": 1,
"request_kinds": [
"open"
],
"skip_no_dealer": true
}
],
"request_id": "5b7f2c1e"
}ts
staff.routing.list(options?: RequestOptions): Promise<settings.RouteRule[]>create
POST
/admin/v1/routingCreate a routing rule
Adds a rule at position (1-based; the rules at and below it move down one), or last when position is left out or 0. Starts enabled. Required: name (1-64 characters, unique) and action. request_kinds and order_kinds empty = every request and order. action_value: the reject text (up to 31 characters) for reject, 1-60000 milliseconds for delay, empty for every other action. dealers (positive, each once) is required for the dealer and gateway actions and refused for the others; skip_no_dealer only for dealer and online_dealers. Each condition is field op value: numeric fields (login, volume, hour, weekday, deviation_pts) take eq, ne, gt, ge, lt or le and a number; text fields (group, symbol, side, kind, comment) take eq (fits the mask list) or ne and comma-separated masks like real\*, !real\vip*. Unknown fields are refused. Answers the stored rule. Routing rules are platform-wide (no group scope). Every change writes a config line to the journal and raises the configuration version, so the routing service applies the new table at once.
More details
Rights: the staff member needs every one of: config.routing.
Request body
actionRouteActionRouteAction is what a routing rule decided. -
confirm_request_price: fill at the client's price - confirm_market_price: fill at the current price - dealer: wait for an answer from the rule's dealers, in order - online_dealers: wait for an answer from any online dealer - gateway: send to a liquidity provider (A-book)confirm_request_price confirm_market_price reject requote dealer online_dealers gatewayaction_valuestringreject: text; delay: milliseconds
conditionsRouteCondition_input[]created_atstringUTC time, RFC 3339.
dealersinteger[]dealer logins or gateway ids, in order
enabledbooleanidintegernamestringorder_kindsOrderKind[]empty = every order
positionintegerrequest_kindsTradeAction[]empty = every request
skip_no_dealerbooleandealer actions: walk on when no dealer is online
updated_atstringUTC time, RFC 3339.
versionintegerReturns
Promise<RouteRule>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.csrf_invalid: request refused: reload the page and try again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action409
conflict: already exists500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.routing.create({
action: "dealer",
action_value: "",
conditions: [
{
field: "group",
op: "eq",
value: "real\\vip*"
},
{
field: "volume",
op: "ge",
value: "5"
}
],
dealers: [
1001,
1002
],
enabled: true,
name: "VIP to dealers",
order_kinds: [],
position: 1,
request_kinds: [
"open",
"close"
],
skip_no_dealer: true
})bash
curl -X POST "$NOVIQA_API_URL/admin/v1/routing" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"action": "dealer",
"action_value": "",
"conditions": [
{
"field": "group",
"op": "eq",
"value": "real\\vip*"
},
{
"field": "volume",
"op": "ge",
"value": "5"
}
],
"dealers": [
1001,
1002
],
"enabled": true,
"name": "VIP to dealers",
"order_kinds": [],
"position": 1,
"request_kinds": [
"open",
"close"
],
"skip_no_dealer": true
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"action": "confirm_request_price",
"action_value": "string",
"conditions": [
{
"field": "string",
"op": "string",
"value": "string"
}
],
"created_at": "2026-09-25T10:15:00Z",
"dealers": [
1
],
"enabled": true,
"id": 1,
"name": "Ann Smith",
"order_kinds": [
"market"
],
"position": 1,
"request_kinds": [
"open"
],
"skip_no_dealer": true
},
"request_id": "5b7f2c1e"
}ts
staff.routing.create(body: settings.RouteRule, options?: RequestOptions): Promise<settings.RouteRule>updateOrder
PUT
/admin/v1/routing/orderReorder routing rules
Puts the rules at positions 1, 2, ... in the order of ids, which must list every rule exactly once. Every moved rule's version rises, so an editor holding the old order reloads. Answers the whole list in its new order. Routing rules are platform-wide (no group scope). Every change writes a config line to the journal and raises the configuration version, so the routing service applies the new table at once.
More details
Rights: the staff member needs every one of: config.routing.
Request body
idsinteger[]Returns
Promise<RouteRule[]>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.csrf_invalid: request refused: reload the page and try again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.routing.updateOrder({
ids: [
4,
1,
2,
3
]
})bash
curl -X PUT "$NOVIQA_API_URL/admin/v1/routing/order" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"ids": [
4,
1,
2,
3
]
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": [
{
"action": "confirm_request_price",
"action_value": "string",
"conditions": [
{}
],
"created_at": "2026-09-25T10:15:00Z",
"dealers": [
1
],
"enabled": true,
"id": 1,
"name": "Ann Smith",
"order_kinds": [
"market"
],
"position": 1,
"request_kinds": [
"open"
],
"skip_no_dealer": true
}
],
"request_id": "5b7f2c1e"
}ts
staff.routing.updateOrder(body: http.orderBody, options?: RequestOptions): Promise<settings.RouteRule[]>retrieve
GET
/admin/v1/routing/{id}Get a routing rule
One rule with its conditions and dealers.
More details
Rights: the staff member needs every one of: config.routing.
Parameters
idinteger · pathrequiredNumeric id.
Returns
Promise<RouteRule>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action404
not_found: not found500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.routing.retrieve(1)bash
curl -X GET "$NOVIQA_API_URL/admin/v1/routing/1" \
-H "Authorization: Bearer $NOVIQA_TOKEN"json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"action": "confirm_request_price",
"action_value": "string",
"conditions": [
{
"field": "string",
"op": "string",
"value": "string"
}
],
"created_at": "2026-09-25T10:15:00Z",
"dealers": [
1
],
"enabled": true,
"id": 1,
"name": "Ann Smith",
"order_kinds": [
"market"
],
"position": 1,
"request_kinds": [
"open"
],
"skip_no_dealer": true
},
"request_id": "5b7f2c1e"
}ts
staff.routing.retrieve(id: number, options?: RequestOptions): Promise<settings.RouteRule>update
PATCH
/admin/v1/routing/{id}Change a routing rule
Send version (the one you last read) and the fields to change; id, position, created_at and updated_at cannot be sent (move a rule with its move route). conditions, dealers and the kind lists replace the whole list. The create rules apply to the result. Disabling the last enabled rule that can decide (any action but delay and clear_stops) is refused. A change that changes nothing answers the rule as it is. Answers the saved rule with its new version. Routing rules are platform-wide (no group scope). Every change writes a config line to the journal and raises the configuration version, so the routing service applies the new table at once.
More details
Rights: the staff member needs every one of: config.routing.
Parameters
idinteger · pathrequiredNumeric id.
Request body
actionRouteActionRouteAction is what a routing rule decided. -
confirm_request_price: fill at the client's price - confirm_market_price: fill at the current price - dealer: wait for an answer from the rule's dealers, in order - online_dealers: wait for an answer from any online dealer - gateway: send to a liquidity provider (A-book)confirm_request_price confirm_market_price reject requote dealer online_dealers gatewayaction_valuestringreject: text; delay: milliseconds
conditionsRouteCondition_input[]created_atstringUTC time, RFC 3339.
dealersinteger[]dealer logins or gateway ids, in order
enabledbooleanidintegernamestringorder_kindsOrderKind[]empty = every order
positionintegerrequest_kindsTradeAction[]empty = every request
skip_no_dealerbooleandealer actions: walk on when no dealer is online
updated_atstringUTC time, RFC 3339.
versionintegerReturns
Promise<RouteRule>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.csrf_invalid: request refused: reload the page and try again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action404
not_found: not found409
conflict: already exists500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.routing.update(1, {
enabled: false,
version: 4
})bash
curl -X PATCH "$NOVIQA_API_URL/admin/v1/routing/1" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"enabled": false,
"version": 4
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"action": "confirm_request_price",
"action_value": "string",
"conditions": [
{
"field": "string",
"op": "string",
"value": "string"
}
],
"created_at": "2026-09-25T10:15:00Z",
"dealers": [
1
],
"enabled": true,
"id": 1,
"name": "Ann Smith",
"order_kinds": [
"market"
],
"position": 1,
"request_kinds": [
"open"
],
"skip_no_dealer": true
},
"request_id": "5b7f2c1e"
}ts
staff.routing.update(id: number, body: settings.RouteRule, options?: RequestOptions): Promise<settings.RouteRule>delete
DELETE
/admin/v1/routing/{id}Delete a routing rule
Removes the rule with its conditions and dealers. The last enabled rule that can decide cannot be deleted (invalid_input): add another first. Routing rules are platform-wide (no group scope). Every change writes a config line to the journal and raises the configuration version, so the routing service applies the new table at once.
More details
Rights: the staff member needs every one of: config.routing.
Parameters
idinteger · pathrequiredNumeric id.
Returns
Promise<null>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.csrf_invalid: request refused: reload the page and try again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action404
not_found: not found500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.routing.delete(1)bash
curl -X DELETE "$NOVIQA_API_URL/admin/v1/routing/1" \
-H "Authorization: Bearer $NOVIQA_TOKEN"json
{
"success": true,
"code": "ok",
"message": "done",
"data": null,
"request_id": "5b7f2c1e"
}ts
staff.routing.delete(id: number, options?: RequestOptions): Promise<null>listDealers
GET
/admin/v1/routing/{id}/dealersList a rule's dealers
The rule's dealer logins (or gateway ids for a gateway rule) in the order requests are offered, with the rule's version to send with a change.
More details
Rights: the staff member needs every one of: config.routing.
Parameters
idinteger · pathrequiredNumeric id.
Returns
Promise<docRoutingDealers>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action404
not_found: not found500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.routing.listDealers(1)bash
curl -X GET "$NOVIQA_API_URL/admin/v1/routing/1/dealers" \
-H "Authorization: Bearer $NOVIQA_TOKEN"json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"dealers": [
1
],
"version": 1
},
"request_id": "5b7f2c1e"
}ts
staff.routing.listDealers(id: number, options?: RequestOptions): Promise<http.docRoutingDealers>createDealers
POST
/admin/v1/routing/{id}/dealersAdd a dealer to a rule
Adds login (a dealer login, or a gateway id for a gateway rule; positive and not in the list yet) at the 1-based position, or last when position is 0 or past the end. version must be the rule's version you last read. The change is saved as a change of the rule's dealers, with the same checks (a dealer or gateway rule keeps at least one entry); the rule's version rises. Answers the whole rule. Routing rules are platform-wide (no group scope). Every change writes a config line to the journal and raises the configuration version, so the routing service applies the new table at once.
More details
Rights: the staff member needs every one of: config.routing.
Parameters
idinteger · pathrequiredNumeric id.
Request body
loginintegeradding: the dealer login (or gateway id for a gateway rule)
positioninteger1-based place; adding: 0 = last
versionintegerReturns
Promise<RouteRule>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.csrf_invalid: request refused: reload the page and try again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action404
not_found: not found409
conflict: already exists500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.routing.createDealers(1, {
login: 1003,
position: 0,
version: 4
})bash
curl -X POST "$NOVIQA_API_URL/admin/v1/routing/1/dealers" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"login": 1003,
"position": 0,
"version": 4
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"action": "confirm_request_price",
"action_value": "string",
"conditions": [
{
"field": "string",
"op": "string",
"value": "string"
}
],
"created_at": "2026-09-25T10:15:00Z",
"dealers": [
1
],
"enabled": true,
"id": 1,
"name": "Ann Smith",
"order_kinds": [
"market"
],
"position": 1,
"request_kinds": [
"open"
],
"skip_no_dealer": true
},
"request_id": "5b7f2c1e"
}ts
staff.routing.createDealers(id: number, body: http.dealerBody, options?: RequestOptions): Promise<settings.RouteRule>deleteDealers
DELETE
/admin/v1/routing/{id}/dealers/{login}Remove a dealer from a rule
Removes the dealer (or gateway) from the rule's list; not_found when it is not in the list. The change is saved as a change of the rule's dealers, with the same checks (a dealer or gateway rule keeps at least one entry); the rule's version rises. Answers the whole rule. Routing rules are platform-wide (no group scope). Every change writes a config line to the journal and raises the configuration version, so the routing service applies the new table at once.
More details
Rights: the staff member needs every one of: config.routing.
Parameters
idinteger · pathrequiredNumeric id.
logininteger · pathrequiredDealer login, or gateway id for a gateway rule.
versioninteger · queryrequiredThe rule's version you last read.
Returns
Promise<RouteRule>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.csrf_invalid: request refused: reload the page and try again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action404
not_found: not found409
conflict: already exists500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.routing.deleteDealers(1, 1001, {
version: 1
})bash
curl -X DELETE "$NOVIQA_API_URL/admin/v1/routing/1/dealers/1001?version=1" \
-H "Authorization: Bearer $NOVIQA_TOKEN"json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"action": "confirm_request_price",
"action_value": "string",
"conditions": [
{
"field": "string",
"op": "string",
"value": "string"
}
],
"created_at": "2026-09-25T10:15:00Z",
"dealers": [
1
],
"enabled": true,
"id": 1,
"name": "Ann Smith",
"order_kinds": [
"market"
],
"position": 1,
"request_kinds": [
"open"
],
"skip_no_dealer": true
},
"request_id": "5b7f2c1e"
}ts
staff.routing.deleteDealers(id: number, login: number, query: { version }, options?: RequestOptions): Promise<settings.RouteRule>updateDealersMove
PUT
/admin/v1/routing/{id}/dealers/{login}/moveMove a dealer within a rule
Moves the dealer (or gateway) to the 1-based position (1 to the list length) in the rule's list; login in the body is ignored. version must be the rule's version you last read; not_found when the dealer is not in the list. The change is saved as a change of the rule's dealers, with the same checks (a dealer or gateway rule keeps at least one entry); the rule's version rises. Answers the whole rule. Routing rules are platform-wide (no group scope). Every change writes a config line to the journal and raises the configuration version, so the routing service applies the new table at once.
More details
Rights: the staff member needs every one of: config.routing.
Parameters
idinteger · pathrequiredNumeric id.
logininteger · pathrequiredDealer login, or gateway id for a gateway rule.
Request body
loginintegeradding: the dealer login (or gateway id for a gateway rule)
positioninteger1-based place; adding: 0 = last
versionintegerReturns
Promise<RouteRule>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.csrf_invalid: request refused: reload the page and try again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action404
not_found: not found409
conflict: already exists500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.routing.updateDealersMove(1, 1001, {
position: 1,
version: 5
})bash
curl -X PUT "$NOVIQA_API_URL/admin/v1/routing/1/dealers/1001/move" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"position": 1,
"version": 5
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"action": "confirm_request_price",
"action_value": "string",
"conditions": [
{
"field": "string",
"op": "string",
"value": "string"
}
],
"created_at": "2026-09-25T10:15:00Z",
"dealers": [
1
],
"enabled": true,
"id": 1,
"name": "Ann Smith",
"order_kinds": [
"market"
],
"position": 1,
"request_kinds": [
"open"
],
"skip_no_dealer": true
},
"request_id": "5b7f2c1e"
}ts
staff.routing.updateDealersMove(id: number, login: number, body: http.dealerBody, options?: RequestOptions): Promise<settings.RouteRule>move
POST
/admin/v1/routing/{id}/moveMove a routing rule
Puts the rule at the 1-based position, shifting the rules in between by one. version must be the rule's version you last read; the rule's version rises. Answers the moved rule. Routing rules are platform-wide (no group scope). Every change writes a config line to the journal and raises the configuration version, so the routing service applies the new table at once.
More details
Rights: the staff member needs every one of: config.routing.
Parameters
idinteger · pathrequiredNumeric id.
Request body
positionintegerthe 1-based place to put the rule at
versionintegerthe rule's version you last read
Returns
Promise<RouteRule>The answer's
data.Errors
400
invalid_input: invalid input401
auth.session_expired: session expired, sign in again403
auth.csrf_invalid: request refused: reload the page and try again403
auth.invalid_terminal: this terminal cannot be used here403
auth.otp_enrol_required: your group requires one-time codes: set them up to continue403
auth.password_change_required: you must change your password first403
forbidden: you do not have access to this action404
not_found: not found409
conflict: already exists500
internal: something went wrongts
import { staff } from "@/lib/noviqa"
const data = await staff.routing.move(1, {
position: 2,
version: 4
})bash
curl -X POST "$NOVIQA_API_URL/admin/v1/routing/1/move" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"position": 2,
"version": 4
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"action": "confirm_request_price",
"action_value": "string",
"conditions": [
{
"field": "string",
"op": "string",
"value": "string"
}
],
"created_at": "2026-09-25T10:15:00Z",
"dealers": [
1
],
"enabled": true,
"id": 1,
"name": "Ann Smith",
"order_kinds": [
"market"
],
"position": 1,
"request_kinds": [
"open"
],
"skip_no_dealer": true
},
"request_id": "5b7f2c1e"
}ts
staff.routing.move(id: number, body: http.docRoutingMove, options?: RequestOptions): Promise<settings.RouteRule>