> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# QueryConversations

# Package: containersApp

# Namespace: ContainersChat

# Method link: https://dev.wix.com/docs/api-reference/mobile/containers-app/containers-chat/query-conversations.md

## Introduction

Retrieves a list of up to 1,000 conversations for a project, given the provided paging, filtering, and sorting.

Query Conversations runs with these defaults, which you can override:
- `createdDate` is sorted in `DESC` order
- `paging.limit` is `50`

To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md).

---

## REST API

### Schema

```
 Method: queryConversations
 Description: Retrieves a list of up to 1,000 conversations for a project, given the provided paging, filtering, and sorting.  Query Conversations runs with these defaults, which you can override: - `createdDate` is sorted in `DESC` order - `paging.limit` is `50`  To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md).
 URL: https://www.wixapis.com/containers/chat/v1/conversations/query
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  projectId
 Method parameters: 
   param name: projectId | type: projectId | description: GUID of the project whose conversations to retrieve. | required: true | validation: format GUID
   param name: query | type: CursorQuery    
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  | validation: maxItems 5
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
 Query fields:
   - field: id | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: projectId | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: createdDate | operators: $eq, $ne, $exists, $in, $hasSome, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryConversationsResponse
  - name: conversations | type: array<Conversation> | description: Retrieved conversations.  
     - name: id | type: string | description: Conversation GUID.  | read-only: true | validation: format GUID
     - name: projectId | type: string | description: GUID of the project this conversation belongs to.  | validation: format GUID
     - name: sessionId | type: string | description: Agent session GUID. Set when a build job begins; used to resume the coding agent session.  | validation: format GUID
     - name: status | type: ConversationStatus | description: Conversation status.  
         - enum:
         -     ACTIVE: The conversation is open and active.
         -     ARCHIVED: The conversation is archived. Currently not in use.
     - name: title | type: string | description: Conversation title. Currently defaults to `new chat`.  | validation: maxLength 200
     - name: createdDate | type: string | description: Date and time the conversation was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the conversation was last updated.  | read-only: true | validation: format date-time
     - name: revision | type: string | description: Revision number, which increments by 1 each time the conversation is updated. To prevent conflicting changes, the current revision must be passed when updating the conversation.  | read-only: true | validation: format int64
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  + `true`: Another page of results can be retrieved. + `false`: This is the last page.  


```

### Examples

### Query Conversations
Retrieves a list of conversations for a project.

```curl
curl -X POST \
  'https://www.wixapis.com/containers/chat/v1/conversations/query' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  -d '{
    "projectId": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
    "query": {
      "cursorPaging": {
        "limit": 10
      }
    }
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.containers.chat.queryConversations(query, options)
 Description: Retrieves a list of up to 1,000 conversations for a project, given the provided paging, filtering, and sorting.  Query Conversations runs with these defaults, which you can override: - `createdDate` is sorted in `DESC` order - `paging.limit` is `50`  To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  options.projectId, query, options
 Method parameters: 
   param name: options | type: QueryConversationsOptions  none | required: true 
        - name: projectId | type: string | description: GUID of the project whose conversations to retrieve. | required: true | validation: format GUID
   param name: query | type: ConversationQuery   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  | validation: maxItems 5
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
 Query fields:
   - field: _id | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: projectId | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _createdDate | operators: $eq, $ne, $exists, $in, $hasSome, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryConversationsResponse>
  - name: conversations | type: array<Conversation> | description: Retrieved conversations.  
     - name: _id | type: string | description: Conversation GUID.  | read-only: true | validation: format GUID
     - name: projectId | type: string | description: GUID of the project this conversation belongs to.  | validation: format GUID
     - name: sessionId | type: string | description: Agent session GUID. Set when a build job begins; used to resume the coding agent session.  | validation: format GUID
     - name: status | type: ConversationStatus | description: Conversation status.  
         - enum:
         -     ACTIVE: The conversation is open and active.
         -     ARCHIVED: The conversation is archived. Currently not in use.
     - name: title | type: string | description: Conversation title. Currently defaults to `new chat`.  | validation: maxLength 200
     - name: _createdDate | type: Date | description: Date and time the conversation was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the conversation was last updated.  | read-only: true 
     - name: revision | type: string | description: Revision number, which increments by 1 each time the conversation is updated. To prevent conflicting changes, the current revision must be passed when updating the conversation.  | read-only: true | validation: format int64
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  + `true`: Another page of results can be retrieved. + `false`: This is the last page.  


```

### Examples

### Query conversations for a project
```javascript
import { chat } from "@wix/containers";

async function queryConversations() {
  const response = await chat.queryConversations(
    {
      sort: [{ fieldName: "createdDate", order: "DESC" }],
      cursorPaging: { limit: 10 },
    },
    { projectId: "8046df3c-7575-4098-a5ab-c91ad8f33c47" },
  );
}

/* Promise resolves to:
 * {
 *   "conversations": [
 *     {
 *       "_id": "1f5b2c8e-9a3d-4c21-8b77-2d2f6e0a9c10",
 *       "projectId": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
 *       "status": "ACTIVE",
 *       "title": "new chat",
 *       "revision": 1,
 *       "_createdDate": "2026-07-29T09:00:00.000Z",
 *       "_updatedDate": "2026-07-29T09:00:00.000Z"
 *     }
 *   ],
 *   "pagingMetadata": {
 *     "count": 1,
 *     "cursors": {},
 *     "hasNext": false
 *   }
 * }
 */

```

### queryConversations (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { chat } from '@wix/containers';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { chat },
  // Include the auth strategy and host as relevant
});


async function queryConversations(query,options) {
  const response = await myWixClient.chat.queryConversations(query,options);
};
```

---