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

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

An AiChannelSession is one conversation between a contact and the AI, on whichever channel it happened — the web chat widget, email, WhatsApp or a voice call. It links to a Coworker when the contact is a member, and otherwise identifies them by ExternalIdentifier. The transcript lives in OpenAiChatMessage records sharing this record’s ChatSession GUID. Custom fields named Nexudus.Ai.VisitorId, Nexudus.Ai.CoworkerId, Nexudus.Ai.CoworkerContractId, Nexudus.Ai.CoworkerProductId and Nexudus.Ai.BookingId record what the conversation produced, so they are how you tell which conversations converted into a tour, a signup, a contract, a day pass or a booking. This entity is read-only: conversations are written by the inbound message pipeline and the proactive outreach engine, never by hand.

## 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 **`AiChannelSession-List`** role.

## Enums

> [accordion] eAiEscalationStatus — EscalationStatus values
>
> | Value | Name |
> | - | - |
> | 1 | Pending |
> | 2 | Active |
> | 3 | Resolved |

## Query Parameters

### Pagination & Sorting

**page** `integer` (default: 1)

The page number to retrieve.

**size** `integer` (default: 25)

The number of records per page.

**orderBy** `string`

The property name to sort results by (e.g. `Name`, `CreatedOn`).

**dir** `integer`

Sort direction. `0` for ascending, `1` for descending.

### Filters

**AiChannelSession\_Business** `integer`

Filter by iD of the location that owns this conversation. Set from the location the inbound message arrived at, or from the location whose agent started the outreach..

**AiChannelSession\_Coworker** `integer`

Filter by iD of the customer this conversation is with. Empty when the contact is not a member yet, in which case ExternalIdentifier holds their email address or phone number..

**AiChannelSession\_Coworker\_CoworkerType** `string`

Filter by display value for Coworker.CoworkerType..

**AiChannelSession\_Coworker\_FullName** `string`

Filter by display value for Coworker.FullName..

**AiChannelSession\_Coworker\_MobilePhone** `string`

Filter by display value for Coworker.MobilePhone..

**AiChannelSession\_Coworker\_LandLine** `string`

Filter by display value for Coworker.LandLine..

**AiChannelSession\_Coworker\_BillingName** `string`

Filter by display value for Coworker.BillingName..

**AiChannelSession\_Coworker\_CompanyName** `string`

Filter by display value for Coworker.CompanyName..

**AiChannelSession\_Coworker\_TeamNames** `string`

Filter by display value for Coworker.TeamNames..

**AiChannelSession\_Channel** `string`

Filter by channel the conversation runs on, stored as text: Chat for the web widget, Email, WhatsApp or Voice for inbound contact; proactive outreach also writes CoworkerMessage and HelpDesk. Determines how ExternalIdentifier is interpreted..

**AiChannelSession\_ExternalIdentifier** `string`

Filter by how the outside contact is addressed on this channel: an email address for Email, a phone number for WhatsApp and Voice. It is how a conversation is matched to an incoming reply, and how dormant non-member leads are followed up..

**AiChannelSession\_ChatSession** `string`

Filter by gUID that groups the conversation’s messages. Every OpenAiChatMessage in this conversation carries the same value, so it is the key to reading the transcript..

**AiChannelSession\_ExternalThreadId** `string`

Filter by threading key from the channel provider — the email In-Reply-To/References header, or the WhatsApp conversation ID — used to attach later replies to this same conversation..

**AiChannelSession\_LastActivityUtc** `string`

Filter by uTC time of the most recent message in either direction. Drives conversation ordering, session expiry, and the dormant-lead follow-up agent..

**AiChannelSession\_Subject** `string`

Filter by conversation subject, taken from the first email or inferred from the opening messages. On the Email channel a different subject from the same address starts a new conversation rather than continuing this one..

**AiChannelSession\_EscalationStatus** `integer`

Filter by how far this conversation has been handed over to a person: None while the AI is handling it alone; Pending once the AI escalates and a help desk ticket is waiting; Active once someone comments on that ticket or an operator takes the thread; Resolved when the ticket is closed..

### Range Filters

**from\_AiChannelSession\_LastActivityUtc** `string`

Filter by uTC time of the most recent message in either direction. Drives conversation ordering, session expiry, and the dormant-lead follow-up agent. greater than or equal to this value. Format: `YYYY-MM-DDTHH:mm`.

**to\_AiChannelSession\_LastActivityUtc** `string`

Filter by uTC time of the most recent message in either direction. Drives conversation ordering, session expiry, and the dormant-lead follow-up agent. less than or equal to this value. Format: `YYYY-MM-DDTHH:mm`.

**from\_AiChannelSession\_CreatedOn** `string`

Filter records created on or after this date. Format: `YYYY-MM-DDTHH:mm`.

**to\_AiChannelSession\_CreatedOn** `string`

Filter records created on or before this date. Format: `YYYY-MM-DDTHH:mm`.

**from\_AiChannelSession\_UpdatedOn** `string`

Filter records updated on or after this date. Format: `YYYY-MM-DDTHH:mm`.

**to\_AiChannelSession\_UpdatedOn** `string`

Filter records updated on or before this date. Format: `YYYY-MM-DDTHH:mm`.

## Code Examples

### Simple listing

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

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

data = response.json()
```

### Filtering by Channel

```bash cURL theme={null}
curl -X GET \
  "https://spaces.nexudus.com/api/sys/aichannelsessions?AiChannelSession_Channel=example-value&orderBy=Channel&dir=0" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

```javascript JavaScript theme={null}
const response = await fetch(
  'https://spaces.nexudus.com/api/sys/aichannelsessions?' + new URLSearchParams({
    AiChannelSession_Channel: 'example-value',
    orderBy: 'Channel',
    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/sys/aichannelsessions',
    params={
        'AiChannelSession_Channel': 'example-value',
        'orderBy': 'Channel',
        'dir': 0 // Ascending
    },
    headers={
        'Authorization': 'Bearer YOUR_TOKEN'
    }
)

data = response.json()
```

### Range filters

```bash cURL theme={null}
curl -X GET \
  "https://spaces.nexudus.com/api/sys/aichannelsessions?from_AiChannelSession_UpdatedOn=2025-01-01T00:00&to_AiChannelSession_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/sys/aichannelsessions?' + new URLSearchParams({
    from_AiChannelSession_UpdatedOn: '2025-01-01T00:00',
    to_AiChannelSession_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/sys/aichannelsessions',
    params={
        'from_AiChannelSession_UpdatedOn': '2025-01-01T00:00',
        'to_AiChannelSession_UpdatedOn': '2025-12-31T23:59',
        'orderBy': 'UpdatedOn',
        'dir': 1 // Descending
    },
    headers={
        'Authorization': 'Bearer YOUR_TOKEN'
    }
)

data = response.json()
```

## Response

### 200

**Records** `AiChannelSession[]`

The list of AiChannelSession records matching the query. See the [Get one AiChannelSession](https://learn.nexudus.com/rest-api/sys/get-aichannelsessions-by-id.md) endpoint for the full list of properties returned for each record.

**CurrentPage** `integer`

Current page number.

**CurrentPageSize** `integer`

Number of records per page.

**CurrentOrderField** `string`

The field used for sorting.

**CurrentSortDirection** `integer`

The sort direction (`0` = ascending, `1` = descending).

**FirstItem** `integer`

Index of the first item on the current page.

**LastItem** `integer`

Index of the last item on the current page.

**TotalItems** `integer`

Total number of matching records across all pages.

**TotalPages** `integer`

Total number of pages.

**HasNextPage** `boolean`

Whether there is a next page of results.

**HasPreviousPage** `boolean`

Whether there is a previous page of results.

```json Example Response theme={null}
{
  "Records": [
    {
      "BusinessId": 0,
      "CoworkerId": null,
      "CoworkerCoworkerType": null,
      "CoworkerFullName": null,
      "CoworkerMobilePhone": null,
      "CoworkerLandLine": null,
      "CoworkerBillingName": null,
      "CoworkerCompanyName": null,
      "CoworkerTeamNames": null,
      "Channel": "",
      "ExternalIdentifier": "",
      "ChatSession": null,
      "ExternalThreadId": null,
      "LastActivityUtc": null,
      "Subject": null,
      "EscalationStatus": 0,
      "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": "AiChannelSession Example",
      "LocalizationDetails": null,
      "CustomFields": null
    }
  ],
  "CurrentPageSize": 15,
  "CurrentPage": 1,
  "CurrentOrderField": "Channel",
  "CurrentSortDirection": 1,
  "FirstItem": 1,
  "HasNextPage": false,
  "HasPreviousPage": false,
  "LastItem": 1,
  "PageNumber": 1,
  "PageSize": 15,
  "TotalItems": 1,
  "TotalPages": 1
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.