Skip to content

staff.me ​

3 methods on staff.me. Each returns the answer's data and throws NoviqaError on a failed answer.

preferences ​

GET/admin/v1/me/preferences

Get the own desk

The signed-in staff member's desk document (columns, layouts, panels, options), kept on the server so every device shows the same. The content is the terminal's own JSON object. Never saved: content {} and version 0.

Returns
Promise<Settings>
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
500internal: something went wrong
ts
import { staff } from "@/lib/noviqa"

const data = await staff.me.preferences()
bash
curl -X GET "$NOVIQA_API_URL/admin/v1/me/preferences" \
  -H "Authorization: Bearer $NOVIQA_TOKEN"
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "content": null,
    "updated_at": "2026-09-25T10:15:00Z",
    "version": 1
  },
  "request_id": "5b7f2c1e"
}
ts
staff.me.preferences(options?: RequestOptions): Promise<chart.Settings>

updatePreferences ​

PUT/admin/v1/me/preferences

Save the own desk

Replaces the desk document. content must be a JSON object of at most 256 KiB. expected_version is the version you last read: when the stored one differs the save is refused (conflict); 0 overwrites whatever is stored. Answers the saved document with its new version.

Request body
contentany
Any JSON value.
expected_versioninteger
Returns
Promise<Settings>
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
409conflict: already exists
500internal: something went wrong
ts
import { staff } from "@/lib/noviqa"

const data = await staff.me.updatePreferences({
  content: {
    columns: {
      accounts: [
        "login",
        "name",
        "balance"
      ]
    }
  },
  expected_version: 3
})
bash
curl -X PUT "$NOVIQA_API_URL/admin/v1/me/preferences" \
  -H "Authorization: Bearer $NOVIQA_TOKEN" \
  -H "Content-Type: application/json" \
  --data-raw '{
  "content": {
    "columns": {
      "accounts": [
        "login",
        "name",
        "balance"
      ]
    }
  },
  "expected_version": 3
}'
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "content": null,
    "updated_at": "2026-09-25T10:15:00Z",
    "version": 1
  },
  "request_id": "5b7f2c1e"
}
ts
staff.me.updatePreferences(body: chart.Body, options?: RequestOptions): Promise<chart.Settings>

patchPreferences ​

PATCH/admin/v1/me/preferences

Change part of the own desk

Merges the top-level keys of content into the stored desk document: a key with value null is removed, every other key is replaced whole, keys you leave out stay. expected_version as for the full save (0 merges into whatever is stored). The merged document must stay within 256 KiB. Answers the saved document with its new version.

Request body
contentany
Any JSON value.
expected_versioninteger
Returns
Promise<Settings>
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
409conflict: already exists
500internal: something went wrong
ts
import { staff } from "@/lib/noviqa"

const data = await staff.me.patchPreferences({
  content: {
    old_layout: null,
    panels: {
      journal: true
    }
  },
  expected_version: 0
})
bash
curl -X PATCH "$NOVIQA_API_URL/admin/v1/me/preferences" \
  -H "Authorization: Bearer $NOVIQA_TOKEN" \
  -H "Content-Type: application/json" \
  --data-raw '{
  "content": {
    "old_layout": null,
    "panels": {
      "journal": true
    }
  },
  "expected_version": 0
}'
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "content": null,
    "updated_at": "2026-09-25T10:15:00Z",
    "version": 1
  },
  "request_id": "5b7f2c1e"
}
ts
staff.me.patchPreferences(body: chart.Body, options?: RequestOptions): Promise<chart.Settings>