> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# QueryScheduleItems

# Package: eventManagement

# Namespace: ScheduleManagement

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/events/event-management/schedule-items/query-schedule-items?apiView=SDK.md

## Permission Scopes:
Read Events - all read permissions: SCOPE.DC-EVENTS-MEGA.READ-EVENTS

## Introduction

Retrieves a list of up to 100 schedule items given the provided paging, filtering, and sorting.

Query Schedule Items runs with these defaults, which you can override:
- `timeSlotStart` and `timeSlotEnd` in `ASC` order

To learn about working with _Query_ endpoints, see
[API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md),
[Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging.md),
and [Field Projection](https://dev.wix.com/docs/rest/articles/getting-started/field-projection.md).

---

## REST API

### Schema

```
 Method: queryScheduleItems
 Description: Retrieves a list of up to 100 schedule items given the provided paging, filtering, and sorting.  Query Schedule Items runs with these defaults, which you can override: - `timeSlotStart` and `timeSlotEnd` in `ASC` order  To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/rest/articles/getting-started/field-projection.md).
 URL: https://www.wixapis.com/events/v1/schedule/query
 Method: POST
 Method parameters:
   param name: query | type: QueryV2    
        - name: filter | type: object | description: Filter. See [supported fields and operators](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-query-events).  
        - name: sort | type: array<Sorting> | description: Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}] See [supported fields](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-query-events).  | validation: maxItems 20
           - name: fieldName | type: string | description: Name of the field to sort by  | validation: maxLength 100
           - name: order | type: SortOrder | description: Sort order (ASC/DESC). Defaults to ASC  
                 - enum: ASC, DESC
 Query fields:
   - field: id | operators: $eq, $ne, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: eventId | operators: $eq, $ne, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: name | operators: $eq, $ne, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: description | operators: $eq, $ne, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: stageName | operators: $eq, $ne, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: createdDate | operators: $eq, $ne, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: updatedDate | operators: $eq, $ne, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryScheduleItemsResponse
  - name: pagingMetadata | type: PagingMetadataV2 | description:   
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - 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: items | type: array<ScheduleItem> | description: Schedule items.  
     - name: id | type: string | description: Schedule item GUID.  | read-only: true | validation: format GUID
     - name: hidden | type: boolean | description: Whether a schedule item is hidden from guests.  
     - name: name | type: string | description: Schedule item name.  | validation: maxLength 120
     - name: timeSlot | type: TimeInterval | description: Time slot of a schedule item.  
        - name: start | type: string | description: Start of the time slot interval, inclusive.  | validation: format date-time
        - name: end | type: string | description: End of the time slot interval, exclusive.  | validation: format date-time
        - name: timeZoneId | type: string | description: Time zone GUID in TZ database format, e.g., `"EST"`, `"America/Los_Angeles"`. Defaults to `"Etc/UTC"` when not set.  | validation: minLength 1, maxLength 100
     - name: description | type: string | description: Rich text schedule item description.  | validation: maxLength 10000
     - name: stageName | type: string | description: Stage or room name in which a session takes place.  | validation: maxLength 30
     - name: tags | type: array<string> | description: Schedule item tags. Used to organize the items by a theme.  | validation: maxItems 5, minLength 1, maxLength 30
     - name: status | type: ScheduleStatus | description: Schedule item status.  
         - enum:
         -     SCHEDULED: Item is scheduled for a future date.
         -     CANCELED: Item is canceled.
     - name: createdDate | type: string | description: Date and time the schedule item was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the schedule item was updated.  | read-only: true | validation: format date-time
     - name: eventId | type: string | description: Event GUID to which the schedule item belongs.  | read-only: true | validation: format GUID
     - name: draft | type: boolean | description: Whether the schedule item is a draft.  | read-only: true 

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: FILTER_PARSER_ERROR | Description: The filter expression can't be parsed.


```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.events.schedule.queryScheduleItems(query)
 Description: Retrieves a list of up to 100 schedule items given the provided paging, filtering, and sorting.  Query Schedule Items runs with these defaults, which you can override: - `timeSlotStart` and `timeSlotEnd` in `ASC` order  To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/rest/articles/getting-started/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:  query
 Method parameters: 
   param name: query | type: ScheduleItemQuery   | required: true 
   EMPTY-OBJECT {}
        - name: filter | type: object | description: Filter. See [supported fields and operators](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-query-events).  
        - name: sort | type: array<Sorting> | description: Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}] See [supported fields](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-query-events).  | validation: maxItems 20
           - name: fieldName | type: string | description: Name of the field to sort by  | validation: maxLength 100
           - name: order | type: SortOrder | description: Sort order (ASC/DESC). Defaults to ASC  
                 - enum: ASC, DESC
 Query fields:
   - field: _id | operators: $eq, $ne, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: eventId | operators: $eq, $ne, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: name | operators: $eq, $ne, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: description | operators: $eq, $ne, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: stageName | operators: $eq, $ne, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _createdDate | operators: $eq, $ne, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _updatedDate | operators: $eq, $ne, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryScheduleItemsResponse>
  - name: pagingMetadata | type: PagingMetadataV2 | description:   
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - 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: items | type: array<ScheduleItem> | description: Schedule items.  
     - name: _id | type: string | description: Schedule item GUID.  | read-only: true | validation: format GUID
     - name: hidden | type: boolean | description: Whether a schedule item is hidden from guests.  
     - name: name | type: string | description: Schedule item name.  | validation: maxLength 120
     - name: timeSlot | type: TimeInterval | description: Time slot of a schedule item.  
        - name: start | type: Date | description: Start of the time slot interval, inclusive.  
        - name: end | type: Date | description: End of the time slot interval, exclusive.  
        - name: timeZoneId | type: string | description: Time zone GUID in TZ database format, e.g., `"EST"`, `"America/Los_Angeles"`. Defaults to `"Etc/UTC"` when not set.  | validation: minLength 1, maxLength 100
     - name: description | type: string | description: Rich text schedule item description.  | validation: maxLength 10000
     - name: stageName | type: string | description: Stage or room name in which a session takes place.  | validation: maxLength 30
     - name: tags | type: array<string> | description: Schedule item tags. Used to organize the items by a theme.  | validation: maxItems 5, minLength 1, maxLength 30
     - name: status | type: ScheduleStatus | description: Schedule item status.  
         - enum:
         -     SCHEDULED: Item is scheduled for a future date.
         -     CANCELED: Item is canceled.
     - name: _createdDate | type: Date | description: Date and time the schedule item was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the schedule item was updated.  | read-only: true 
     - name: eventId | type: string | description: Event GUID to which the schedule item belongs.  | read-only: true | validation: format GUID
     - name: draft | type: boolean | description: Whether the schedule item is a draft.  | read-only: true 

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: FILTER_PARSER_ERROR | Description: The filter expression can't be parsed.


```

### Examples

### queryScheduleItems
```javascript
import { schedule } from '@wix/events';

async function queryScheduleItems(query) {
  const response = await schedule.queryScheduleItems(query);
};
```

### queryScheduleItems (with elevated permissions)
```javascript
import { schedule } from '@wix/events';
import { auth } from '@wix/essentials';

async function myQueryScheduleItemsMethod(query) {
  const elevatedQueryScheduleItems = auth.elevate(schedule.queryScheduleItems);
  const response = await elevatedQueryScheduleItems(query);
}
```

### queryScheduleItems (self-managed)
Self-managed 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 { schedule } from '@wix/events';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function queryScheduleItems(query) {
  const response = await myWixClient.schedule.queryScheduleItems(query);
};
```

---