---
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 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
        - `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` '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
      - `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` '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.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/revisions/5f406c0e9462/schema)
