[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-calendar":3,"docs-tabs-calendar":6},{"content":4,"lastmod":5},"\n# Calendar\n\nBitrix24 account calendar settings — working hours, weekend days of the week, holidays and working Saturdays. The same values the Bitrix24 interface uses to mark non-working days.\n\n**Scope:** `calendar` | **Base URL:** `https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1` | **Authorization:** `X-Api-Key`\n\n[Quick start](#quick-start) | [Full example](#full-example-is-this-a-working-day) | [Endpoint reference](#endpoint-reference) | [Error codes](#error-codes)\n\nCalendar events and sections are separate entities with their own operation sets: [Calendar events](\u002Fdocs\u002Fentities\u002Fcalendar-events) and [Calendar sections](\u002Fdocs\u002Fentities\u002Fcalendar-sections). This page covers the settings shared across the entire Bitrix24 account.\n\n## Quick start\n\n```bash\ncurl -H \"X-Api-Key: YOUR_API_KEY\" \\\n  https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcalendar\u002Fsettings\n```\n\nThe response contains the working-day boundaries, the weekend days of the week and the holiday lists:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"workTimeStart\": \"10\",\n    \"workTimeEnd\": \"22\",\n    \"weekHolidays\": [\"SA\", \"SU\"],\n    \"weekStart\": \"MO\",\n    \"yearHolidays\": \"1.01,25.12\",\n    \"yearWorkdays\": \"20.12\"\n  }\n}\n```\n\nThe main fields are shown. For the full list, see [Calendar settings](\u002Fdocs\u002Fcalendar\u002Fsettings).\n\n## Full example: is this a working day\n\nThe most common reason to read the settings is to decide whether a specific day is a working day in the Bitrix24 account. The answer combines three rules: the day of the week, the holiday list and the list of working weekend days.\n\n```javascript\nconst VIBE_URL = 'https:\u002F\u002Fvibecode.bitrix24.com'\nconst VIBE_API_KEY = process.env.VIBE_API_KEY\n\n\u002F\u002F Step 1. Read the portal settings.\nconst res = await fetch(`${VIBE_URL}\u002Fv1\u002Fcalendar\u002Fsettings`, {\n  headers: { 'X-Api-Key': VIBE_API_KEY },\n})\nif (!res.ok) throw new Error(`Settings unavailable: ${res.status}`)\nconst { data, meta } = await res.json()\n\n\u002F\u002F Step 2. Make sure the portal returned the full set and not the default values.\nconst partial = meta?.warnings?.some((w) => w.code === 'calendar_settings_partial')\nif (partial) {\n  throw new Error('The key does not belong to a portal employee — the settings cannot be read')\n}\n\n\u002F\u002F Step 3. Parse the lists. A day arrives both as `1.01` and as `01.01`: the format\n\u002F\u002F follows the account language, so normalise the list and the lookup key alike.\nconst dayKey = (day, month) => `${Number(day)}.${Number(month)}`\nconst parseDays = (value) => new Set(\n  value\n    ? value.split(',').map((d) => {\n        const [day, month] = d.trim().split('.')\n        return dayKey(day, month)\n      })\n    : [],\n)\nconst holidays = parseDays(data.yearHolidays)\nconst workdays = parseDays(data.yearWorkdays)\nconst weekends = new Set(data.weekHolidays)\n\nconst WEEK_CODES = ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA']\n\nfunction isWorkingDay(date) {\n  const key = dayKey(date.getDate(), date.getMonth() + 1)\n  \u002F\u002F A working weekend day overrides both a weekend day of the week and a holiday.\n  if (workdays.has(key)) return true\n  if (holidays.has(key)) return false\n  return !weekends.has(WEEK_CODES[date.getDay()])\n}\n\n\u002F\u002F Step 4. Apply to a date range.\nconst start = new Date('2026-01-01')\nfor (let i = 0; i \u003C 10; i += 1) {\n  const day = new Date(start)\n  day.setDate(start.getDate() + i)\n  console.log(day.toISOString().slice(0, 10), isWorkingDay(day) ? 'working' : 'non-working')\n}\n\nconsole.log('Portal working hours:', data.workTimeStart, '—', data.workTimeEnd)\n```\n\nAn empty string in `yearHolidays` means the holiday list is not filled in for the Bitrix24 account. In that case, non-working days are determined by the weekend days of the week alone.\n\nA non-empty value, on the other hand, does not mean an administrator filled the list in: the setting has a localised default set, and an account whose calendar was never configured returns exactly that. The default set follows the account language rather than its country, so verify holidays against your own data instead of treating the answer as administrator-confirmed.\n\n## Endpoint reference\n\n| Method | Path | Bitrix24 method | Description |\n|-------|------|---------------|---------|\n| GET | [`\u002Fv1\u002Fcalendar\u002Fsettings`](\u002Fdocs\u002Fcalendar\u002Fsettings) | calendar.settings.get | Bitrix24 account calendar settings |\n\nCalendar events and sections are available as entities — [Calendar events](\u002Fdocs\u002Fentities\u002Fcalendar-events), [Calendar sections](\u002Fdocs\u002Fentities\u002Fcalendar-sections).\n\n## Error codes\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `WRONG_PATH` | A non-existent address was requested. The error text names the correct address |\n| 403 | `SCOPE_DENIED` | The key lacks the `calendar` scope |\n| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request — text in `message` |\n| 502 | `BITRIX_UNAVAILABLE` | The portal is unavailable or returned a response with an unexpected structure |\n\nFor the full list of common API errors, see [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [Endpoints](\u002Fdocs\u002Fcalendar\u002Fendpoints)\n- [Calendar events](\u002Fdocs\u002Fentities\u002Fcalendar-events)\n- [Calendar sections](\u002Fdocs\u002Fentities\u002Fcalendar-sections)\n- [Workday](\u002Fdocs\u002Fworkday)\n","2026-08-17",{},1795000246017]