Retrieve the schedules of classes in multiple centers
This API helps you to retrieve the list of active schedules of classes sessions in multiple centers.
You must provide the appropriate details in the API request for the center_id parameters. Optionally, you can also specify the required details in the API request for several other parameters to filter the search results in the API response. Refer to the Request Parameters table for more information.
On this page
Before you begin
- You need a valid API key or access token. See Set up API authentication.
Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.
Endpoint
GET /v1/classes/sessions
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| center_id | string | Yes | — | Mandatory Unique identifier of the specified multiple centers (separated by commas) for which you want to retrieve active class sessions. |
| page | integer (int32) | No | — | Optional Number of pages of search results to be displayed. |
| class_name | string | No | — | Optional Name of a particular type of classes for which the search results are to be displayed. For example, "cardio." |
| start_date | string (date) | No | — | Optional Sessions will be returned from the specified start date. You must specify this date in YYYY-MM-DD format. If you do not provide any time details for this parameter, the API considers its default value: 00:00:00 |
| end_date | string (date) | No | — | Optional Sessions will be returned until the specified end date. You must specify this date in YYYY-MM-DD format. If you do not provide any time details for this parameter, the API considers its default value: 00:00:00. |
| show_in_catalog | integer (int32) | No | — | Optional You must specify 1 if you want only catalog sessions to be returned in the API response. |
| status | enum () | No | — | Optional Indicates the class session status: Active = 0, Cancelled = 1, Upcoming = 2, Inprogress = 3, and Completed = 4. |
| session_id | integer (int32) | No | — | Optional Unique identifier of the required class session to be booked. |
| registration_id | integer (int32) | No | — | Optional Unique identifier of the class session for which the guest was registered. |
| filters[0].property | string | No | — | Optional Name of the Level ID property column to filter the API response as required. |
| filters[0].value | integer (int32) | No | — | Optional Value of the Level ID property column to filter the API response as required. |
| filters[1].property | string | No | — | Optional Name of the Class ID property column to filter the API response as required. |
| filters[1].value | integer (int32) | No | — | Optional Value of the Class ID property column to filter the API response as required. |
| filters[2].property | string | No | — | Optional Name of the Instructor ID property column to filter the API response as required. |
| filters[2].value | integer (int32) | No | — | Optional Value of the Instructor ID property column to filter the API response as required. |
| filters[3].property | string | No | — | Optional Name of the Tag Name property column to filter the API response as required. |
| filters[3].value | integer (int32) | No | — | Optional Value of the Tag Name property column to filter the API response as required. |
| filters[4].property | string | No | — | Optional Name of the Category Parent ID property column to filter the API response as required. |
| filters[4].value | integer (int32) | No | — | Optional Value of the Category Parent ID property column to filter the API response as required. |
| class_id | string | No | — | Optional Unique identifier of the required class. |
| recurrence_id | string | No | — | Optional Unique identifier of the recurrence of the required class. |
| session_name | string | No | — | Optional Name of the class session. |
| guest_id | string | No | — | Optional Unique identifier of the required guest. |
| size | integer (int32) | No | — | Optional Total records to be displayed in a page. |
Response
Success (200 OK)
{
"sessions": [
{
"...": "..."
}
],
"classes": [
{
"...": "..."
}
],
"instructors": [
{
"...": "..."
}
],
"categories": [
{
"...": "..."
}
],
"rooms": [
{
"...": "..."
}
],
"levels": [
{
"...": "..."
}
],
"opening_time": "17:30",
"page_details": {
"total": 66,
"page": 1,
"size": 10
},
"error": {}
}
Response fields
| Field | Type | Description |
|---|---|---|
| sessions | object[] | |
| sessions[].id | integer | |
| sessions[].name | string | |
| sessions[].class_id | integer | |
| sessions[].start_time | string | |
| sessions[].end_time | string | |
| sessions[].start_time_utc | string | |
| sessions[].end_time_utc | string | |
| sessions[].price | integer | |
| sessions[].instructor_id | string | |
| sessions[].assistant_id | object | |
| sessions[].room_id | object | |
| sessions[].status | integer | |
| sessions[].recurrence_id | integer | |
| sessions[].center_id | string | |
| sessions[].center_name | string | |
| sessions[].registration_id | object | |
| sessions[].registration_status | object | |
| sessions[].level_id | object | |
| sessions[].is_free_session | boolean | |
| sessions[].can_book | boolean | |
| sessions[].can_cancel | boolean | |
| sessions[].booking_stage | integer | |
| sessions[].capacity | integer | |
| sessions[].web_capacity | integer | |
| sessions[].wait_listed_count | integer | |
| sessions[].occupancy | integer | |
| sessions[].web_occupancy | integer | |
| sessions[].cancel_stage | integer | |
| sessions[].description | string | |
| sessions[].html_description | object | |
| sessions[].available_slots | integer | |
| sessions[].current_waitlist_position | object | |
| sessions[].can_book_status_id | integer | |
| sessions[].can_book_status | string | |
| sessions[].cancellation_fee_window | integer | |
| sessions[].cancellation_fee | number | |
| sessions[].is_instructor_substituted | boolean | |
| classes | object[] | |
| classes[].id | integer | |
| classes[].name | string | |
| classes[].category_id | integer | |
| classes[].start_date | object | |
| classes[].end_date | object | |
| classes[].description | string | |
| classes[].html_description | string | |
| classes[].catalog_price | object | |
| classes[].capacity | object | |
| classes[].allow_web_booking | boolean | |
| classes[].allow_direct_booking | boolean | |
| classes[].allow_cancellation_fee | boolean | |
| classes[].allow_no_show_fee | boolean | |
| classes[].display_name | string | |
| classes[].show_in_catalog | integer | |
| classes[].sort_order | integer | |
| classes[].show_price | boolean | |
| classes[].allow_wait_list | object | |
| classes[].wait_list_lock_window | integer | |
| classes[].enable_enrol | boolean | |
| classes[].level_id | object | |
| classes[].registration_notes | object | |
| classes[].enable_payments | boolean | |
| classes[].image_paths | object | |
| classes[].min_time | object | |
| classes[].max_time | object | |
| classes[].web_capacity | object | |
| classes[].registration_lock_window | integer | |
| classes[].auto_confirm_lock_window | integer | |
| classes[].sac | object | |
| classes[].type | integer | |
| instructors | object[] | |
| instructors[].id | string | |
| instructors[].name | string | |
| instructors[].description | object | |
| instructors[].image_paths | object | |
| categories | object[] | |
| categories[].id | integer | |
| categories[].name | string | |
| categories[].parent_id | integer | |
| rooms | object[] | |
| rooms[].id | string | |
| rooms[].name | string | |
| levels | object[] | |
| levels[].id | integer | |
| levels[].code | string | |
| levels[].name | string | |
| levels[].description | string | |
| levels[].html_description | string | |
| opening_time | string | |
| page_details | object | |
| page_details.total | integer | |
| page_details.page | integer | |
| page_details.size | integer | |
| error | object |
Example
curl --request GET \
--url 'https://api.zenoti.com/v1/classes/sessions?center_id={{center_id}}' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/classes/sessions', {
method: 'GET',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.zenoti.com/v1/classes/sessions',
headers={
'Authorization': 'bearer {{access_token}}',
},
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.GetAsync(
"https://api.zenoti.com/v1/classes/sessions");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/classes/sessions')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)
Error codes
| Status | Description |
|---|---|
| 400 | 400 |
| 401 | Unauthorized -- invalid or expired access token |
| 429 | Too many requests -- rate limit exceeded |