---
title: "Advanced search on Agency Group compliance rule exemption"
method: POST
path: "/agency-group/{agency_group_id}/advanced-search/compliance-rule-exemption"
tags: ["Agency Group Compliance Rule Exemption"]
---

# Advanced search on Agency Group compliance rule exemption

`POST /agency-group/{agency_group_id}/advanced-search/compliance-rule-exemption`

## Request

- Base URL: `http://localhost:3010/v1`
- URL: `http://localhost:3010/v1/agency-group/{agency_group_id}/advanced-search/compliance-rule-exemption`
- Auth: HTTP basic

## Request body

- ComplianceRuleExemptionAdvancedSearchQuery
  - `sort` ComplianceRuleExemptionSortItems[]
  - `query` ComplianceRuleExemptionQuery
    - `and` ComplianceRuleExemptionAdvancedSearchQueryFields[]
      - `and` ComplianceRuleExemptionAdvancedSearchQueryFields[]
      - `or` ComplianceRuleExemptionAdvancedSearchQueryFields[]
      - `agency_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `organisation_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `site_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `ward_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `compliance_rule_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `candidate_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `applies_to` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `effective_from` AdvancedSearchOperationsDateField
        - `equal` string, date-time, nullable
        - `greater_than` string, date-time, nullable
        - `less_than` string, date-time, nullable
        - `greater_than_equal` string, date-time, nullable
        - `less_than_equal` string, date-time, nullable
        - `in` string[]
      - `effective_to` AdvancedSearchOperationsDateField
        - `equal` string, date-time, nullable
        - `greater_than` string, date-time, nullable
        - `less_than` string, date-time, nullable
        - `greater_than_equal` string, date-time, nullable
        - `less_than_equal` string, date-time, nullable
        - `in` string[]
      - `range_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `compliance_rule_exemption_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
    - `or` ComplianceRuleExemptionAdvancedSearchQueryFields[]
      - `and` ComplianceRuleExemptionAdvancedSearchQueryFields[]
      - `or` ComplianceRuleExemptionAdvancedSearchQueryFields[]
      - `agency_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `organisation_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `site_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `ward_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `compliance_rule_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `candidate_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `applies_to` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `effective_from` AdvancedSearchOperationsDateField
        - `equal` string, date-time, nullable
        - `greater_than` string, date-time, nullable
        - `less_than` string, date-time, nullable
        - `greater_than_equal` string, date-time, nullable
        - `less_than_equal` string, date-time, nullable
        - `in` string[]
      - `effective_to` AdvancedSearchOperationsDateField
        - `equal` string, date-time, nullable
        - `greater_than` string, date-time, nullable
        - `less_than` string, date-time, nullable
        - `greater_than_equal` string, date-time, nullable
        - `less_than_equal` string, date-time, nullable
        - `in` string[]
      - `range_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `compliance_rule_exemption_id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
  - `page` integer
  - `items_per_page` integer
  - `project` object
    - `agency_id` 1, required
    - `agency_name` 1
    - `organisation_id` 1, required
    - `organisation_name` 1
    - `site_id` 1, required
    - `site_name` 1
    - `ward_id` 1, required
    - `ward_name` 1
    - `compliance_rule_id` 1, required
    - `compliance_rule_name` 1
    - `candidate_id` 1, required
    - `candidate_name` 1
    - `applies_to` 1, required
    - `effective_from` 1
    - `effective_to` 1
    - `compliance_rule_exemption_id` 1, required
    - `range_id` 1, required
    - `change_history` 1

## Response `200`

list of agency group compliance rule exemption based on search criteria

- ComplianceRuleExemptionSearchResult[]
  - `_id` string
  - `agency_id` string
  - `agency_name` string
  - `organisation_id` string
  - `organisation_name` string
  - `site_id` string
  - `site_name` string
  - `ward_id` string
  - `ward_name` string
  - `compliance_rule_id` string
  - `compliance_rule_name` string
  - `applies_to` string
  - `effective_from` string, date-time
  - `effective_to` string, date-time
  - `compliance_rule_exemption_id` string
  - `range_id` string
  - `change_history` object[]
    - `event_name` string, required
    - `note` string, required
    - `actioned_by_user_id` string, required
    - `date_actioned` string, date-time, required
    - `effective_from` string, date-time, required
    - `effective_to` string, date-time, required
  - `updated_at` string, date-time
  - `created_at` string, date-time
  - `__v` integer

## Other responses

- `204`: No content
- `400`: Validation Error. Usually caused by a missing or invalid parameter.
- `401`: Failed to authenticate the user making the request
- `403`: Permission denied error
- `default`: Server error occurred

---

[API](https://skmtc.dev/staffshift/apis/staffshift-api-gateway.md) - [All operations](https://skmtc.dev/staffshift/apis/staffshift-api-gateway/llms.txt) - [OpenAPI document](https://skmtc.dev/staffshift/apis/staffshift-api-gateway/revisions/1f079f6b65f5?raw)
