Skip to content

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/actions

List 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
401auth.session_expired: session expired, sign in again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
500internal: something went wrong
ts
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/actions

Create 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_atstring
UTC time, RFC 3339.
enabledboolean
idinteger
kindActionKind
ActionKind 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_name
send_mail disable_account run_report
namestring
paramsany
a JSON object; shape depends on kind Any JSON value.
updated_atstring
UTC time, RFC 3339.
versioninteger
Returns
Promise<Action>
The answer's data.
Errors
400invalid_input: invalid input
401auth.session_expired: session expired, sign in again
403auth.csrf_invalid: request refused: reload the page and try again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
409conflict: already exists
500internal: something went wrong
ts
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 · pathrequired
Action id.
Returns
Promise<Action>
The answer's data.
Errors
400invalid_input: invalid input
401auth.session_expired: session expired, sign in again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
404not_found: not found
500internal: something went wrong
ts
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 · pathrequired
Action id.
Request body
created_atstring
UTC time, RFC 3339.
enabledboolean
idinteger
kindActionKind
ActionKind 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_name
send_mail disable_account run_report
namestring
paramsany
a JSON object; shape depends on kind Any JSON value.
updated_atstring
UTC time, RFC 3339.
versioninteger
Returns
Promise<Action>
The answer's data.
Errors
400invalid_input: invalid input
401auth.session_expired: session expired, sign in again
403auth.csrf_invalid: request refused: reload the page and try again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
404not_found: not found
409conflict: already exists
500internal: something went wrong
ts
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 · pathrequired
Action id.
Returns
Promise<null>
The answer's data.
Errors
400invalid_input: invalid input
401auth.session_expired: session expired, sign in again
403auth.csrf_invalid: request refused: reload the page and try again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
404not_found: not found
500internal: something went wrong
ts
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/triggers

List 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
401auth.session_expired: session expired, sign in again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
500internal: something went wrong
ts
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/triggers

Create 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
conditionsany
a JSON object; shape depends on kind Any JSON value.
created_atstring
UTC time, RFC 3339.
enabledboolean
idinteger
kindTriggerKind
TriggerKind 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_time
namestring
updated_atstring
UTC time, RFC 3339.
versioninteger
Returns
Promise<Trigger>
The answer's data.
Errors
400invalid_input: invalid input
401auth.session_expired: session expired, sign in again
403auth.csrf_invalid: request refused: reload the page and try again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
409conflict: already exists
500internal: something went wrong
ts
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 · pathrequired
Trigger id.
Returns
Promise<Trigger>
The answer's data.
Errors
400invalid_input: invalid input
401auth.session_expired: session expired, sign in again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
404not_found: not found
500internal: something went wrong
ts
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 · pathrequired
Trigger id.
Request body
conditionsany
a JSON object; shape depends on kind Any JSON value.
created_atstring
UTC time, RFC 3339.
enabledboolean
idinteger
kindTriggerKind
TriggerKind 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_time
namestring
updated_atstring
UTC time, RFC 3339.
versioninteger
Returns
Promise<Trigger>
The answer's data.
Errors
400invalid_input: invalid input
401auth.session_expired: session expired, sign in again
403auth.csrf_invalid: request refused: reload the page and try again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
404not_found: not found
409conflict: already exists
500internal: something went wrong
ts
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 · pathrequired
Trigger id.
Returns
Promise<null>
The answer's data.
Errors
400invalid_input: invalid input
401auth.session_expired: session expired, sign in again
403auth.csrf_invalid: request refused: reload the page and try again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
404not_found: not found
500internal: something went wrong
ts
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>