> 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/overview/quick-start.md).

# Quick Start

This is the shortest path from "credentials in hand" to "I made a real call". Five minutes if your network and credentials are good.

### What you need before starting

1. A `client_id` and `client_secret` issued by flaik. Don't have one? Contact <resortsupport@flaik.com>.
2. The API base URL Flaik gave you for your environment (something like `https://api.flaik.com`).
3. A way to make HTTPS requests — `curl`, Postman, your language's HTTP client, etc.

### Step 1 — Fetch an access token

Send `client_credentials` to the token endpoint with the read scope:

```bash
curl -X POST https://auth-usw2.flaik.com/connect/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET" \
  -d "scope=flaik.connect.api.read"
```

Expected response:

```json
{
  "access_token": "eyJhbGciOiJSUzI1NiIs…",
  "expires_in": 3600,
  "token_type": "Bearer",
  "scope": "flaik.connect.api.read"
}
```

Copy the `access_token` value — you'll use it on every subsequent call.

> **Token expires after 1 hour.** Cache and reuse it; fetch a new one when it's about to expire. See [Authentication → Token Caching](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/overview/authentication#token-caching) for the recommended pattern.

### Step 2 — Confirm your tenant

Hit the resort details endpoint to confirm the token resolves to the resort you expect:

```bash
curl https://api.flaik.com/api/globalsettings/resort \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

Expected response (truncated):

```json
{
  "id": 42,
  "name": "Example Mountain Resort",
  "location": "Example, CO",
  "timezone": "America/Denver",
  ...
}
```

If the `name` and `location` match your resort — auth is wired up correctly. If you see a different resort, double-check the credentials. If you get a 401, the token is missing or invalid; fetch a new one.

See the full response shape on the [Resort Details](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/global-settings/resort-details) page.

### Step 3 — List the resort's seasons

Most other endpoints take a `seasonId`. Get the list of available seasons next:

```bash
curl https://api.flaik.com/api/globalsettings/seasons \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

Expected response (truncated):

```json
[
  {
    "id": 17,
    "startDate": "2024-11-15",
    "endDate": "2025-04-30",
    "isCurrent": true,
    "nameLong": "Winter 2024–2025",
    ...
  },
  ...
]
```

The season with `"isCurrent": true` is the one happening now. Note the `id` — you'll pass it as `{seasonId}` on most other endpoints.

See the full response shape on the [Seasons](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/global-settings/seasons) page.

### Step 4 — Make a real data call

Use the season `id` from the previous step to fetch employee shifts for the current season:

```bash
curl https://api.flaik.com/api/schedule/shifts/17 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

Expected response shape:

```json
{
  "data": [
    {
      "shiftId": 1042,
      "employeeId": 15,
      "scheduledDate": "2025-01-15",
      ...
    }
  ],
  "hasMore": true,
  "pageSize": 1000,
  "nextAfterId": 1042
}
```

If `hasMore` is `true`, there are more pages. See [Pagination and Delta Sync](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/overview/pagination-and-delta-sync) for the cursor pattern.

### Where to go next

Once you've got a successful call, head to the endpoint you actually need:

| Use case                               | Endpoint                                                                                                                                                                 |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Pull employee shifts                   | [Shift Data By Season](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/schedule/shift-data-by-season)                       |
| Pull instructor task assignments       | [Task Data By Season](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/schedule/task-data-by-season)                         |
| Pull lesson/class details              | [Class Details by Date Range](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/class-management/class-details-by-date-range) |
| Pull guest survey responses            | [Class Survey Responses](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/class-management/class-surveys-by-date-range)      |
| Pull POS product → Flaik task mappings | [Resort Product Mappings](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/pos-integration/resort-product-mappings)          |
| Pull paid-activity timesheet rows      | [Paid Activities by Date Range](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/timekeeping/paid-activities-by-date-range)  |
| Push employee data into Flaik / POS    | [Upsert Employee](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/employee-management/upsert-employee)                      |

### Troubleshooting

| You see                                    | Try                                                                                                     |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------- |
| `invalid_client` from the token endpoint   | Re-check `client_id`/`client_secret`. Whitespace and quote characters are common culprits when copying. |
| `invalid_scope` from the token endpoint    | Your client isn't authorised for the scope you requested. Contact Flaik to confirm what's allowed.      |
| `401 Unauthorized` from an API call        | Token is missing, expired, or invalid. Fetch a fresh one and retry.                                     |
| `403 Forbidden` from an API call           | Token doesn't include the scope the endpoint needs (e.g. calling Upsert with a read-only token).        |
| `400` with `"Season {id} does not exist…"` | The `seasonId` isn't configured for your resort. Pull `/api/globalsettings/seasons` to see valid IDs.   |

See the [Error Handling](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/overview/error-handling) page for the full status-code map and retry guidance.

Need help getting started? 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/overview/quick-start.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.
