Holiday Calendars

A Holiday Calendar defines site-wide holiday dates and optional partial-day windows that scheduled resources skip.

List Holiday Calendars

Endpoint

GET/holiday_calendars

Return Object

HolidayCalendar[]

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

curl https://app.files.com/api/rest/v1/holiday_calendars.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

[
  {
    "id": 1,
    "name": "Company Holidays",
    "definition": {
      "months": {
        "0": [
          {
            "name": "Good Friday",
            "function": "easter(year)",
            "function_modifier": -2
          }
        ],
        "1": [
          {
            "name": "New Year's Day",
            "mday": 1,
            "observed": "to_weekday_if_weekend(date)"
          },
          {
            "name": "Third Monday",
            "week": 3,
            "wday": 1
          }
        ],
        "11": [
          {
            "name": "Thanksgiving",
            "week": 4,
            "wday": 4
          }
        ],
        "12": [
          {
            "name": "Christmas Eve Early Close",
            "mday": 24,
            "start_time": "13:00",
            "end_time": "17:00",
            "year_ranges": {
              "from": 2026
            }
          }
        ]
      }
    },
    "created_at": "2000-01-01T01:00:00Z",
    "updated_at": "2000-01-01T01:00:00Z"
  }
]

Show Holiday Calendar

Endpoint

GET/holiday_calendars/{id}

Return Object

HolidayCalendar

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Request Parameters

ParameterDescription
id
int64
Required
Holiday Calendar ID.

Example Request

curl https://app.files.com/api/rest/v1/holiday_calendars/{id}.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "Company Holidays",
  "definition": {
    "months": {
      "0": [
        {
          "name": "Good Friday",
          "function": "easter(year)",
          "function_modifier": -2
        }
      ],
      "1": [
        {
          "name": "New Year's Day",
          "mday": 1,
          "observed": "to_weekday_if_weekend(date)"
        },
        {
          "name": "Third Monday",
          "week": 3,
          "wday": 1
        }
      ],
      "11": [
        {
          "name": "Thanksgiving",
          "week": 4,
          "wday": 4
        }
      ],
      "12": [
        {
          "name": "Christmas Eve Early Close",
          "mday": 24,
          "start_time": "13:00",
          "end_time": "17:00",
          "year_ranges": {
            "from": 2026
          }
        }
      ]
    }
  },
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Create Holiday Calendar

Endpoint

POST/holiday_calendars

Return Object

HolidayCalendar

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Request Parameters

ParameterDescription
definition
object
Required
Holiday rules for the calendar.
name
string
Required
Holiday Calendar name.

Example Request

curl https://app.files.com/api/rest/v1/holiday_calendars.json \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"definition":{"months":{"0":[{"name":"Good Friday","function":"easter(year)","function_modifier":-2}],"1":[{"name":"New Year's Day","mday":1,"observed":"to_weekday_if_weekend(date)"},{"name":"Third Monday","week":3,"wday":1}],"11":[{"name":"Thanksgiving","week":4,"wday":4}],"12":[{"name":"Christmas Eve Early Close","mday":24,"start_time":"13:00","end_time":"17:00","year_ranges":{"from":2026}}]}},"name":"Company Holidays"}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "Company Holidays",
  "definition": {
    "months": {
      "0": [
        {
          "name": "Good Friday",
          "function": "easter(year)",
          "function_modifier": -2
        }
      ],
      "1": [
        {
          "name": "New Year's Day",
          "mday": 1,
          "observed": "to_weekday_if_weekend(date)"
        },
        {
          "name": "Third Monday",
          "week": 3,
          "wday": 1
        }
      ],
      "11": [
        {
          "name": "Thanksgiving",
          "week": 4,
          "wday": 4
        }
      ],
      "12": [
        {
          "name": "Christmas Eve Early Close",
          "mday": 24,
          "start_time": "13:00",
          "end_time": "17:00",
          "year_ranges": {
            "from": 2026
          }
        }
      ]
    }
  },
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Update Holiday Calendar

Endpoint

PATCH/holiday_calendars/{id}

Return Object

HolidayCalendar

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Request Parameters

ParameterDescription
id
int64
Required
Holiday Calendar ID.
definition
object
Holiday rules for the calendar.
name
string
Holiday Calendar name.

Example Request

curl https://app.files.com/api/rest/v1/holiday_calendars/{id}.json \
  -X PATCH \
  -H 'Content-Type: application/json' \
  -d '{"definition":{"months":{"0":[{"name":"Good Friday","function":"easter(year)","function_modifier":-2}],"1":[{"name":"New Year's Day","mday":1,"observed":"to_weekday_if_weekend(date)"},{"name":"Third Monday","week":3,"wday":1}],"11":[{"name":"Thanksgiving","week":4,"wday":4}],"12":[{"name":"Christmas Eve Early Close","mday":24,"start_time":"13:00","end_time":"17:00","year_ranges":{"from":2026}}]}},"name":"Company Holidays"}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "Company Holidays",
  "definition": {
    "months": {
      "0": [
        {
          "name": "Good Friday",
          "function": "easter(year)",
          "function_modifier": -2
        }
      ],
      "1": [
        {
          "name": "New Year's Day",
          "mday": 1,
          "observed": "to_weekday_if_weekend(date)"
        },
        {
          "name": "Third Monday",
          "week": 3,
          "wday": 1
        }
      ],
      "11": [
        {
          "name": "Thanksgiving",
          "week": 4,
          "wday": 4
        }
      ],
      "12": [
        {
          "name": "Christmas Eve Early Close",
          "mday": 24,
          "start_time": "13:00",
          "end_time": "17:00",
          "year_ranges": {
            "from": 2026
          }
        }
      ]
    }
  },
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Delete Holiday Calendar

Endpoint

DELETE/holiday_calendars/{id}

Return Object

No return value.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Request Parameters

ParameterDescription
id
int64
Required
Holiday Calendar ID.

Example Request

curl https://app.files.com/api/rest/v1/holiday_calendars/{id}.json \
  -X DELETE \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

The HolidayCalendar Object

Some of the endpoints above return a HolidayCalendar object. The attributes of this object are listed below.

AttributeDescription
id
int64
Holiday Calendar ID. Set a scheduled resource's holiday_region to custom_ followed by this ID to make it skip the days in this calendar.
name
string
Holiday Calendar name.
definition
object
Holiday rules for the calendar.
created_at
date-time
Creation time.
updated_at
date-time
Last update time.

Example HolidayCalendar Object

{
  "id": 1,
  "name": "Company Holidays",
  "definition": {
    "months": {
      "0": [
        {
          "name": "Good Friday",
          "function": "easter(year)",
          "function_modifier": -2
        }
      ],
      "1": [
        {
          "name": "New Year's Day",
          "mday": 1,
          "observed": "to_weekday_if_weekend(date)"
        },
        {
          "name": "Third Monday",
          "week": 3,
          "wday": 1
        }
      ],
      "11": [
        {
          "name": "Thanksgiving",
          "week": 4,
          "wday": 4
        }
      ],
      "12": [
        {
          "name": "Christmas Eve Early Close",
          "mday": 24,
          "start_time": "13:00",
          "end_time": "17:00",
          "year_ranges": {
            "from": 2026
          }
        }
      ]
    }
  },
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

definition

Holiday rules grouped by month. A definition may contain at most 366 rules and its encoded JSON may be at most 65535 bytes.

Definition fields

AttributeDescription
months
object
Required
Keys 1 through 12 contain rules for that month. Key 0 contains calculated-date rules. At most 366 rules are allowed across all months.

Example definition

{
  "months": {
    "0": [
      {
        "name": "Good Friday",
        "function": "easter(year)",
        "function_modifier": -2
      }
    ],
    "1": [
      {
        "name": "New Year's Day",
        "mday": 1,
        "observed": "to_weekday_if_weekend(date)"
      },
      {
        "name": "Third Monday",
        "week": 3,
        "wday": 1
      }
    ],
    "11": [
      {
        "name": "Thanksgiving",
        "week": 4,
        "wday": 4
      }
    ],
    "12": [
      {
        "name": "Christmas Eve Early Close",
        "mday": 24,
        "start_time": "13:00",
        "end_time": "17:00",
        "year_ranges": {
          "from": 2026
        }
      }
    ]
  }
}

Rule types

Common rule options

Year restrictions