> ## Documentation Index
> Fetch the complete documentation index at: https://docs.1club.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Classes

> List, create, update, and delete class occurrences through the Platform API.

Class reads require `classes:read`. Class management requires `classes:write`.

## List classes

```bash theme={null}
curl "https://api.1club.ai/v1/platform/classes?startDate=2026-08-01T00:00:00%2B03:00&endDate=2026-09-01T00:00:00%2B03:00" \
  -H "Authorization: Bearer 1club_sk_live_..."
```

Use `startDate`, `endDate`, and `locale` to filter and translate the response. The endpoint returns class schedule, price, capacity, gym, area, instructors, and status fields.

## Get a class

```bash theme={null}
curl "https://api.1club.ai/v1/platform/classes/312" \
  -H "Authorization: Bearer 1club_sk_live_..."
```

The class must belong to the API key's organization.

## Create a class

Send one class occurrence. Recurrence creation remains in the 1Club dashboard.

```bash theme={null}
curl -X POST "https://api.1club.ai/v1/platform/classes" \
  -H "Authorization: Bearer 1club_sk_live_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: morning-yoga-2026-08-12" \
  -d '{
    "clubId": 5,
    "areaId": 18,
    "instructorIds": [42],
    "name": "Morning yoga",
    "startTime": "2026-08-12T08:00:00+03:00",
    "endTime": "2026-08-12T09:00:00+03:00",
    "maxCapacity": 16,
    "priceBeforeTax": 15,
    "visibility": "Public"
  }'
```

Times must include `Z` or an explicit UTC offset. All referenced gyms, areas, class types, and instructors must belong to the authorized organization. An area must belong to the selected gym.

<Warning>
  Write `priceBeforeTax`, not `price`. A class reads back with both: `price`
  includes your organization's tax and is what a member is charged, while
  `priceBeforeTax` is the figure actually stored. Sending `price` back is
  rejected with a `400` naming the right field - if it were accepted, reading a
  class and posting it straight back would re-apply tax every time (20 becomes
  24, then 28.80 at 20% exclusive tax). Read `priceBeforeTax`, send
  `priceBeforeTax`, and a round trip changes nothing.
</Warning>

## Update a class

Send only fields that should change:

```bash theme={null}
curl -X PATCH "https://api.1club.ai/v1/platform/classes/312" \
  -H "Authorization: Bearer 1club_sk_live_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: class-312-capacity-20" \
  -d '{ "maxCapacity": 20 }'
```

Changing the area, instructors, or time updates the related schedule reservations. Conflicting reservations return `409 Conflict`.

## Delete a class

Delete one occurrence:

```bash theme={null}
curl -X DELETE "https://api.1club.ai/v1/platform/classes/312" \
  -H "Authorization: Bearer 1club_sk_live_..." \
  -H "Idempotency-Key: delete-class-312"
```

For a recurring class, add `?scope=all_future` to delete this and later occurrences. The default is `this_instance`.

Deletion returns `409 Conflict` when affected future classes have active customer bookings or waitlist entries. Cancel or move those records before retrying.
