Skip to content

staff.holidays ​

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

list ​

GET/admin/v1/holidays

List holidays

Holidays in the order staff keep them (position, then id). Not paged. year keeps that year's holidays plus the every-year ones (year 0); month (1-12) keeps that month; 0 or left out = any.

More details

Rights: the staff member needs every one of: config.holidays.

Parameters
yearinteger · query
monthinteger · query
Returns
Promise<Holiday[]>
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
500internal: something went wrong
ts
import { staff } from "@/lib/noviqa"

const data = await staff.holidays.list({
  year: 1,
  month: 1
})
bash
curl -X GET "$NOVIQA_API_URL/admin/v1/holidays?year=1&month=1" \
  -H "Authorization: Bearer $NOVIQA_TOKEN"
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": [
    {
      "day": 1,
      "description": "string",
      "enabled": true,
      "from_min": 1,
      "id": 1,
      "month": 1,
      "position": 1,
      "symbols": [
        "string"
      ],
      "to_min": 1,
      "version": 1,
      "year": 1
    }
  ],
  "request_id": "5b7f2c1e"
}
ts
staff.holidays.list(query?: { year?, month? }, options?: RequestOptions): Promise<models.Holiday[]>

create ​

POST/admin/v1/holidays

Create a holiday

Adds a holiday at the end of the list. Left-out fields default to enabled for the whole day (from_min 0, to_min 1440). Required: month and day forming a real date (year 0 = every year, which may fall on 29 February; else 1970-9999). from_min and to_min 0-1440 minutes of the day on the server clock, to_min not before from_min; description up to 128 characters; symbols masks like Forex*, EURUSD or !Forex\USDTRY. id and version are ignored. Unknown fields are refused. The calendar is platform-wide (no group scope). Every change writes a config line to the journal and raises the configuration version, so the trading services pick it up at once.

More details

Rights: the staff member needs every one of: config.holidays.

Request body
dayinteger
descriptionstring
enabledboolean
from_mininteger
minutes of the day, server time
idinteger
monthinteger
positioninteger
the order staff keep the list in; changed only by a reorder
symbolsstring[]
masks; ! excludes
to_mininteger
versioninteger
yearinteger
0 = every year
Returns
Promise<Holiday>
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
500internal: something went wrong
ts
import { staff } from "@/lib/noviqa"

const data = await staff.holidays.create({
  day: 25,
  description: "Christmas",
  enabled: true,
  from_min: 0,
  month: 12,
  symbols: [
    "Forex\\*",
    "Metals\\*"
  ],
  to_min: 1440,
  year: 0
})
bash
curl -X POST "$NOVIQA_API_URL/admin/v1/holidays" \
  -H "Authorization: Bearer $NOVIQA_TOKEN" \
  -H "Content-Type: application/json" \
  --data-raw '{
  "day": 25,
  "description": "Christmas",
  "enabled": true,
  "from_min": 0,
  "month": 12,
  "symbols": [
    "Forex\\*",
    "Metals\\*"
  ],
  "to_min": 1440,
  "year": 0
}'
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "day": 1,
    "description": "string",
    "enabled": true,
    "from_min": 1,
    "id": 1,
    "month": 1,
    "position": 1,
    "symbols": [
      "string"
    ],
    "to_min": 1,
    "version": 1,
    "year": 1
  },
  "request_id": "5b7f2c1e"
}
ts
staff.holidays.create(body: models.Holiday, options?: RequestOptions): Promise<models.Holiday>

check ​

GET/admin/v1/holidays/check

Check whether holidays close a symbol

Lists the enabled holidays that close the symbol on a day: a holiday falls on the day (its year or every year) and one of its masks takes in the symbol's name or path while no ! mask excludes it.

More details

Rights: the staff member needs every one of: config.holidays.

Parameters
symbolstring · queryrequired
Symbol name, e.g. EURUSD (any case).
datestring · query
The day, YYYY-MM-DD on the server clock; default today on the server clock.
Returns
Promise<docSystemHolidayCheck>
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.holidays.check({
  symbol: "string",
  date: "string"
})
bash
curl -X GET "$NOVIQA_API_URL/admin/v1/holidays/check?symbol=string&date=string" \
  -H "Authorization: Bearer $NOVIQA_TOKEN"
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "closed": true,
    "date": "string",
    "holidays": [
      {
        "day": 1,
        "description": "string",
        "enabled": true,
        "from_min": 1,
        "id": 1,
        "month": 1,
        "position": 1,
        "symbols": [
          "string"
        ],
        "to_min": 1,
        "version": 1,
        "year": 1
      }
    ],
    "symbol": "EURUSD"
  },
  "request_id": "5b7f2c1e"
}
ts
staff.holidays.check(query: { symbol, date? }, options?: RequestOptions): Promise<http.docSystemHolidayCheck>

updateOrder ​

PUT/admin/v1/holidays/order

Reorder holidays

Puts the holidays at positions 1, 2, ... in the order of ids, which must list every holiday exactly once. Every moved holiday's version rises. Answers the whole list in its new order. The calendar is platform-wide (no group scope). Every change writes a config line to the journal and raises the configuration version, so the trading services pick it up at once.

More details

Rights: the staff member needs every one of: config.holidays.

Request body
idsinteger[]
Returns
Promise<Holiday[]>
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
500internal: something went wrong
ts
import { staff } from "@/lib/noviqa"

const data = await staff.holidays.updateOrder({
  ids: [
    2,
    1,
    3
  ]
})
bash
curl -X PUT "$NOVIQA_API_URL/admin/v1/holidays/order" \
  -H "Authorization: Bearer $NOVIQA_TOKEN" \
  -H "Content-Type: application/json" \
  --data-raw '{
  "ids": [
    2,
    1,
    3
  ]
}'
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": [
    {
      "day": 1,
      "description": "string",
      "enabled": true,
      "from_min": 1,
      "id": 1,
      "month": 1,
      "position": 1,
      "symbols": [
        "string"
      ],
      "to_min": 1,
      "version": 1,
      "year": 1
    }
  ],
  "request_id": "5b7f2c1e"
}
ts
staff.holidays.updateOrder(body: http.orderBody, options?: RequestOptions): Promise<models.Holiday[]>

retrieve ​

GET/admin/v1/holidays/{id}

Get a holiday

One holiday.

More details

Rights: the staff member needs every one of: config.holidays.

Parameters
idinteger · pathrequired
Numeric id.
Returns
Promise<Holiday>
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.holidays.retrieve(1)
bash
curl -X GET "$NOVIQA_API_URL/admin/v1/holidays/1" \
  -H "Authorization: Bearer $NOVIQA_TOKEN"
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "day": 1,
    "description": "string",
    "enabled": true,
    "from_min": 1,
    "id": 1,
    "month": 1,
    "position": 1,
    "symbols": [
      "string"
    ],
    "to_min": 1,
    "version": 1,
    "year": 1
  },
  "request_id": "5b7f2c1e"
}
ts
staff.holidays.retrieve(id: number, options?: RequestOptions): Promise<models.Holiday>

update ​

PATCH/admin/v1/holidays/{id}

Change a holiday

Send version (the one you last read) and the fields to change; id and position cannot be sent (use the reorder route). symbols replaces the whole list. The create rules apply to the result. A change that changes nothing answers the holiday as it is. The calendar is platform-wide (no group scope). Every change writes a config line to the journal and raises the configuration version, so the trading services pick it up at once.

More details

Rights: the staff member needs every one of: config.holidays.

Parameters
idinteger · pathrequired
Numeric id.
Request body
dayinteger
descriptionstring
enabledboolean
from_mininteger
minutes of the day, server time
idinteger
monthinteger
positioninteger
the order staff keep the list in; changed only by a reorder
symbolsstring[]
masks; ! excludes
to_mininteger
versioninteger
yearinteger
0 = every year
Returns
Promise<Holiday>
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.holidays.update(1, {
  description: "Christmas Eve half day",
  from_min: 720,
  version: 2
})
bash
curl -X PATCH "$NOVIQA_API_URL/admin/v1/holidays/1" \
  -H "Authorization: Bearer $NOVIQA_TOKEN" \
  -H "Content-Type: application/json" \
  --data-raw '{
  "description": "Christmas Eve half day",
  "from_min": 720,
  "version": 2
}'
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "day": 1,
    "description": "string",
    "enabled": true,
    "from_min": 1,
    "id": 1,
    "month": 1,
    "position": 1,
    "symbols": [
      "string"
    ],
    "to_min": 1,
    "version": 1,
    "year": 1
  },
  "request_id": "5b7f2c1e"
}
ts
staff.holidays.update(id: number, body: models.Holiday, options?: RequestOptions): Promise<models.Holiday>

delete ​

DELETE/admin/v1/holidays/{id}

Delete a holiday

Removes the holiday. The calendar is platform-wide (no group scope). Every change writes a config line to the journal and raises the configuration version, so the trading services pick it up at once.

More details

Rights: the staff member needs every one of: config.holidays.

Parameters
idinteger · pathrequired
Numeric 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.holidays.delete(1)
bash
curl -X DELETE "$NOVIQA_API_URL/admin/v1/holidays/1" \
  -H "Authorization: Bearer $NOVIQA_TOKEN"
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": null,
  "request_id": "5b7f2c1e"
}
ts
staff.holidays.delete(id: number, options?: RequestOptions): Promise<null>