---
title: "Create a worker request rule and associate it with a location or location group"
method: POST
path: "/api/serviceattendance/processes/workerRequestRules/createAndAssociate"
tags: ["workerRequestRules"]
---

# Create a worker request rule and associate it with a location or location group

`POST /api/serviceattendance/processes/workerRequestRules/createAndAssociate`

## Request

- Base URL: `https://services.fountain.com`
- URL: `https://services.fountain.com/api/serviceattendance/processes/workerRequestRules/createAndAssociate`
- Auth: HTTP bearer

## Request body

- object
  - `rule` Rule, 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
    - `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, nullable
        - `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, nullable
        - `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, nullable
        - `name` string
      - `condition` string
      - `name` string
      - `priority` number
    - `event` object, required
      - `type` 'blocker' | 'warning' | 'automatic_break' | 'holiday', required
      - `params` object
        - `message` string
    - `name` string
    - `description` string
    - `priority` number
    - `version` string, required
    - `formatter` 'jsonRulesEngine'
    - `deletedAt` string, date-time
    - `deletedBy` string, uuid
  - `requestType` 'shiftClaim' | 'dropShift' | 'timeOffRequest' | 'findCoverage', required: Type of worker request (dropShift, shiftClaim, timeOffRequest)
  - `ruleType` 'autoApprove' | 'autoReject', required: Type of rule (autoApprove, autoReject)
  - `locationUuid` string, uuid: Location UUID to associate the rule with
  - `locationGroupUuid` string, uuid: Location group UUID to associate the rule with

## Response `201`

Worker request 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
  - `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, nullable
      - `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, nullable
      - `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, nullable
      - `name` string
    - `condition` string
    - `name` string
    - `priority` number
  - `event` object, required
    - `type` 'blocker' | 'warning' | 'automatic_break' | 'holiday', required
    - `params` object
      - `message` string
  - `name` string
  - `description` string
  - `priority` number
  - `version` string, required
  - `formatter` 'jsonRulesEngine'
  - `deletedAt` string, date-time
  - `deletedBy` string, uuid
  - `associatedWith` object
    - `locationUuid` string, uuid
    - `locationGroupUuid` string, uuid
    - `requestType` 'shiftClaim' | 'dropShift' | 'timeOffRequest' | 'findCoverage'
    - `ruleType` 'autoApprove' | 'autoReject'
  - `workerRequestSettingsUuid` string, uuid

## Other responses

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

---

[API](https://skmtc.dev/fountain/apis/worker-experience-public-api.md) - [All operations](https://skmtc.dev/fountain/apis/worker-experience-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fountain/apis/worker-experience-public-api/revisions/6b9a31f79e22?raw)
