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

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

A **CannedResponse** is a reusable message template, known as a **Message Macro** in the Nexudus UI (Admin Panel > CRM > Message Macros).

Message macros can be sent directly to customers or used alongside reminders to automate communication. They support dynamic tokens — placeholders such as `\{salutation\}` — that Nexudus automatically replaces with live data from your account when the message is delivered.

Message macros are available across all locations in a network, regardless of which location created them.

### Supported tokens

**Location tokens** (always available):

| Token                                   | Description                                 |
| --------------------------------------- | ------------------------------------------- |
| `\{businessname\}` / `\{locationName\}` | Location name                               |
| `\{businessphone\}`                     | Location phone                              |
| `\{businesscontactphone\}`              | Location phone or contact phone             |
| `\{businesscontactweb\}`                | Location web contact                        |
| `\{businessaddress\}`                   | Location address                            |
| `\{businessemail\}`                     | Location email contact                      |
| `\{businessid\}`                        | Location ID                                 |
| `\{businessurl\}`                       | Location public URL                         |
| `\{businessavatar\}`                    | Location logo URL                           |
| `\{businessbanner\}`                    | Location banner URL                         |
| `\{logoImage\}`                         | Location logo as an HTML `<img>` tag        |
| `\{timezone\}`                          | Location timezone                           |
| `\{date\}`                              | Current date in location timezone           |
| `\{time\}`                              | Current time in location timezone           |
| `\{yesterday\}`                         | Yesterday's date                            |
| `\{tomorrow\}`                          | Tomorrow's date                             |
| `\{terms\}`                             | Terms & conditions (rendered from Markdown) |
| `\{iosurl\}`                            | iOS app URL                                 |
| `\{androidurl\}`                        | Android app URL                             |
| `\{serviceurl\}`                        | Dashboard URL                               |
| `\{unsubscribeurl\}`                    | Unsubscribe URL                             |
| *(custom fields)*                       | Any Business custom fields                  |

**Customer tokens** (always available):

| Token                                   | Description                      |
| --------------------------------------- | -------------------------------- |
| `\{firstname\}`                         | Customer first name              |
| `\{fullname\}`                          | Customer full name               |
| `\{salutation\}`                        | Customer salutation              |
| `\{email\}` / `\{username\}`            | Customer email                   |
| `\{coworkerid\}`                        | Customer ID                      |
| `\{coworkerguid\}`                      | Customer GUID                    |
| `\{homebusiness\}`                      | Customer's home location name    |
| `\{companyname\}` / `\{companyName\}`   | Company name                     |
| `\{phone\}`                             | Mobile phone or landline         |
| `\{address\}`                           | Address                          |
| `\{postcode\}`                          | Post code                        |
| `\{cityname\}`                          | City                             |
| `\{state\}`                             | State                            |
| `\{billingname\}` / `\{billingName\}`   | Billing name                     |
| `\{billingadress\}`                     | Billing address                  |
| `\{billingcityname\}`                   | Billing city                     |
| `\{billingpostcode\}`                   | Billing post code                |
| `\{billingstate\}`                      | Billing state                    |
| `\{accesscardid\}` / `\{accessCardId\}` | Access card ID / pincode         |
| `\{accesscardtag\}`                     | Access card tag                  |
| `\{accesspincode\}`                     | Access PIN code                  |
| `\{cardNumber\}`                        | Card number                      |
| `\{keyFobNumber\}`                      | Key fob number                   |
| `\{tariffname\}`                        | Current pricing plan name        |
| `\{tariffprice\}`                       | Current pricing plan price       |
| `\{nexttariffname\}`                    | Next pricing plan name           |
| `\{nexttariffprice\}`                   | Next pricing plan price          |
| `\{contractnotes\}`                     | Contract notes                   |
| `\{cancellationdate\}`                  | Contract cancellation date       |
| `\{nextinvoicedate\}`                   | Next invoice date                |
| `\{invoicedperiod\}`                    | Invoiced period date             |
| `\{contracterm\}`                       | Contract term end date           |
| `\{desks\}`                             | Assigned desks (comma-separated) |
| `\{generalterms\}`                      | General terms & conditions       |
| `\{contracterms\}`                      | Contract terms & conditions      |
| `\{teamNames\}`                         | Team names (comma-separated)     |
| `\{custom1\}` – `\{custom30\}`          | Legacy custom fields 1–30        |
| `\{coworkerurl\}`                       | Admin URL for the customer       |
| `\{coworkerpublicurl\}`                 | Public profile URL               |
| `\{coworkerprofileurl\}`                | Customer profile admin URL       |
| `\{coworkercontractsurl\}`              | Customer contracts admin URL     |
| `\{coworkermessagesurl\}`               | Customer messages admin URL      |
| `\{coworkerproductssurl\}`              | Customer products admin URL      |
| `\{coworkerproposalsurl\}`              | Customer proposals admin URL     |
| `\{gocardlesssignupurl\}`               | Direct debit signup URL          |
| `\{teamsignuplink\}`                    | Team signup link                 |
| *(custom fields)*                       | Any Coworker custom fields       |

**User / account tokens** (always available when the customer has a portal access / user account):

| Token                      | Description                                     |
| -------------------------- | ----------------------------------------------- |
| `\{userid\}`               | User ID                                         |
| `\{passportnumber\}`       | Passport number                                 |
| `\{password\}`             | Temporary password (only during password reset) |
| `\{useraccesstoken\}`      | User access token                               |
| `\{activateurl\}`          | Account activation URL                          |
| `\{loginurl\}`             | Login URL                                       |
| `\{magiclink\}`            | Magic link for passwordless login               |
| `\{resetpasswordurl\}`     | Reset password URL                              |
| `\{unpaidinvoicescount\}`  | Number of unpaid invoices                       |
| `\{unpaidinvoicenumbers\}` | Unpaid invoice numbers (comma-separated)        |
| `\{unpaidinvoicestotal\}`  | Unpaid invoices total amount                    |
| `\{dueinvoicescount\}`     | Number of overdue invoices                      |
| `\{dueinvoicenumbers\}`    | Overdue invoice numbers (comma-separated)       |
| `\{dueinvoicestotal\}`     | Overdue invoices total amount                   |
| `\{earliestduedate\}`      | Earliest due date across unpaid invoices        |

**Message-macro-specific tokens**:

| Token                         | Description                                                         |
| ----------------------------- | ------------------------------------------------------------------- |
| `\{nextbillingdate\}`         | Next tariff billing date                                            |
| `\{priceplan\}`               | Active pricing plan names (comma-separated, all contracts)          |
| `\{nextpriceplan\}`           | Next pricing plan names (comma-separated)                           |
| `\{priceplanprice\}`          | Total cost of active pricing plans (formatted in location currency) |
| `\{nextpriceplanprice\}`      | Total cost of next pricing plans                                    |
| `\{maincontractpriceplan\}`   | Main contract pricing plan name                                     |
| `\{maincontractprice\}`       | Main contract price                                                 |
| `\{maincontractbillingdate\}` | Main contract renewal / billing date                                |
| `\{maincontractstartdate\}`   | Main contract start date                                            |
| `\{deliverytable\}`           | HTML table of uncollected deliveries (location, name, date, notes)  |

**Delivery tokens** (resolved from the customer's oldest uncollected delivery, if any):

| Token                                        | Description                          |
| -------------------------------------------- | ------------------------------------ |
| `\{deliveryreference\}` / `\{deliveryname\}` | Delivery name                        |
| `\{deliverycreatedon\}`                      | Delivery creation date (full format) |
| `\{deliverylocation\}`                       | Delivery location                    |
| `\{deliverynotes\}`                          | Delivery notes                       |
| `\{deliveryfileurl\}`                        | Delivery label image URL             |
| `\{deliveryqrcode\}`                         | Delivery QR code URL                 |
| `\{deliverycode128\}`                        | Delivery barcode (Code 128) URL      |

**Product tokens** (available when the macro is sent alongside a product purchase — `CoworkerProduct` or `BookingProduct`):

| Token                        | Description                                    |
| ---------------------------- | ---------------------------------------------- |
| `\{productname\}`            | Product name                                   |
| `\{productid\}`              | Product ID                                     |
| `\{productstocklevel\}`      | Current stock level                            |
| `\{productstockalertlevel\}` | Stock alert level                              |
| `\{product\}`                | "Qty x Product Name"                           |
| `\{price\}`                  | Product price (formatted in location currency) |
| `\{notes\}`                  | Purchase notes                                 |
| *(custom fields)*            | Any Product custom fields                      |

**Booking tokens** (available when the product purchase is linked to a booking):

| Token                              | Description                                      |
| ---------------------------------- | ------------------------------------------------ |
| `\{bookingId\}`                    | Booking ID                                       |
| `\{bookingNumber\}`                | Booking number (zero-padded)                     |
| `\{bookingUniqueId\}`              | Booking GUID                                     |
| `\{bookingDurationInMinutes\}`     | Booking duration in minutes                      |
| `\{resourceId\}`                   | Resource ID                                      |
| `\{resourceName\}`                 | Resource name                                    |
| `\{resourceDescription\}`          | Resource description                             |
| `\{resourcetype\}`                 | Resource type name                               |
| `\{fromTime\}`                     | Booking start date/time                          |
| `\{toTime\}`                       | Booking end date/time                            |
| `\{desk\}`                         | Desk name (or location name if none)             |
| `\{desknotes\}`                    | Desk notes                                       |
| `\{confirmationContent\}`          | Resource email confirmation content              |
| `\{bookingTerminateUrl\}`          | Booking cancellation URL                         |
| `\{accesstoken\}`                  | Booking access code                              |
| `\{price\}`                        | Estimated booking cost (overrides product price) |
| `\{pricewithcredits\}`             | Estimated cost after credits                     |
| `\{additionals\}`                  | Booking add-on products                          |
| `\{additionals_with_description\}` | Add-on products with descriptions                |
| `\{products\}`                     | Product list (HTML formatted)                    |
| `\{notes\}`                        | Booking notes                                    |
| *(custom fields)*                  | Any Booking custom fields                        |

## 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 **`CannedResponse-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="CannedResponse_Business" type="integer">
  Filter by Business Id.
</ParamField>

<ParamField query="CannedResponse_Business_Name" type="string">
  Filter by location name.
</ParamField>

<ParamField query="CannedResponse_Name" type="string">
  Filter by name of the message macro.
</ParamField>

<ParamField query="CannedResponse_Subject" type="string">
  Filter by subject line shown in the customer's inbox when the message macro is delivered.
</ParamField>

<ParamField query="CannedResponse_MessageText" type="string">
  Filter by body of the message macro; supports dynamic tokens (e.g. \{salutations}) that Nexudus replaces with live data when the message is sent.
</ParamField>

### Range Filters

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

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

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

<ParamField query="to_CannedResponse_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/crm/cannedresponses?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/crm/cannedresponses?' + 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/crm/cannedresponses',
      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/crm/cannedresponses?CannedResponse_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/crm/cannedresponses?' + new URLSearchParams({
      CannedResponse_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/crm/cannedresponses',
      params={
          'CannedResponse_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/crm/cannedresponses?from_CannedResponse_UpdatedOn=2025-01-01T00:00&to_CannedResponse_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/crm/cannedresponses?' + new URLSearchParams({
      from_CannedResponse_UpdatedOn: '2025-01-01T00:00',
      to_CannedResponse_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/crm/cannedresponses',
      params={
          'from_CannedResponse_UpdatedOn': '2025-01-01T00:00',
          'to_CannedResponse_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="CannedResponse[]">
  The list of CannedResponse records matching the query. See the [Get one CannedResponse](/rest-api/crm/get-cannedresponses-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 CannedResponse. The following fields are **not populated** in the `Records[]` response: `MessageText`.

  To get all fields, fetch the full record using the [Get one CannedResponse](/rest-api/crm/get-cannedresponses-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,
      "BusinessName": null,
      "Name": "",
      "Subject": 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": "CannedResponse 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
}
```
