---
title: "Create a holiday rule and associate it with a location"
method: POST
path: "/api/serviceattendance/processes/holidayRules/createAndAssociate"
tags: ["holidayRules"]
---

# Create a holiday rule and associate it with a location

`POST /api/serviceattendance/processes/holidayRules/createAndAssociate`

## Request body

- object
  - `holidayRule` HolidayRule, required
    - `uuid` string, uuid
    - `createdAt` string, date-time
    - `createdBy` string, uuid
    - `lastUpdatedAt` string, date-time
    - `lastUpdatedBy` string, uuid
    - `lastUpdatedByAudience` string
    - `lastUpdatedByAudienceUuid` string, uuid
    - `lastUpdatedByImpersonatedBy` string, uuid
    - `lastUpdatedByCompanyUuid` string, uuid
    - `lastUpdatedByEnterpriseUuid` string, uuid
    - `companyUuid` string, uuid
    - `holidayRuleSettingUuid` string, uuid, required
    - `active` boolean, required
    - `conditions` object, required
      - `all` object[]
        - `fact` string, required
        - `operator` string, required
        - `value` union, required
          - object
            - `fact` string
          - string
          - number
          - boolean
          - union[]
            - union
              - …
        - `path` string
        - `priority` number
        - `params` object
        - `name` string
      - `any` object[]
        - `fact` string, required
        - `operator` string, required
        - `value` union, required
          - object
            - `fact` string
          - string
          - number
          - boolean
          - union[]
            - union
              - …
        - `path` string
        - `priority` number
        - `params` object
        - `name` string
      - `not` object
        - `fact` string, required
        - `operator` string, required
        - `value` union, required
          - object
            - `fact` string
          - string
          - number
          - boolean
          - union[]
            - union
              - …
        - `path` string
        - `priority` number
        - `params` object
        - `name` string
      - `condition` string
      - `name` string
      - `priority` number
    - `event` object, required
      - `type` 'holiday', required
      - `params` object
        - `message` string
    - `name` string, required
    - `description` string
    - `priority` number
    - `version` string, required
    - `formatter` 'jsonRulesEngine'
    - `rateMultiplierSettings` object
      - `active` boolean
      - `multiplier` number
    - `createdTimesheetSettings` object
      - `active` boolean
      - `lengthMinutes` number, required
    - `isRecurring` boolean, required
    - `startDate` string, date-time, required
    - `deletedAt` string, date-time
    - `deletedBy` string, uuid
  - `locationUuid` string, uuid — Location UUID to associate the rule with
  - `locationGroupUuid` string, uuid — Location group UUID to associate the rule with

## Response `201`

Holiday rule created and associated successfully

- object
  - `uuid` string, uuid
  - `createdAt` string, date-time
  - `createdBy` string, uuid
  - `lastUpdatedAt` string, date-time
  - `lastUpdatedBy` string, uuid
  - `lastUpdatedByAudience` string
  - `lastUpdatedByAudienceUuid` string, uuid
  - `lastUpdatedByImpersonatedBy` string, uuid
  - `lastUpdatedByCompanyUuid` string, uuid
  - `lastUpdatedByEnterpriseUuid` string, uuid
  - `companyUuid` string, uuid
  - `holidayRuleSettingUuid` string, uuid, required
  - `active` boolean, required
  - `conditions` object, required
    - `all` object[]
      - `fact` string, required
      - `operator` string, required
      - `value` union, required
        - object
          - `fact` string
        - string
        - number
        - boolean
        - union[]
          - union
            - string
            - number
      - `path` string
      - `priority` number
      - `params` object
      - `name` string
    - `any` object[]
      - `fact` string, required
      - `operator` string, required
      - `value` union, required
        - object
          - `fact` string
        - string
        - number
        - boolean
        - union[]
          - union
            - string
            - number
      - `path` string
      - `priority` number
      - `params` object
      - `name` string
    - `not` object
      - `fact` string, required
      - `operator` string, required
      - `value` union, required
        - object
          - `fact` string
        - string
        - number
        - boolean
        - union[]
          - union
            - string
            - number
      - `path` string
      - `priority` number
      - `params` object
      - `name` string
    - `condition` string
    - `name` string
    - `priority` number
  - `event` object, required
    - `type` 'holiday', required
    - `params` object
      - `message` string
  - `name` string, required
  - `description` string
  - `priority` number
  - `version` string, required
  - `formatter` 'jsonRulesEngine'
  - `rateMultiplierSettings` object
    - `active` boolean
    - `multiplier` number
  - `createdTimesheetSettings` object
    - `active` boolean
    - `lengthMinutes` number, required
  - `isRecurring` boolean, required
  - `startDate` string, date-time, required
  - `deletedAt` string, date-time
  - `deletedBy` string, uuid
  - `associatedWith` object
    - `locationUuid` string, uuid
    - `locationGroupUuid` string, uuid
  - `holidayRuleSettingsUuid` string, uuid

## Other responses

- `400` — Bad request
- `500` — Internal server error

---

[API](https://skmtc.net/fountain/apis/hire-public-api.md) · [All operations](https://skmtc.net/fountain/apis/hire-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/fountain/hire-public-api/versions/5f406c0e9462/schema)
