POST

Query Sessions


Deprecated

This method has been replaced with Query Events, and will be removed on June 30, 2025.

Retrieves a list of sessions, given the provided time range, filtering, and paging.

Deprecation Notice:

This endpoint has been replaced with Calendar V3 Query Events and External Calendar V2 List Events and will be removed on June 30, 2025.

To query for event instances within a specified time range of up to 1 year, provide a startDate and endDate.

Query Sessions runs with these defaults, which you can override:

  • Only sessions of type EVENT are returned. An event is a single or recurring session that appears in a calendar, for example an appointment or a class.
  • instances is true. This means only single session instances and instances of recurring sessions are returned.
  • includeExternal is false. This means that sessions imported from connected external calendars are not returned.
  • Session objects are returned with the fields specified in the NO_PI fieldset. This means they don't contain personal information.
  • query.cursorPaging.limit is 100.

Note the following limitations, which you can't override:

  • Sessions are always sorted by start.timestamp in ASC order.
  • The maximum time range you can query for session instances is 1 year. If you are querying for recurring session definitions, rather than session instances, this limit doesn't apply.
  • Pagination is not supported for recurring session definition queries.

To query only for working hours sessions, set type to WORKING_HOURS. A working hours session is a single or recurring session that defines availability in a schedule.

To query for all session types, including events and working hours sessions, set type to ALL.

To query for recurring session pattern definitions, set instances to false. In this case, fromDate and toDate may be more than 1 year apart.

To return session objects including personal information, use the ALL_PI fieldset. This requires the Read Bookings Calendar - Including Participants or the Manage Bookings Services and Settings or the Manage Business Calendar permission scope.

For details on fieldsets, see Sessions: Supported Fieldsets.

For field support for filters, see Sessions: Supported Filters.

To learn about working with Query endpoints in general, see API Query Language and Field Projection.

Permissions
Manage Bookings - all permissions
Read Bookings - all read permissions
Manage Bookings
Read Bookings - Public Data
Read Bookings - Including Participants
Read Bookings Calendar Availability
Read bookings calendar - including participants
Read Bookings Calendar
Manage Bookings Services and Settings
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/bookings/v2/velo/sessions/query

Body Params
fromDatestringformat date-time

Start of the time range for which sessions are returned, in ISO 8601 format.

Sessions that begin before the fromDate but end after it are included in the results. For recurring session definitions, this means the start value is before the fromDate and the UNTIL value in the recurrence property is after the fromDate.

Required, unless query.cursorPaging is provided.


toDatestringformat date-time

End of the time range for which sessions are returned, in ISO 8601 format.

Sessions that begin before the toDate but end after it are included in the results. For recurring session definitions, this means the start value is before the toDate and the UNTIL value in the recurrence property is after the toDate.

Required, unless query.cursorPaging is provided.

Max: 1 year after fromDate for session instance queries. This limit doesn't apply to recurring session definition queries.


queryQuery

Query options.


typestring

Type of sessions to return.

  • EVENT: Returns only sessions of type EVENT.
  • WORKING_HOURS: Returns only sessions of type WORKING_HOURS.
  • ALL: Returns sessions of all types.

Default: EVENT.


instancesboolean

Whether to return only single session instances and instances of recurring sessions.

If true, only single session instances and instances of recurring sessions are returned.

If false, only recurring session definitions are returned. Note: Cursor pagination is not supported for recurring session definition queries.

Default: true.


includeExternalboolean

Whether to include sessions imported from connected external calendars in the results.

Default: false.

Response Object
sessionsArray <Session>

List of sessions matching the query.


pagingMetadataPagingMetadata

Paging metadata.

Request
cURL
curl -X POST 'https://www.wixapis.com/bookings/v2/calendar/sessions/query' \ -H 'Authorization: <AUTH>' \ -H 'Content-Type: application/json' \ -d '{ "fromDate": "2022-12-25T00:00:00Z", "toDate": "2022-12-31T00:00:00Z", "instances": true }'
Response
JSON
{ "sessions": [ { "id": "193ZPR9ppP9emJUCLevcLf6orynNEIDt5nc0520xjGQILnPPaF5s62yK3BWz7ExgIRM1Hdp0Ird6iyxZHRVdpbgnFQ1A8TFAqwlb99bRYhgPbdrsM2KdA4n8FTg8WSwi5SBXcLVvpJKmHIqcD34lFwvaZDMhHc1Qoa3MnL6EbXON6JusUwKE9aZDI3PqT1WZcPMPsQuzOgSsBUy8NRZcLzDhHZ57ZCR6WOBBKEXepun53wXZ10birRy12YgkpdMjZ7baghNVRN8vmLDnkZccaQiMvpcNeey0u0FwXoNIszi00YKGp21ZFV6Bcd2w3D3hhO5e0ENvMnZ41t", "scheduleId": "44de147c-5405-4601-8491-de514d815bf2", "scheduleOwnerId": "9fe3d2d6-bbb4-46bf-805d-5cc276c12e73", "start": { "timestamp": "2022-12-18T09:30:00Z", "localDateTime": { "year": 2022, "monthOfYear": 12, "dayOfMonth": 18, "hourOfDay": 11, "minutesOfHour": 30 }, "timeZone": "Asia/Jerusalem" }, "end": { "timestamp": "2022-12-18T11:00:00Z", "localDateTime": { "year": 2022, "monthOfYear": 12, "dayOfMonth": 18, "hourOfDay": 13, "minutesOfHour": 0 }, "timeZone": "Asia/Jerusalem" }, "affectedSchedules": [ { "scheduleId": "8f78fe42-f522-44d6-acce-38a0b0c47dc9", "transparency": "BUSY", "scheduleOwnerId": "196a406f-f54b-4602-8f41-0a4be7562f1d", "scheduleOwnerName": "MICHAEL" } ], "title": "The 7 Kings", "tags": ["GROUP"], "location": { "locationType": "OWNER_BUSINESS", "businessLocation": { "id": "5a5b25b0-4005-4f92-b2cb-802448ecd6c1", "name": "Tel Aviv-Yafo", "default": false, "status": "ACTIVE", "locationType": "UNKNOWN", "timeZone": "Europe/Dublin", "phone": "", "revision": "2", "archived": false } }, "capacity": 50, "remainingCapacity": 50, "rate": { "labeledPriceOptions": { "general": { "amount": "5", "currency": "EUR", "downPayAmount": "0" } } }, "notes": "", "totalNumberOfParticipants": 0, "participants": [], "inheritedFields": [ "affectedSchedules", "calendarConference", "capacity", "end", "externalCalendarOverrides", "location", "rate", "start", "tags", "title" ], "status": "CONFIRMED", "recurringSessionId": "44de147c540546018491de514d815bf2-177e5b08160149eba112ea7b698b4a82", "type": "EVENT", "instanceOfRecurrence": "FREQ=WEEKLY;INTERVAL=1;BYDAY=SU", "version": { "scheduleVersion": 21, "sessionVersion": 0, "participantsVersion": 0 } }, { "id": "193ZPR9ppP9emJUCLevcLf6orynNEIDt5nc0520xjGQILnPPaF5s62yK3BWz7ExgIRM1Hv8vR80J28PRbGViGmpjKzJyheWVgfa6t5bWNQIgUMccjenHiovFUcmT74dMuPhczZ2Udi26JNVesJlGWqWFuB5NxtZamktCmoOluLcopBYGxjlGF7RBpgljNouOMCNHrWMWWI9gg4MjgzCQAoCk5rSUUlxfjBpL9ssatQ3GWgAQsw9MMRchYhRqPb7D5oPg1Y6cG8DqgxkOqseLKEft5EqG82lmNZ0nwIjF2ubpl0O1XZjcoIS4bL8uFIvgehtjtQymMDKBaf", "scheduleId": "58aabcad-45bf-4270-ac89-2ee77e674c0a", "scheduleOwnerId": "8b0e1e3c-9923-4a60-acb3-f2f83188fbd7", "start": { "timestamp": "2022-12-18T11:00:00Z", "localDateTime": { "year": 2022, "monthOfYear": 12, "dayOfMonth": 18, "hourOfDay": 13, "minutesOfHour": 0 }, "timeZone": "Asia/Jerusalem" }, "end": { "timestamp": "2022-12-18T12:30:00Z", "localDateTime": { "year": 2022, "monthOfYear": 12, "dayOfMonth": 18, "hourOfDay": 14, "minutesOfHour": 30 }, "timeZone": "Asia/Jerusalem" }, "affectedSchedules": [ { "scheduleId": "c7831755-b08c-48bb-925a-43515c8c28df", "transparency": "BUSY", "scheduleOwnerId": "e5d9dedc-dc5e-4900-a327-78b61de92241", "scheduleOwnerName": "VERONICA" } ], "title": "The City of David", "tags": ["GROUP"], "location": { "locationType": "OWNER_BUSINESS", "businessLocation": { "id": "5a5b25b0-4005-4f92-b2cb-802448ecd6c1", "name": "Tel Aviv-Yafo", "default": false, "status": "ACTIVE", "locationType": "UNKNOWN", "timeZone": "Europe/Dublin", "phone": "", "revision": "2", "archived": false } }, "capacity": 50, "remainingCapacity": 50, "rate": { "labeledPriceOptions": { "general": { "amount": "5", "currency": "EUR", "downPayAmount": "0" } } }, "notes": "", "totalNumberOfParticipants": 0, "participants": [], "inheritedFields": [ "affectedSchedules", "calendarConference", "capacity", "end", "externalCalendarOverrides", "location", "rate", "start", "tags", "title" ], "status": "CONFIRMED", "recurringSessionId": "58aabcad45bf4270ac892ee77e674c0a-c24f616b27504634bee10eec8911c4a1", "type": "EVENT", "instanceOfRecurrence": "FREQ=WEEKLY;INTERVAL=1;BYDAY=SU", "version": { "scheduleVersion": 31, "sessionVersion": 0, "participantsVersion": 0 } } ], "pagingMetadata": { "cursors": { "next": "JWE.eyJhbGciOiJBMTI4S1ciLCJ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Blh-p_tOzBphGvLltEc3-CSs6MXonMmjuyykuumvqrcPgnN7BSklCPu3ESM4Nd9kSGqPLzbbwqYGyGXgYg7I4XaaSNMHspXdFj8ioZVgewJE161DUcIW-kA4jlKumziIk2OmF5OK6oGYJNEXWC_vjLPRe6NYKH_snYn2_IAnULYtoVHQhphuDoTjCQ3RiurtDX_rhLOOXwENSYjbAizITB0oYlG6GdNa38bo-UgOWLCDNw6cVA7PJ_DsIzDCdGLp7q2bXtGa0Diud9RLP7YMZFmUfueEwPqQbt0mdYjyzr5hVVoGNgkcnCBB8FejWvAiK6--ctQJ9T5YHrsNC03EYai4Vx-WGcQsVcDzGgYng.lTwrVvfll8UKJvAoSBrybg" } } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?