> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search ResourceAccessRules

> Search and list ResourceAccessRule records with filtering, sorting, and pagination.

A **ResourceAccessRule** defines additional booking policies and restrictions for one or more `Resource`(s) or for all resources in a location (`Business`), scoped by date/time, customer, team, plan, or other criteria. Rules are evaluated in `EvaluationOrder` and can optionally stop further evaluation when matched (`StopEvaluationIfRuleIsMet`).

The booking-policy fields (`BookInAdvanceLimit`, `LateBookingLimit`, `LateCancellationLimit`, `IntervalLimit`, `MaxBookingLength`, `MinBookingLength`, `NoReturnPolicy*`, cancellation-fee fields, and repeat-booking limits) mirror those on `Resource` and carry the same semantics — they override the resource-level defaults when the rule matches.

When `BusinessId` is set and `Resources` is empty, the rule applies to all resources in the business and its children (if any). When specific `Resources` are listed, the rule applies only to those resources.

### Scope: who the rule applies to

* `OnlyForMembers` / `OnlyForContacts` — quick toggles to limit the rule to members or contacts.
* `Tariffs` — pricing plans this rule applies to. When set, the rule only fires for customers on one of these plans.
* `Teams` — teams this rule applies to. When set, the rule only fires for members of one of these teams.
* `Courses` — the rule applies only to customers who have completed one of these courses.
* `EventCategories` — the rule applies only to customers who have attended (checked in to) an event in one of these categories.

### Scope: who is allowed to book when the rule fires

* `AllowedTariffs` — only customers on one of these plans are allowed to book when the rule applies to them.
* `AllowedTeams` — only members of one of these teams are allowed to book when the rule applies to them.

### List mutation helpers

For each list field (`Tariffs`, `AllowedTariffs`, `Teams`, `AllowedTeams`, `Members`, `EventCategories`, `Courses`) there are `Added*` and `Removed*` variants that append or remove entries on update without replacing the full list.

## Authentication

<Note>
  This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.
  The authenticated user must be a full unrestricted administrator or have the **`ResourceAccessRule-List`** role.
</Note>

## Query Parameters

### Pagination & Sorting

<ParamField query="page" type="integer" default="1">
  The page number to retrieve.
</ParamField>

<ParamField query="size" type="integer" default="25">
  The number of records per page.
</ParamField>

<ParamField query="orderBy" type="string">
  The property name to sort results by (e.g. `Name`, `CreatedOn`).
</ParamField>

<ParamField query="dir" type="integer">
  Sort direction. `0` for ascending, `1` for descending.
</ParamField>

### Filters

<ParamField query="ResourceAccessRule_Business" type="integer">
  Filter by Business Id.
</ParamField>

<ParamField query="ResourceAccessRule_Name" type="string">
  Filter by rule name.
</ParamField>

<ParamField query="ResourceAccessRule_Active" type="boolean">
  Filter by whether this rule is currently active and evaluated during booking..
</ParamField>

<ParamField query="ResourceAccessRule_OnlyForContacts" type="boolean">
  Filter by when true, this rule applies only to contacts (non-member customers)..
</ParamField>

<ParamField query="ResourceAccessRule_ApplyRuleFrom" type="string">
  Filter by date from which this rule starts being evaluated. Null means no start-date restriction..
</ParamField>

<ParamField query="ResourceAccessRule_ApplyRuleTo" type="string">
  Filter by date after which this rule stops being evaluated. Null means no end-date restriction..
</ParamField>

<ParamField query="ResourceAccessRule_BookInAdvanceLimit" type="number">
  Filter by maximum number of days in advance a booking can be made. Null means no limit..
</ParamField>

<ParamField query="ResourceAccessRule_LateBookingLimit" type="number">
  Filter by minimum lead time (in minutes) required before a booking can start. Prevents last-minute bookings..
</ParamField>

<ParamField query="ResourceAccessRule_LateCancellationLimit" type="integer">
  Filter by cut-off in minutes before the booking start time. Cancellations after this point are considered late and may incur a fee..
</ParamField>

<ParamField query="ResourceAccessRule_IntervalLimit" type="integer">
  Filter by minimum interval (in minutes) between consecutive bookings on this resource, used as a buffer for setup or cleaning..
</ParamField>

<ParamField query="ResourceAccessRule_MaxBookingLength" type="integer">
  Filter by maximum allowed duration for a single booking, in minutes..
</ParamField>

<ParamField query="ResourceAccessRule_MinBookingLength" type="integer">
  Filter by minimum allowed duration for a single booking, in minutes..
</ParamField>

<ParamField query="ResourceAccessRule_AppliedResourcesCount" type="integer">
  Filter by Applied Resources Count.
</ParamField>

<ParamField query="ResourceAccessRule_NoReturnPolicy" type="integer">
  Filter by cooldown in minutes: prevents the same user from booking this specific resource again within this window after their last booking ends..
</ParamField>

<ParamField query="ResourceAccessRule_NoReturnPolicyAllResources" type="integer">
  Filter by cooldown in minutes: prevents the same user from booking any resource after booking this one, for the specified window\..
</ParamField>

<ParamField query="ResourceAccessRule_NoReturnPolicyAllUsers" type="integer">
  Filter by cooldown in minutes: prevents any user from booking this resource within the specified window after the previous booking ends..
</ParamField>

<ParamField query="ResourceAccessRule_RejectWithMessage" type="string">
  Filter by message shown to the user when their booking is rejected by this rule..
</ParamField>

<ParamField query="ResourceAccessRule_OnlyForMembers" type="boolean">
  Filter by when true, this rule applies only to active members (coworkers with a plan)..
</ParamField>

<ParamField query="ResourceAccessRule_EvaluationOrder" type="integer">
  Filter by order in which this rule is evaluated relative to other rules on the same resource. Lower values are evaluated first..
</ParamField>

<ParamField query="ResourceAccessRule_StopEvaluationIfRuleIsMet" type="boolean">
  Filter by when true, no further rules are evaluated after this one matches..
</ParamField>

<ParamField query="ResourceAccessRule_CancellationFeeProduct" type="integer">
  Filter by Cancellation Fee Product Id.
</ParamField>

<ParamField query="ResourceAccessRule_CancellationFeeProduct_Name" type="string">
  Filter by name of the cancellation fee product (read-only, resolved from CancellationFeeProductId)..
</ParamField>

<ParamField query="ResourceAccessRule_ChargeCancellationFee" type="boolean">
  Filter by when true, a fee is charged for late cancellations (past the LateCancellationLimit)..
</ParamField>

<ParamField query="ResourceAccessRule_CancellationFeeType" type="integer">
  Filter by how the cancellation fee is calculated: Absolute (fixed amount) or Percentage (of booking cost)..
</ParamField>

<ParamField query="ResourceAccessRule_CancellationFeeAmount" type="number">
  Filter by fixed cancellation fee amount. Used when CancellationFeeType is Absolute..
</ParamField>

<ParamField query="ResourceAccessRule_CancellationFeePercentage" type="number">
  Filter by cancellation fee as a percentage of the booking cost. Used when CancellationFeeType is Percentage..
</ParamField>

<ParamField query="ResourceAccessRule_RepeatBookingQuantityLimit" type="integer">
  Filter by maximum number of occurrences allowed when creating a recurring booking under this rule..
</ParamField>

<ParamField query="ResourceAccessRule_RepeatBookingPeriodLimitInMonths" type="integer">
  Filter by maximum time span (in months) over which a recurring booking series can extend under this rule..
</ParamField>

### Range Filters

<ParamField query="from_ResourceAccessRule_ApplyRuleFrom" type="string">
  Filter by date from which this rule starts being evaluated. Null means no start-date restriction. greater than or equal to this value. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="to_ResourceAccessRule_ApplyRuleFrom" type="string">
  Filter by date from which this rule starts being evaluated. Null means no start-date restriction. less than or equal to this value. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="from_ResourceAccessRule_ApplyRuleTo" type="string">
  Filter by date after which this rule stops being evaluated. Null means no end-date restriction. greater than or equal to this value. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="to_ResourceAccessRule_ApplyRuleTo" type="string">
  Filter by date after which this rule stops being evaluated. Null means no end-date restriction. less than or equal to this value. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="from_ResourceAccessRule_BookInAdvanceLimit" type="number">
  Filter by maximum number of days in advance a booking can be made. Null means no limit. greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_BookInAdvanceLimit" type="number">
  Filter by maximum number of days in advance a booking can be made. Null means no limit. less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_LateBookingLimit" type="number">
  Filter by minimum lead time (in minutes) required before a booking can start. Prevents last-minute bookings. greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_LateBookingLimit" type="number">
  Filter by minimum lead time (in minutes) required before a booking can start. Prevents last-minute bookings. less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_LateCancellationLimit" type="integer">
  Filter by cut-off in minutes before the booking start time. Cancellations after this point are considered late and may incur a fee. greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_LateCancellationLimit" type="integer">
  Filter by cut-off in minutes before the booking start time. Cancellations after this point are considered late and may incur a fee. less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_IntervalLimit" type="integer">
  Filter by minimum interval (in minutes) between consecutive bookings on this resource, used as a buffer for setup or cleaning. greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_IntervalLimit" type="integer">
  Filter by minimum interval (in minutes) between consecutive bookings on this resource, used as a buffer for setup or cleaning. less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_MaxBookingLength" type="integer">
  Filter by maximum allowed duration for a single booking, in minutes. greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_MaxBookingLength" type="integer">
  Filter by maximum allowed duration for a single booking, in minutes. less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_MinBookingLength" type="integer">
  Filter by minimum allowed duration for a single booking, in minutes. greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_MinBookingLength" type="integer">
  Filter by minimum allowed duration for a single booking, in minutes. less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_AppliedResourcesCount" type="integer">
  Filter by applied resources count greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_AppliedResourcesCount" type="integer">
  Filter by applied resources count less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_NoReturnPolicy" type="integer">
  Filter by cooldown in minutes: prevents the same user from booking this specific resource again within this window after their last booking ends. greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_NoReturnPolicy" type="integer">
  Filter by cooldown in minutes: prevents the same user from booking this specific resource again within this window after their last booking ends. less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_NoReturnPolicyAllResources" type="integer">
  Filter by cooldown in minutes: prevents the same user from booking any resource after booking this one, for the specified window. greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_NoReturnPolicyAllResources" type="integer">
  Filter by cooldown in minutes: prevents the same user from booking any resource after booking this one, for the specified window. less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_NoReturnPolicyAllUsers" type="integer">
  Filter by cooldown in minutes: prevents any user from booking this resource within the specified window after the previous booking ends. greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_NoReturnPolicyAllUsers" type="integer">
  Filter by cooldown in minutes: prevents any user from booking this resource within the specified window after the previous booking ends. less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_EvaluationOrder" type="integer">
  Filter by order in which this rule is evaluated relative to other rules on the same resource. Lower values are evaluated first. greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_EvaluationOrder" type="integer">
  Filter by order in which this rule is evaluated relative to other rules on the same resource. Lower values are evaluated first. less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_CancellationFeeAmount" type="number">
  Filter by fixed cancellation fee amount. Used when CancellationFeeType is Absolute. greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_CancellationFeeAmount" type="number">
  Filter by fixed cancellation fee amount. Used when CancellationFeeType is Absolute. less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_CancellationFeePercentage" type="number">
  Filter by cancellation fee as a percentage of the booking cost. Used when CancellationFeeType is Percentage. greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_CancellationFeePercentage" type="number">
  Filter by cancellation fee as a percentage of the booking cost. Used when CancellationFeeType is Percentage. less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_RepeatBookingQuantityLimit" type="integer">
  Filter by maximum number of occurrences allowed when creating a recurring booking under this rule. greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_RepeatBookingQuantityLimit" type="integer">
  Filter by maximum number of occurrences allowed when creating a recurring booking under this rule. less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_RepeatBookingPeriodLimitInMonths" type="integer">
  Filter by maximum time span (in months) over which a recurring booking series can extend under this rule. greater than or equal to this value.
</ParamField>

<ParamField query="to_ResourceAccessRule_RepeatBookingPeriodLimitInMonths" type="integer">
  Filter by maximum time span (in months) over which a recurring booking series can extend under this rule. less than or equal to this value.
</ParamField>

<ParamField query="from_ResourceAccessRule_CreatedOn" type="string">
  Filter records created on or after this date. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="to_ResourceAccessRule_CreatedOn" type="string">
  Filter records created on or before this date. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="from_ResourceAccessRule_UpdatedOn" type="string">
  Filter records updated on or after this date. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

<ParamField query="to_ResourceAccessRule_UpdatedOn" type="string">
  Filter records updated on or before this date. Format: `YYYY-MM-DDTHH:mm`.
</ParamField>

## Code Examples

### Simple listing

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    "https://spaces.nexudus.com/api/spaces/resourceaccessrules?page=1&size=15&orderBy=Name&dir=0" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/spaces/resourceaccessrules?' + new URLSearchParams({
      page: 1,
      size: 15,
      orderBy: 'Name',
      dir: 1 // Ascending
    }),
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://spaces.nexudus.com/api/spaces/resourceaccessrules',
      params={
          'page': 1,
          'size': 15,
          'orderBy': 'Name',
          'dir': 0 // Ascending
      },
      headers={
          'Authorization': 'Bearer YOUR_TOKEN'
      }
  )

  data = response.json()
  ```
</CodeGroup>

### Filtering by Name

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    "https://spaces.nexudus.com/api/spaces/resourceaccessrules?ResourceAccessRule_Name=example-value&orderBy=Name&dir=0" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/spaces/resourceaccessrules?' + new URLSearchParams({
      ResourceAccessRule_Name: 'example-value',
      orderBy: 'Name',
      dir: 1
    }),
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://spaces.nexudus.com/api/spaces/resourceaccessrules',
      params={
          'ResourceAccessRule_Name': 'example-value',
          'orderBy': 'Name',
          'dir': 0 // Ascending
      },
      headers={
          'Authorization': 'Bearer YOUR_TOKEN'
      }
  )

  data = response.json()
  ```
</CodeGroup>

### Range filters

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    "https://spaces.nexudus.com/api/spaces/resourceaccessrules?from_ResourceAccessRule_UpdatedOn=2025-01-01T00:00&to_ResourceAccessRule_UpdatedOn=2025-12-31T23:59&orderBy=UpdatedOn&dir=0" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/spaces/resourceaccessrules?' + new URLSearchParams({
      from_ResourceAccessRule_UpdatedOn: '2025-01-01T00:00',
      to_ResourceAccessRule_UpdatedOn: '2025-12-31T23:59',
      orderBy: 'UpdatedOn',
      dir: 1 // Descending
     }),
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://spaces.nexudus.com/api/spaces/resourceaccessrules',
      params={
          'from_ResourceAccessRule_UpdatedOn': '2025-01-01T00:00',
          'to_ResourceAccessRule_UpdatedOn': '2025-12-31T23:59',
          'orderBy': 'UpdatedOn',
          'dir': 1 // Descending
      },
      headers={
          'Authorization': 'Bearer YOUR_TOKEN'
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="Records" type="ResourceAccessRule[]">
  The list of ResourceAccessRule records matching the query. See the [Get one ResourceAccessRule](/rest-api/spaces/get-resourceaccessrules-by-id) endpoint for the full list of properties returned for each record.
</ResponseField>

<Warning>
  **Partial records** — The listing endpoint returns a summary representation of each ResourceAccessRule. The following fields are **not populated** in the `Records[]` response: `CancellationFeeType`, `CancellationFeeAmount`, `CancellationFeePercentage`.

  To get all fields, fetch the full record using the [Get one ResourceAccessRule](/rest-api/spaces/get-resourceaccessrules-by-id) endpoint.

  **Important for updates:** When updating a record via `PUT`, always retrieve the full record with a `GET` request first, apply your changes to that complete data, and then send the updated record. Do not use data from a listing response as the base for a `PUT` request, as missing fields may be unintentionally cleared.
</Warning>

<ResponseField name="CurrentPage" type="integer">
  Current page number.
</ResponseField>

<ResponseField name="CurrentPageSize" type="integer">
  Number of records per page.
</ResponseField>

<ResponseField name="CurrentOrderField" type="string">
  The field used for sorting.
</ResponseField>

<ResponseField name="CurrentSortDirection" type="integer">
  The sort direction (`0` = ascending, `1` = descending).
</ResponseField>

<ResponseField name="FirstItem" type="integer">
  Index of the first item on the current page.
</ResponseField>

<ResponseField name="LastItem" type="integer">
  Index of the last item on the current page.
</ResponseField>

<ResponseField name="TotalItems" type="integer">
  Total number of matching records across all pages.
</ResponseField>

<ResponseField name="TotalPages" type="integer">
  Total number of pages.
</ResponseField>

<ResponseField name="HasNextPage" type="boolean">
  Whether there is a next page of results.
</ResponseField>

<ResponseField name="HasPreviousPage" type="boolean">
  Whether there is a previous page of results.
</ResponseField>

```json Example Response theme={null}
{
  "Records": [
    {
      "BusinessId": 0,
      "Resources": [],
      "Name": "",
      "Active": false,
      "OnlyForContacts": false,
      "ApplyRuleFrom": null,
      "ApplyRuleTo": null,
      "BookInAdvanceLimit": null,
      "LateBookingLimit": null,
      "LateCancellationLimit": null,
      "IntervalLimit": null,
      "MaxBookingLength": null,
      "MinBookingLength": null,
      "AppliedResourcesCount": 0,
      "NoReturnPolicy": null,
      "NoReturnPolicyAllResources": null,
      "NoReturnPolicyAllUsers": null,
      "RejectWithMessage": null,
      "OnlyForMembers": false,
      "Tariffs": [],
      "AllowedTariffs": [],
      "Members": [],
      "Teams": [],
      "AllowedTeams": [],
      "EventCategories": [],
      "Courses": [],
      "EvaluationOrder": 0,
      "StopEvaluationIfRuleIsMet": false,
      "CancellationFeeProductId": null,
      "CancellationFeeProductName": null,
      "ChargeCancellationFee": false,
      "RepeatBookingQuantityLimit": null,
      "RepeatBookingPeriodLimitInMonths": null,
      "Id": 87654321,
      "UpdatedOn": "2025-01-15T10:30:00Z",
      "CreatedOn": "2025-01-10T08:00:00Z",
      "UniqueId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "UpdatedBy": "admin@example.com",
      "IsNew": false,
      "SystemId": null,
      "ToStringText": "ResourceAccessRule Example",
      "LocalizationDetails": null,
      "CustomFields": null
    }
  ],
  "CurrentPageSize": 15,
  "CurrentPage": 1,
  "CurrentOrderField": "Name",
  "CurrentSortDirection": 1,
  "FirstItem": 1,
  "HasNextPage": false,
  "HasPreviousPage": false,
  "LastItem": 1,
  "PageNumber": 1,
  "PageSize": 15,
  "TotalItems": 1,
  "TotalPages": 1
}
```
