> For the complete documentation index, see [llms.txt](https://knowledgebase.flaik.com/flaik-knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/class-management/class-details-by-date-range.md).

# Class Details by Date Range

## Overview

Returns detailed class records — class times, discipline, ability level, locations, the assigned instructors, and the guests booked into each class — for a date range. Use this to ingest historical or upcoming class detail into a data warehouse, reporting tool, or guest-experience system.

{% hint style="warning" %}
**5-day window limit**

The supplied date range must be **5 days or less** (i.e. start and end can be at most 5 days apart). For example, `2025-01-01 → 2025-01-06` is allowed; `2025-01-01 → 2025-01-07` returns a 400. Walk longer windows in 5-day chunks.
{% endhint %}

## Authentication

Include your access token in the Authorization header:

```http
Authorization: Bearer {access_token}
```

See the [Authentication Guide](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/overview/authentication) for details on obtaining access tokens.

## Endpoint

```http
GET {api-url}/api/classmanagement/classes/{startDate}/{endDate}
```

**Path Parameters**

| Parameter   | Type | Required | Description                                                                          |
| ----------- | ---- | -------- | ------------------------------------------------------------------------------------ |
| `startDate` | date | Yes      | First day of the range, inclusive (`YYYY-MM-DD`)                                     |
| `endDate`   | date | Yes      | Last day of the range, inclusive (`YYYY-MM-DD`). Must be ≤ 5 days after `startDate`. |

**Query Parameters**

None.

**Example Request**

```http
GET {api-url}/api/classmanagement/classes/2025-01-15/2025-01-19
Authorization: Bearer {access_token}
```

**Response Format**

```json
[
  {
    "id": 5012,
    "startDateTime": "2025-01-15T09:00:00",
    "endDateTime": "2025-01-15T11:00:00",
    "disciplineId": 1,
    "disciplineName": "Alpine Skiing",
    "abilityLevelId": 3,
    "abilityLevelName": "Beginner",
    "taskId": 11,
    "taskType": 2,
    "taskName": "Group Lesson AM",
    "startLocationId": 7,
    "startLocationName": "Base Lodge",
    "morningSnackLocationId": null,
    "morningSnackLocationName": "",
    "lunchLocationId": 12,
    "lunchLocationName": "Mid-Mountain Café",
    "afternoonSnackLocationId": null,
    "afternoonSnackLocationName": "",
    "pickUpLocationId": 7,
    "pickUpLocationName": "Base Lodge",
    "classGuests": [
      {
        "id": 88011,
        "guestId": 412,
        "identifierCode": "G412",
        "firstName": "Alex",
        "lastName": "Doe",
        "email": "alex.doe@example.com",
        "phone": "+1-555-555-0101",
        "dateOfBirth": "2014-06-22"
      }
    ],
    "classInstructors": [
      {
        "id": 33012,
        "employeeId": 15,
        "identifierCode": "E15",
        "payrollIdentifier": "EMP123456",
        "firstName": "Sam",
        "lastName": "Smith"
      }
    ]
  }
]
```

**Class Record Fields**

| Field                        | Type     | Description                                                                    |
| ---------------------------- | -------- | ------------------------------------------------------------------------------ |
| `id`                         | integer  | Unique class identifier                                                        |
| `startDateTime`              | datetime | Class start (`YYYY-MM-DDTHH:mm:ss`, resort-local time — no offset/zone marker) |
| `endDateTime`                | datetime | Class end (`YYYY-MM-DDTHH:mm:ss`, resort-local time)                           |
| `disciplineId`               | integer  | Discipline identifier (nullable)                                               |
| `disciplineName`             | string   | Discipline display name — empty string if not set                              |
| `abilityLevelId`             | integer  | Ability level identifier (nullable)                                            |
| `abilityLevelName`           | string   | Ability level display name — empty string if not set                           |
| `taskId`                     | integer  | Scheduling product (task definition) identifier (nullable)                     |
| `taskType`                   | integer  | Type of task — see [Task Types](#task-types) below (nullable)                  |
| `taskName`                   | string   | Task display name — empty string if not set                                    |
| `startLocationId`            | integer  | Class start location identifier (nullable)                                     |
| `startLocationName`          | string   | Class start location name — empty string if not set                            |
| `morningSnackLocationId`     | integer  | Morning snack location identifier (nullable)                                   |
| `morningSnackLocationName`   | string   | Morning snack location name — empty string if not set                          |
| `lunchLocationId`            | integer  | Lunch location identifier (nullable)                                           |
| `lunchLocationName`          | string   | Lunch location name — empty string if not set                                  |
| `afternoonSnackLocationId`   | integer  | Afternoon snack location identifier (nullable)                                 |
| `afternoonSnackLocationName` | string   | Afternoon snack location name — empty string if not set                        |
| `pickUpLocationId`           | integer  | Pick-up location identifier (nullable)                                         |
| `pickUpLocationName`         | string   | Pick-up location name — empty string if not set                                |
| `classGuests`                | array    | Guests booked into the class (see Guest Fields below)                          |
| `classInstructors`           | array    | Instructors assigned to the class (see Instructor Fields below)                |

**Guest Fields (`classGuests[]`)**

| Field            | Type    | Description                                                                    |
| ---------------- | ------- | ------------------------------------------------------------------------------ |
| `id`             | integer | Class-guest assignment identifier (unique to this booking)                     |
| `guestId`        | integer | flaik guest identifier (nullable for guests not yet linked to a guest profile) |
| `identifierCode` | string  | External guest identifier — empty string if not set                            |
| `firstName`      | string  | Guest first name — empty string if not set                                     |
| `lastName`       | string  | Guest last name — empty string if not set                                      |
| `email`          | string  | Guest email — empty string if not set                                          |
| `phone`          | string  | Guest phone — empty string if not set                                          |
| `dateOfBirth`    | date    | Guest date of birth (`YYYY-MM-DD`, nullable)                                   |

**Instructor Fields (`classInstructors[]`)**

| Field               | Type    | Description                                                          |
| ------------------- | ------- | -------------------------------------------------------------------- |
| `id`                | integer | Class-instructor assignment identifier                               |
| `employeeId`        | integer | flaik employee identifier (nullable)                                 |
| `identifierCode`    | string  | External employee identifier — empty string if not set               |
| `payrollIdentifier` | string  | Employee identifier in your payroll system — empty string if not set |
| `firstName`         | string  | Instructor first name — empty string if not set                      |
| `lastName`          | string  | Instructor last name — empty string if not set                       |

## Task Types

The `taskType` field is an integer enum:

| Value | Meaning        |
| ----- | -------------- |
| `1`   | Non-teaching   |
| `2`   | Group lesson   |
| `3`   | Private lesson |
| `6`   | Hold block     |
| `7`   | Program lesson |

{% hint style="info" %}
**Note:** Legacy values `4` and `5` have been retired and should not appear in production data. Treat any unexpected value defensively (skip rather than fail).
{% endhint %}

## Walking a Larger Window

Because the date range is capped at 5 days, ingesting a longer period requires walking through the range in chunks. A simple loop:

```
range_start = 2025-01-01
range_end   = 2025-01-31

cursor = range_start
while cursor <= range_end:
    chunk_end = min(cursor + 5 days, range_end)
    GET /api/classmanagement/classes/{cursor}/{chunk_end}
    process records
    cursor = chunk_end + 1 day
```

## Error Responses

| HTTP Status | Description                                                         |
| ----------- | ------------------------------------------------------------------- |
| `400`       | `startDate` or `endDate` is missing, malformed, or not a valid date |
| `400`       | The supplied date range exceeds 5 days                              |
| `401`       | Missing or invalid access token                                     |

Need help with class ingest? Contact <resortsupport@flaik.com>.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/class-management/class-details-by-date-range.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
