> 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

## Resource: wix-bookings-backend

## Namespace: sessions

## Article: Introduction

## Article Link: https://dev.wix.com/docs/velo/apis/wix-bookings-backend/sessions/introduction.md

## Article Content:

# Introduction
The Sessions API provides functionality for creating, managing, and querying sessions.

<blockquote class='warning'>

__Deprecation Notice:__

The **Bookings V1 Sessions Velo API** has been replaced with the [Calendar Events](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/introduction?apiView=SDK.md) and [Bookings V2](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/introduction?apiView=SDK.md) SDK APIs and will be removed on June 30, 2026. Learn more about [how Wix Bookings uses the Calendar APIs](https://dev.wix.com/docs/sdk/backend-modules/calendar/wix-bookings-integration?apiView=SDK.md).

</blockquote>

A session is one of the following:
+ `"EVENT"`: Reserved period of time on any [schedule](https://dev.wix.com/docs/velo/api-reference/wix-bookings-backend/sessions/introduction.md#api-reference_wix-bookings-backend_sessions_schedules). For example, an appointment, class, or course. Events are visible in the Dashboard on the Bookings app's [**Booking Calendar**](https://support.wix.com/en/article/wix-bookings-about-the-wix-bookings-calendar) page.
+ `"WORKING_HOURS"` : Placeholder for available time on a resource’s schedule.

Sessions belong to a schedule. Schedules are owned by a resource or a service.

### Recurrence
A session may be an individual session or a recurring session. 
An individual session has a discrete start and end date, while a recurring session defines a series of repeating sessions. A session is a recurring session if the `recurrence` property contains a recurrence rule.  A session is an instance of a recurring session if the `instanceOfRecurrence` property contains a recurrence rule and the `recurrence` property is `null`.
Changing a recurring session will update the future recurrence instances. If the `start` or `end` time has been changed on an instance, updates to `start` or `end` on the recurring session may not be updated on the instance. See [`updateSession()`](https://dev.wix.com/docs/velo/apis/wix-bookings-backend/sessions/update-session.md) for details.

The recurrence is defined using a subset of recurrence rules ([RRULEs](https://icalendar.org/iCalendar-RFC-5545/3-3-10-recurrence-rule.html)).

The following RRULE parameters are supported:

|Keyword|Description|Supported values|
|--|--|---|
|`FREQ`|The frequency at which the session is recurs. Required.|`WEEKLY`|
|`INTERVAL`|How often, in terms of `FREQ`, the session recurs. Default is 1. Optional.|
|`UNTIL`|The UTC end date and time of the recurrence. Optional.|
|`BYDAY`|Day of the week when the event should recur. Required.|One of: `MO`, `TU`, `WE`, `TH`, `FR`, `SA`, `SU`|

For example, a session that repeats every second week on a Monday until January 7, 2022 at 8 AM:
`"FREQ=WEEKLY;INTERVAL=2;BYDAY=MO;UNTIL=20220107T080000Z"`

<!--Expose when services are exposed
A session includes an optional list of `affectedSchedules`. This is a list of linked schedules and the way each schedule's availability is affected. For example, the schedule of an instructor is linked to the session for the class that they instruct. 
END:-->

### Tags
Sessions have tags that can be used to group sessions. The Wix Bookings app uses the following system tags: 
+ `"Blocked"`: Used to create a session that blocks the resource's availability, but is not related to a service. Use this tag to schedule non-working hours where the resource is not available. 
+ `"google"`: Used by the app for events created by Google applications. Google events are read-only.

<!--Expose when services are exposed
### Inheritance
Sessions inherit properties from the schedules that they belong to. You can override inherited properties for each session unless the session is a recurring session. The following lists the session properties that are inherited from the schedule.

+ `affectedSchedules`, from `Schedule.availability.linkedSchedules`
+ `title`
+ `tags`
+ `location`
+ `capacity`
+ `rate`
END:-->

### Schedules
A schedule is a collection of [sessions](https://dev.wix.com/docs/velo/apis/wix-bookings-backend/sessions/introduction.md) and the information needed to calculate availability.
A schedule is owned by either a service or a resource. The `scheduleOwnerId` property contains the ID of the owning resource or service.

<!--Expose when services are exposed
Schedules contain metadata for the following areas:
+ Availability
+ Pricing
+ Location
+ Participants
+ Conference calls

The Bookings app uses the schedule's `availability` object to calculate availability on the schedule owner's calendar. The availability object contains an array of `linkedSchedules`. This array contains a list of other schedules that impact this schedule’s availability. The `transparency` property defines how this schedules’ availability is affected:
- When `transparency` is set to `”FREE"`:
  - Availability is calculated for this schedule based on the linked schedule.
  - Bookings made on the linked schedules do not affect this schedule. 
- When `transparency` is set to `”BUSY”`:
  - Availability is calculated for this schedule based on the linked schedule.
  - Bookings made on the linked schedules make this schedule unavailable.
-->
<!--Expose when services are exposed
NEEDS TO BE CLARIFIED . Schedules.LinkedSchedules and Sessions.affectedSchedules. For example, if we have two services, math tutoring and science tutoring, and they are both offered by a tutor called John. John will have both / Both math and science schedules will have John's schedule ID in their linkedSchedules array with a transparency of "BUSY".
Both have transparency `”BUSY”`. When the math service is booked between 3 and 4pm, a session is created for John’s schedule for that time. The science service’s schedule is in John’s list of linked schedules. When availability is calculated for the science service, there will be no slots available between 3 and 4pm, because John is teaching math.

Tags are used for grouping schedules and for specific functions in the Wix Bookings app. 
The Wix Bookings app uses the following predefined tags to set schedule types for services:
`"INDIVIDUAL"`, `"GROUP"`, and `"COURSE”` for appointments, classes and courses. Once the schedule type is set using these tags, you cannot update it.
In addition to the app's tags, you can create and update tags for your own use.

Some data defined in the **Settings** page is inherited by the schedule by default. Inherited fields are:
+ location.businessLocation from the **Business Info** page. 
+ availability.constraints.slotsSplitInterval from the **Appointment Time Slots** section in the **Bookings Policy** page
The `inheritedFields` property lists the fields that were inherited from the **Business Info** page. 
END:-->


To use the Sessions API, import `sessions` from the `wix-bookings-backend` module:

```javascript
import { sessions } from "wix-bookings-backend";
```