> ## 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 CommunityPerks

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

A **CommunityPerk** represents a perk, discount, or benefit that a location offers to its customers in partnership with other businesses.

Perks can be discounts, free trials, or any other benefit negotiated with a partner business — for example, 50% off a car rental or a free hot drink at a nearby café. They are published on the Members Portal where customers can view and claim them.

Use `Active` to control visibility — when `false`, the perk is only visible on the Admin Panel. Use `ShowInHomePage` to feature a perk on the Members Portal home page after users log in.

Availability can be restricted via `OnlyForContacts` and `OnlyForMembers`. If neither flag is set, the perk is available to all customers. Use `Tariffs` to further restrict access to customers on specific pricing plans.

Which perks are listed in a location is also controlled by the `Access.Data.Perks` **BusinessSetting**, whose value is an `eDataVisibilityCriteria` enum integer. This determines which locations' perks are visible to customers at a given location — for example `ThisLocationOnly` (7) shows only perks belonging to the current location, while `AllLocations` (3) shows perks from all locations in the network.

## 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 **`CommunityPerk-List`** role.
</Note>

## Enums

<Accordion title="eDataVisibilityCriteria">
  | Value | Name                 |
  | ----- | -------------------- |
  | 1     | AllChildren          |
  | 2     | AllParents           |
  | 3     | AllLocations         |
  | 4     | HomeLocationOnly     |
  | 5     | HomeLocationChildren |
  | 6     | HomeLocationParents  |
  | 7     | ThisLocationOnly     |
  | 8     | AllParentChildren    |
</Accordion>

## 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="CommunityPerk_Business" type="integer">
  Filter by iD of the location this perk belongs to.
</ParamField>

<ParamField query="CommunityPerk_Title" type="string">
  Filter by name of the perk as displayed on the Members Portal and the Admin Panel.
</ParamField>

<ParamField query="CommunityPerk_PerkUrl" type="string">
  Filter by uRL where customers are redirected when clicking the Claim button. If blank, no Claim button is shown. Must start with https\://.
</ParamField>

<ParamField query="CommunityPerk_SummaryText" type="string">
  Filter by short description shown under the perk title on the Perks listing page of the Members Portal.
</ParamField>

<ParamField query="CommunityPerk_FullText" type="string">
  Filter by full description of the perk, displayed when a customer clicks on it from the Perks listing page.
</ParamField>

<ParamField query="CommunityPerk_ImageFileName" type="string">
  Filter by file name of the small image shown on the Perks listing page alongside other perks.
</ParamField>

<ParamField query="CommunityPerk_NewImageUrl" type="string">
  Filter by uRL of a new small image to upload for this perk.
</ParamField>

<ParamField query="CommunityPerk_ClearImage" type="boolean">
  Filter by set to true to remove the current small image from this perk.
</ParamField>

<ParamField query="CommunityPerk_LargeImageFileName" type="string">
  Filter by file name of the large image displayed under the perk title on the perk detail page.
</ParamField>

<ParamField query="CommunityPerk_NewLargeImageUrl" type="string">
  Filter by uRL of a new large image to upload for this perk.
</ParamField>

<ParamField query="CommunityPerk_ClearLargeImage" type="boolean">
  Filter by set to true to remove the current large image from this perk.
</ParamField>

<ParamField query="CommunityPerk_Active" type="boolean">
  Filter by whether this perk is published and visible to customers on the Members Portal. When false, the perk is only visible on the Admin Panel.
</ParamField>

<ParamField query="CommunityPerk_GroupName" type="string">
  Filter by group or category this perk belongs to, used to organise perks on the Members Portal.
</ParamField>

<ParamField query="CommunityPerk_DisplayOrder" type="integer">
  Filter by position of this perk in the list relative to other perks. Lower values appear first.
</ParamField>

<ParamField query="CommunityPerk_ShowInHomePage" type="boolean">
  Filter by whether to feature this perk on the Members Portal home page after users log in.
</ParamField>

<ParamField query="CommunityPerk_ClickCount" type="integer">
  Filter by number of times customers have clicked on this perk.
</ParamField>

<ParamField query="CommunityPerk_OnlyForContacts" type="boolean">
  Filter by whether this perk is only available to contacts. Set both OnlyForContacts and OnlyForMembers to false to make the perk available to all customers.
</ParamField>

<ParamField query="CommunityPerk_OnlyForMembers" type="boolean">
  Filter by whether this perk is only available to members. Set both OnlyForContacts and OnlyForMembers to false to make the perk available to all customers.
</ParamField>

### Range Filters

<ParamField query="from_CommunityPerk_DisplayOrder" type="integer">
  Filter by position of this perk in the list relative to other perks. Lower values appear first greater than or equal to this value.
</ParamField>

<ParamField query="to_CommunityPerk_DisplayOrder" type="integer">
  Filter by position of this perk in the list relative to other perks. Lower values appear first less than or equal to this value.
</ParamField>

<ParamField query="from_CommunityPerk_ClickCount" type="integer">
  Filter by number of times customers have clicked on this perk greater than or equal to this value.
</ParamField>

<ParamField query="to_CommunityPerk_ClickCount" type="integer">
  Filter by number of times customers have clicked on this perk less than or equal to this value.
</ParamField>

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

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

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

<ParamField query="to_CommunityPerk_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/content/communityperks?page=1&size=15&orderBy=Title&dir=0" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/content/communityperks?' + new URLSearchParams({
      page: 1,
      size: 15,
      orderBy: 'Title',
      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/content/communityperks',
      params={
          'page': 1,
          'size': 15,
          'orderBy': 'Title',
          'dir': 0 // Ascending
      },
      headers={
          'Authorization': 'Bearer YOUR_TOKEN'
      }
  )

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

### Filtering by Title

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

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/content/communityperks?' + new URLSearchParams({
      CommunityPerk_Title: 'example-value',
      orderBy: 'Title',
      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/content/communityperks',
      params={
          'CommunityPerk_Title': 'example-value',
          'orderBy': 'Title',
          '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/content/communityperks?from_CommunityPerk_UpdatedOn=2025-01-01T00:00&to_CommunityPerk_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/content/communityperks?' + new URLSearchParams({
      from_CommunityPerk_UpdatedOn: '2025-01-01T00:00',
      to_CommunityPerk_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/content/communityperks',
      params={
          'from_CommunityPerk_UpdatedOn': '2025-01-01T00:00',
          'to_CommunityPerk_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="CommunityPerk[]">
  The list of CommunityPerk records matching the query. See the [Get one CommunityPerk](/rest-api/content/get-communityperks-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 CommunityPerk. The following fields are **not populated** in the `Records[]` response: `FullText`, `Active`, `ShowInHomePage`, `ClickCount`, `OnlyForContacts`, `OnlyForMembers`.

  To get all fields, fetch the full record using the [Get one CommunityPerk](/rest-api/content/get-communityperks-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,
      "Title": "",
      "PerkUrl": null,
      "SummaryText": null,
      "ImageFileName": null,
      "NewImageUrl": null,
      "ClearImageFile": null,
      "LargeImageFileName": null,
      "NewLargeImageUrl": null,
      "ClearLargeImageFile": null,
      "GroupName": null,
      "DisplayOrder": 0,
      "Tariffs": [],
      "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": "CommunityPerk Example",
      "LocalizationDetails": null,
      "CustomFields": null
    }
  ],
  "CurrentPageSize": 15,
  "CurrentPage": 1,
  "CurrentOrderField": "Title",
  "CurrentSortDirection": 1,
  "FirstItem": 1,
  "HasNextPage": false,
  "HasPreviousPage": false,
  "LastItem": 1,
  "PageNumber": 1,
  "PageSize": 15,
  "TotalItems": 1,
  "TotalPages": 1
}
```
