> 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/schedule/shift-data-by-season.md).

# Shift Data by Season

## Overview

The Shifts API provides access to employee shift schedules from flaik. Use this to synchronise scheduled shifts with external workforce management, payroll, or labour planning systems.

Two endpoints are available — use the right one for your use case:

* **Full pull** — `GET /api/schedule/shifts/{seasonId}` — initial load or complete re-sync of all active shifts for a season
* **Delta pull** — `GET /api/schedule/shifts/{seasonId}/delta` — incremental sync of changes since a given timestamp

Results are returned in pages of up to 1,000 records. The response wrapper includes ready-made cursor values so clients can loop through pages without inspecting individual records.

{% hint style="info" %}
**See also:** [Pagination and Delta Sync](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/overview/pagination-and-delta-sync) — shared cursor pattern, tombstone semantics, recovery rules, and common pitfalls. The cursor mechanics described in that page apply to this endpoint pair.
{% endhint %}

## Authentication

All Schedule endpoints require 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.

## Endpoints

### Full Pull — Get All Shifts by Season

Retrieves all active employee shifts for a season. Results are paginated — continue calling until `hasMore` is `false`.

```http
GET {api-url}/api/schedule/shifts/{seasonId}
```

**Path Parameters**

| Parameter  | Type    | Required | Description                                          |
| ---------- | ------- | -------- | ---------------------------------------------------- |
| `seasonId` | integer | Yes      | Season identifier — retrieve from GlobalSettings API |

**Query Parameters**

| Parameter     | Type    | Required | Description                                                                                           |
| ------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------- |
| `nextAfterId` | integer | No       | Pagination cursor — pass the `nextAfterId` value from the previous response to retrieve the next page |
| `pageSize`    | integer | No       | Number of records per page. Maximum and default: `1000`                                               |

**Example Request — First Page**

```http
GET {api-url}/api/schedule/shifts/17
Authorization: Bearer {access_token}
```

**Example Request — Subsequent Page**

```http
GET {api-url}/api/schedule/shifts/17?nextAfterId=1042
Authorization: Bearer {access_token}
```

**Response Format**

```json
{
  "data": [
    {
      "shiftId": 1042,
      "employeeId": 15,
      "payrollIdentifier": "EMP123456",
      "posIdentifier": "POS789",
      "scheduledDate": "2025-01-15",
      "shiftName": "Morning Ski School",
      "shiftTypeId": 3,
      "shiftConfigurationType": "Standard",
      "startTime": "08:30:00",
      "endTime": "12:30:00",
      "status": 1,
      "updatedUtc": "2025-01-10T14:22:00Z",
      "deleted": false
    }
  ],
  "hasMore": true,
  "pageSize": 1000,
  "nextAfterId": 1042
}
```

**Response Wrapper Fields**

| Field         | Type    | Description                                                                                           |
| ------------- | ------- | ----------------------------------------------------------------------------------------------------- |
| `data`        | array   | Page of shift records (see field descriptions below)                                                  |
| `hasMore`     | boolean | `true` if further pages exist. Continue requesting until this is `false`                              |
| `pageSize`    | integer | The page size applied to this response                                                                |
| `nextAfterId` | integer | Pass as `nextAfterId` on the next request to retrieve the next page. `null` when `hasMore` is `false` |

{% hint style="info" %}
Full pull results exclude soft-deleted records (`deleted: true`). Use the delta endpoint to receive deletions.
{% endhint %}

### Delta Pull — Get Changed Shifts by Season

Retrieves shifts that have been created, updated, or deleted since a given UTC timestamp. Use this for ongoing incremental sync after an initial full pull.

```http
GET {api-url}/api/schedule/shifts/{seasonId}/delta
```

**Path Parameters**

| Parameter  | Type    | Required | Description                                          |
| ---------- | ------- | -------- | ---------------------------------------------------- |
| `seasonId` | integer | Yes      | Season identifier — retrieve from GlobalSettings API |

**Query Parameters**

| Parameter                 | Type     | Required | Description                                                                                           |
| ------------------------- | -------- | -------- | ----------------------------------------------------------------------------------------------------- |
| `updatedAfterUtcDateTime` | datetime | **Yes**  | Only return shifts updated after this UTC timestamp (ISO 8601: `YYYY-MM-DDTHH:mm:ssZ`)                |
| `nextAfterId`             | integer  | No       | Pagination cursor — pass the `nextAfterId` value from the previous response to retrieve the next page |
| `pageSize`                | integer  | No       | Number of records per page. Maximum and default: `1000`                                               |

**Example Request — First Delta Page**

```http
GET {api-url}/api/schedule/shifts/17/delta?updatedAfterUtcDateTime=2025-01-01T00:00:00Z
Authorization: Bearer {access_token}
```

**Example Request — Subsequent Delta Page**

```http
GET {api-url}/api/schedule/shifts/17/delta?updatedAfterUtcDateTime=2025-01-10T14:22:00Z&nextAfterId=1042
Authorization: Bearer {access_token}
```

**Response Format**

```json
{
  "data": [
    {
      "shiftId": 1042,
      "employeeId": 15,
      "payrollIdentifier": "EMP123456",
      "posIdentifier": "POS789",
      "scheduledDate": "2025-01-15",
      "shiftName": "Morning Ski School",
      "shiftTypeId": 3,
      "shiftConfigurationType": "Standard",
      "startTime": "08:30:00",
      "endTime": "12:30:00",
      "status": 1,
      "updatedUtc": "2025-01-10T14:22:00Z",
      "deleted": false
    }
  ],
  "hasMore": true,
  "pageSize": 1000,
  "nextAfterId": 1042,
  "nextUpdatedAfterUtcDateTime": "2025-01-10T14:22:00Z"
}
```

**Response Wrapper Fields**

| Field                         | Type     | Description                                                                                                                                                                                                                                              |
| ----------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data`                        | array    | Page of shift records, including soft-deleted records                                                                                                                                                                                                    |
| `hasMore`                     | boolean  | `true` if further pages exist. Continue requesting until this is `false`                                                                                                                                                                                 |
| `pageSize`                    | integer  | The page size applied to this response                                                                                                                                                                                                                   |
| `nextAfterId`                 | integer  | Pass as `nextAfterId` on the next request. `null` when `hasMore` is `false`                                                                                                                                                                              |
| `nextUpdatedAfterUtcDateTime` | datetime | Pass as `updatedAfterUtcDateTime` on the next request when paginating a large delta result. Only populated when `hasMore` is `true` — you must pass both this and `nextAfterId` together to avoid missing or duplicating records at a timestamp boundary |

{% hint style="warning" %}
When paginating a delta result, always pass **both** `nextUpdatedAfterUtcDateTime` and `nextAfterId` together. Omitting `nextAfterId` can cause duplicate or missing records at a timestamp boundary.
{% endhint %}

## Shift Record Fields

| Field                    | Type     | Description                                                                                          |
| ------------------------ | -------- | ---------------------------------------------------------------------------------------------------- |
| `shiftId`                | integer  | Unique shift identifier                                                                              |
| `employeeId`             | integer  | flaik employee identifier                                                                            |
| `payrollIdentifier`      | string   | Employee identifier in your payroll system — empty string if not set                                 |
| `posIdentifier`          | string   | Employee identifier in your POS system — empty string if not set                                     |
| `scheduledDate`          | date     | Date the shift is scheduled (`YYYY-MM-DD`)                                                           |
| `shiftName`              | string   | Display name of the shift — empty string if not set                                                  |
| `shiftTypeId`            | integer  | Shift type identifier (nullable)                                                                     |
| `shiftConfigurationType` | string   | Configuration type assigned to the shift — empty string if not set                                   |
| `startTime`              | time     | Scheduled start time (`HH:mm:ss`, nullable)                                                          |
| `endTime`                | time     | Scheduled end time (`HH:mm:ss`, nullable)                                                            |
| `status`                 | integer  | Current shift status                                                                                 |
| `updatedUtc`             | datetime | Last updated timestamp (UTC, ISO 8601: `YYYY-MM-DDTHH:mm:ssZ`)                                       |
| `deleted`                | boolean  | `true` if the shift has been soft-deleted. Delta pull only — full pull never returns deleted records |

## Pagination

Both endpoints use the same cursor pattern documented in [Pagination and Delta Sync](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/overview/pagination-and-delta-sync).

**Quick reference for shifts:**

```
# Full pull — single cursor
GET /api/schedule/shifts/17
GET /api/schedule/shifts/17?nextAfterId={previous nextAfterId}
…loop until hasMore = false

# Delta pull — compound cursor; pass BOTH on continuations
GET /api/schedule/shifts/17/delta?updatedAfterUtcDateTime=2025-01-01T00:00:00Z
GET /api/schedule/shifts/17/delta
        ?updatedAfterUtcDateTime={previous nextUpdatedAfterUtcDateTime}
        &nextAfterId={previous nextAfterId}
…loop until hasMore = false
```

Soft-deleted shifts appear only on the delta pull (`deleted: true`); use them to tombstone removed shifts in your store.

## Error Responses

| HTTP Status | Endpoint   | Description                                            |
| ----------- | ---------- | ------------------------------------------------------ |
| `400`       | Both       | The supplied `seasonId` does not exist for this resort |
| `400`       | Delta only | `updatedAfterUtcDateTime` was not provided             |
| `401`       | Both       | Missing or invalid access token                        |

Need help with shift data integration? 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/schedule/shift-data-by-season.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.
