Appearance
staff.automation
10 methods on staff.automation. Each returns the answer's data and throws NoviqaError on a failed answer.
listActions
GET
/admin/v1/automation/actionsList automation actions
Every action, by name. Same MVP scope as triggers: stored and shape-validated, not yet runnable.
More details
Rights: the staff member needs every one of: config.automation.
Returns
Promise<Action[]>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.automation.listActions()bash
curl -X GET "$NOVIQA_API_URL/admin/v1/automation/actions" \
-H "Authorization: Bearer $NOVIQA_TOKEN"json
{
"success": true,
"code": "ok",
"message": "done",
"data": [
{
"created_at": "2026-09-25T10:15:00Z",
"enabled": true,
"id": 1,
"kind": "send_mail",
"name": "Ann Smith",
"params": null,
"updated_at": "2026-09-25T10:15:00Z",
"version": 1
}
],
"request_id": "5b7f2c1e"
}ts
staff.automation.listActions(options?: RequestOptions): Promise<models.Action[]>createActions
POST
/admin/v1/automation/actionsCreate an action
Adds an action. name 1-128 characters, unique (case-insensitive). kind one of send_mail, disable_account, run_report. params a JSON object, at most 8 KiB (shape only, like a trigger's conditions); left out becomes {}. enabled left out defaults true. Automation is platform-wide (no group scope). Writes a config line to the journal and tells staff sockets its list changed.
More details
Rights: the staff member needs every one of: config.automation.
Request body
created_atstringUTC time, RFC 3339.
enabledbooleanidintegerkindActionKindActionKind is what an automation action does when a trigger fires it. -
send_mail: params: to, subject, body - disable_account: params: login - run_report: params: report_namesend_mail disable_account run_reportnamestringparamsanya JSON object; shape depends on kind Any JSON value.
updated_atstringUTC time, RFC 3339.
versionintegerReturns
Promise<Action>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.automation.createActions({
kind: "send_mail",
name: "Notify risk desk",
params: {
body: "",
subject: "Margin call level reached",
to: "risk@example.com"
}
})bash
curl -X POST "$NOVIQA_API_URL/admin/v1/automation/actions" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"kind": "send_mail",
"name": "Notify risk desk",
"params": {
"body": "",
"subject": "Margin call level reached",
"to": "risk@example.com"
}
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"created_at": "2026-09-25T10:15:00Z",
"enabled": true,
"id": 1,
"kind": "send_mail",
"name": "Ann Smith",
"params": null,
"updated_at": "2026-09-25T10:15:00Z",
"version": 1
},
"request_id": "5b7f2c1e"
}ts
staff.automation.createActions(body: models.Action, options?: RequestOptions): Promise<models.Action>retrieveActions
GET
/admin/v1/automation/actions/{id}Get an action
Rights: the staff member needs every one of: config.automation.
Parameters
idinteger · pathrequiredAction id.
Returns
Promise<Action>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.automation.retrieveActions(1)bash
curl -X GET "$NOVIQA_API_URL/admin/v1/automation/actions/1" \
-H "Authorization: Bearer $NOVIQA_TOKEN"json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"created_at": "2026-09-25T10:15:00Z",
"enabled": true,
"id": 1,
"kind": "send_mail",
"name": "Ann Smith",
"params": null,
"updated_at": "2026-09-25T10:15:00Z",
"version": 1
},
"request_id": "5b7f2c1e"
}ts
staff.automation.retrieveActions(id: number, options?: RequestOptions): Promise<models.Action>updateActions
PATCH
/admin/v1/automation/actions/{id}Change an action
Same rules as changing a trigger: version required, id fixed, enabled switches it on or off. Automation is platform-wide (no group scope). Writes a config line to the journal and tells staff sockets its list changed.
More details
Rights: the staff member needs every one of: config.automation.
Parameters
idinteger · pathrequiredAction id.
Request body
created_atstringUTC time, RFC 3339.
enabledbooleanidintegerkindActionKindActionKind is what an automation action does when a trigger fires it. -
send_mail: params: to, subject, body - disable_account: params: login - run_report: params: report_namesend_mail disable_account run_reportnamestringparamsanya JSON object; shape depends on kind Any JSON value.
updated_atstringUTC time, RFC 3339.
versionintegerReturns
Promise<Action>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.automation.updateActions(1, {
enabled: false,
version: 1
})bash
curl -X PATCH "$NOVIQA_API_URL/admin/v1/automation/actions/1" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"enabled": false,
"version": 1
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"created_at": "2026-09-25T10:15:00Z",
"enabled": true,
"id": 1,
"kind": "send_mail",
"name": "Ann Smith",
"params": null,
"updated_at": "2026-09-25T10:15:00Z",
"version": 1
},
"request_id": "5b7f2c1e"
}ts
staff.automation.updateActions(id: number, body: models.Action, options?: RequestOptions): Promise<models.Action>deleteActions
DELETE
/admin/v1/automation/actions/{id}Delete an action
Removes the action. Automation is platform-wide (no group scope). Writes a config line to the journal and tells staff sockets its list changed.
More details
Rights: the staff member needs every one of: config.automation.
Parameters
idinteger · pathrequiredAction 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.automation.deleteActions(1)bash
curl -X DELETE "$NOVIQA_API_URL/admin/v1/automation/actions/1" \
-H "Authorization: Bearer $NOVIQA_TOKEN"json
{
"success": true,
"code": "ok",
"message": "done",
"data": null,
"request_id": "5b7f2c1e"
}ts
staff.automation.deleteActions(id: number, options?: RequestOptions): Promise<null>listTriggers
GET
/admin/v1/automation/triggersList automation triggers
Every trigger, by name. MVP module: a trigger is stored and its shape validated; wiring it to the actions it fires is a later phase.
More details
Rights: the staff member needs every one of: config.automation.
Returns
Promise<Trigger[]>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.automation.listTriggers()bash
curl -X GET "$NOVIQA_API_URL/admin/v1/automation/triggers" \
-H "Authorization: Bearer $NOVIQA_TOKEN"json
{
"success": true,
"code": "ok",
"message": "done",
"data": [
{
"conditions": null,
"created_at": "2026-09-25T10:15:00Z",
"enabled": true,
"id": 1,
"kind": "symbol_price_crosses",
"name": "Ann Smith",
"updated_at": "2026-09-25T10:15:00Z",
"version": 1
}
],
"request_id": "5b7f2c1e"
}ts
staff.automation.listTriggers(options?: RequestOptions): Promise<models.Trigger[]>createTriggers
POST
/admin/v1/automation/triggersCreate a trigger
Adds a trigger. name 1-128 characters, no leading/trailing spaces, unique (case-insensitive). kind one of symbol_price_crosses, margin_call_level_reached, scheduled_time. conditions a JSON object, at most 8 KiB (its per-kind fields are not yet checked, only that it is an object); left out becomes {}. enabled left out defaults true. id and version are ignored. Automation is platform-wide (no group scope). Writes a config line to the journal and tells staff sockets its list changed.
More details
Rights: the staff member needs every one of: config.automation.
Request body
conditionsanya JSON object; shape depends on kind Any JSON value.
created_atstringUTC time, RFC 3339.
enabledbooleanidintegerkindTriggerKindTriggerKind is a condition an automation trigger watches for. The MVP covers a few realistic starters; more kinds are added here as the platform needs them. -
symbol_price_crosses: conditions: symbol_id, operator (">"|"<"), price - margin_call_level_reached: conditions: group_path, level_percent - scheduled_time: conditions: at_min (0-1439, server clock)symbol_price_crosses margin_call_level_reached scheduled_timenamestringupdated_atstringUTC time, RFC 3339.
versionintegerReturns
Promise<Trigger>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.automation.createTriggers({
conditions: {
operator: ">",
price: "1.10",
symbol_id: 1
},
kind: "symbol_price_crosses",
name: "EURUSD above 1.10"
})bash
curl -X POST "$NOVIQA_API_URL/admin/v1/automation/triggers" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"conditions": {
"operator": ">",
"price": "1.10",
"symbol_id": 1
},
"kind": "symbol_price_crosses",
"name": "EURUSD above 1.10"
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"conditions": null,
"created_at": "2026-09-25T10:15:00Z",
"enabled": true,
"id": 1,
"kind": "symbol_price_crosses",
"name": "Ann Smith",
"updated_at": "2026-09-25T10:15:00Z",
"version": 1
},
"request_id": "5b7f2c1e"
}ts
staff.automation.createTriggers(body: models.Trigger, options?: RequestOptions): Promise<models.Trigger>retrieveTriggers
GET
/admin/v1/automation/triggers/{id}Get a trigger
Rights: the staff member needs every one of: config.automation.
Parameters
idinteger · pathrequiredTrigger id.
Returns
Promise<Trigger>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.automation.retrieveTriggers(1)bash
curl -X GET "$NOVIQA_API_URL/admin/v1/automation/triggers/1" \
-H "Authorization: Bearer $NOVIQA_TOKEN"json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"conditions": null,
"created_at": "2026-09-25T10:15:00Z",
"enabled": true,
"id": 1,
"kind": "symbol_price_crosses",
"name": "Ann Smith",
"updated_at": "2026-09-25T10:15:00Z",
"version": 1
},
"request_id": "5b7f2c1e"
}ts
staff.automation.retrieveTriggers(id: number, options?: RequestOptions): Promise<models.Trigger>updateTriggers
PATCH
/admin/v1/automation/triggers/{id}Change a trigger
Send version (the one you last read) and the fields to change; id cannot be sent. enabled is a normal field: this is also how a trigger is switched on or off. The create rules apply to the result. A change that changes nothing answers the trigger as it is. Automation is platform-wide (no group scope). Writes a config line to the journal and tells staff sockets its list changed.
More details
Rights: the staff member needs every one of: config.automation.
Parameters
idinteger · pathrequiredTrigger id.
Request body
conditionsanya JSON object; shape depends on kind Any JSON value.
created_atstringUTC time, RFC 3339.
enabledbooleanidintegerkindTriggerKindTriggerKind is a condition an automation trigger watches for. The MVP covers a few realistic starters; more kinds are added here as the platform needs them. -
symbol_price_crosses: conditions: symbol_id, operator (">"|"<"), price - margin_call_level_reached: conditions: group_path, level_percent - scheduled_time: conditions: at_min (0-1439, server clock)symbol_price_crosses margin_call_level_reached scheduled_timenamestringupdated_atstringUTC time, RFC 3339.
versionintegerReturns
Promise<Trigger>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.automation.updateTriggers(1, {
enabled: false,
version: 1
})bash
curl -X PATCH "$NOVIQA_API_URL/admin/v1/automation/triggers/1" \
-H "Authorization: Bearer $NOVIQA_TOKEN" \
-H "Content-Type: application/json" \
--data-raw '{
"enabled": false,
"version": 1
}'json
{
"success": true,
"code": "ok",
"message": "done",
"data": {
"conditions": null,
"created_at": "2026-09-25T10:15:00Z",
"enabled": true,
"id": 1,
"kind": "symbol_price_crosses",
"name": "Ann Smith",
"updated_at": "2026-09-25T10:15:00Z",
"version": 1
},
"request_id": "5b7f2c1e"
}ts
staff.automation.updateTriggers(id: number, body: models.Trigger, options?: RequestOptions): Promise<models.Trigger>deleteTriggers
DELETE
/admin/v1/automation/triggers/{id}Delete a trigger
Removes the trigger. Automation is platform-wide (no group scope). Writes a config line to the journal and tells staff sockets its list changed.
More details
Rights: the staff member needs every one of: config.automation.
Parameters
idinteger · pathrequiredTrigger 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.automation.deleteTriggers(1)bash
curl -X DELETE "$NOVIQA_API_URL/admin/v1/automation/triggers/1" \
-H "Authorization: Bearer $NOVIQA_TOKEN"json
{
"success": true,
"code": "ok",
"message": "done",
"data": null,
"request_id": "5b7f2c1e"
}ts
staff.automation.deleteTriggers(id: number, options?: RequestOptions): Promise<null>