# YOGO API

**Base URL:** `https://api.yogobooking.com`


## Security

### X-API-KEY

API Key for authentication. All requests must include a valid API key in the X-API-KEY header.

Type: apiKey
In: header
Name: X-API-KEY

## Download OpenAPI description

[YOGO API](https://docs.api.yogobooking.com/_bundle/openapi.yaml)

## Bookings

Bookings made by customers for studio classes and livestreams. Booking IDs are composite (`studio_<id>` / `livestream_<id>`) and the same shape is used both in list cursors and as path params for retrieve.

### Get bookings

 - [GET /bookings](https://docs.api.yogobooking.com/openapi/bookings/bookings.list.md): Retrieve a filtered list of bookings for classes within a date range

### Get booking by ID

 - [GET /bookings/{id}](https://docs.api.yogobooking.com/openapi/bookings/bookings.retrieve.md): Retrieve a single booking by composite ID (studio_ or livestream_ — same shape returned in the list). Cancelled bookings are returned. Returns 404 if the booking does not exist.

## Class Pass Types

The class pass products a studio offers for sale — fixed-count (punch card) and unlimited time-based passes.

### Get class pass types

 - [GET /class-pass-types](https://docs.api.yogobooking.com/openapi/class-pass-types/class_pass_types.list.md): Retrieve a paginated list of class pass types (the punch/clip-card products a studio offers).

### Get class pass type by ID

 - [GET /class-pass-types/{id}](https://docs.api.yogobooking.com/openapi/class-pass-types/class_pass_types.retrieve.md): Retrieve a single class pass type by ID. Returns 404 if it does not exist.

## Class Passes

Class passes owned by customers, with remaining-class balance and validity. Filter by `customerId` or `classPassTypeId`; optional expansion: `classPassType`.

### Get class passes

 - [GET /class-passes](https://docs.api.yogobooking.com/openapi/class-passes/class_passes.list.md): Retrieve a paginated list of class passes (a customer's punch/clip card). Cancelled (soft-deleted) passes are never returned. There is no computed status — derive a pass's lifecycle from its raw fields (startDate, validUntil, latestStartDate, validForDaysFromStart, classesAvailableForBooking).

### Get class pass by ID

 - [GET /class-passes/{id}](https://docs.api.yogobooking.com/openapi/class-passes/class_passes.retrieve.md): Retrieve a single class pass by ID. Returns 404 if it does not exist or has been cancelled (soft-deleted).

## Class Series

Customers' enrollments in class series (courses). Filter by `customerId` or `classSeriesTypeId`; optional expansion: `classSeriesType`.

### Get class series

 - [GET /class-series](https://docs.api.yogobooking.com/openapi/class-series/class_series.list.md): Retrieve a paginated list of class series (a customer's enrollment in a multi-session course). Cancelled (soft-deleted) enrollments are never returned.

### Get class series by ID

 - [GET /class-series/{id}](https://docs.api.yogobooking.com/openapi/class-series/class_series.retrieve.md): Retrieve a single class series enrollment by ID. Returns 404 if it does not exist or has been cancelled (soft-deleted).

## Class Series Types

The class series (course) products a studio offers. Optional expansions: `studioClasses` and `livestreamClasses` (the scheduled sessions each grant covers).

### Get class series types

 - [GET /class-series-types](https://docs.api.yogobooking.com/openapi/class-series-types/class_series_types.list.md): Retrieve a paginated list of class series types (multi-session courses, "kurs"), including the computed number of classes in each course.

### Get class series type by ID

 - [GET /class-series-types/{id}](https://docs.api.yogobooking.com/openapi/class-series-types/class_series_types.retrieve.md): Retrieve a single class series type by ID. Returns 404 if it does not exist.

## Classes

Scheduled classes within a date range. Optional expansions: `classType`, `room`, `teachers`, `bookings`, `bookings.customer` (implicitly enables `bookings`).

### Get classes

 - [GET /classes](https://docs.api.yogobooking.com/openapi/classes/classes.list.md): Retrieve a filtered list of scheduled classes within a date range

### Get class by ID

 - [GET /classes/{id}](https://docs.api.yogobooking.com/openapi/classes/classes.retrieve.md): Retrieve a single class by ID. Cancelled classes are returned (the consumer asked for this id explicitly). Returns 404 if the class does not exist.

### Replace teachers on a class

 - [PUT /classes/{id}/teachers](https://docs.api.yogobooking.com/openapi/classes/classes.replace_teachers.md): Replace the full set of teachers assigned to the class identified by :id. The body's teacherIds array is the new state — pass [] to clear all teachers.

If the class has a PENDING teacher-swap request, the call fails with 409 Conflict. Retry with cancelPendingSwapRequests: true to cancel the swap and proceed in the same atomic write.

## Customers

Customer (end-user) records. Optional expansions: `bookings`, `bookings.class`, `orders`, `orders.orderItems`. Nested expansions imply their parent.

### Get customers

 - [GET /customers](https://docs.api.yogobooking.com/openapi/customers/customers.list.md): This endpoint returns customer data including personal information, contact details, and optionally their bookings and orders.

### Get customer by ID

 - [GET /customers/{id}](https://docs.api.yogobooking.com/openapi/customers/customers.retrieve.md): Retrieve a single customer by user ID. Returns 404 if the customer does not exist.

## Event Registrations

Customers' registrations for events. Filter by `customerId` or `eventId`, or include cancelled registrations with `includeCancelled`; optional expansion: `event`.

### Get event registrations

 - [GET /event-registrations](https://docs.api.yogobooking.com/openapi/event-registrations/event_registrations.list.md): Retrieve a paginated list of event registrations (a customer signed up for an event). Cancelled registrations are excluded unless includeCancelled=true.

### Get event registration by ID

 - [GET /event-registrations/{id}](https://docs.api.yogobooking.com/openapi/event-registrations/event_registrations.retrieve.md): Retrieve a single event registration by ID. Returns 404 if it does not exist.

## Events

Scheduled events within a date range. Optional expansion: `timeSlots` (the event's structured time slots).

### Get events

 - [GET /events](https://docs.api.yogobooking.com/openapi/events/events.list.md): Retrieve a paginated list of events (workshops / one-off happenings), including computed registration counts and seats available.

### Get event by ID

 - [GET /events/{id}](https://docs.api.yogobooking.com/openapi/events/events.retrieve.md): Retrieve a single event by ID. Returns 404 if it does not exist.

## Membership Types

The recurring membership products a studio offers for sale.

### Get membership types

 - [GET /membership-types](https://docs.api.yogobooking.com/openapi/membership-types/membership_types.list.md): Retrieve a paginated list of membership types (the membership products a studio offers), including their payment options and class limits.

### Get membership type by ID

 - [GET /membership-types/{id}](https://docs.api.yogobooking.com/openapi/membership-types/membership_types.retrieve.md): Retrieve a single membership type by ID. Returns 404 if it does not exist.

## Memberships

Customers' recurring memberships with lifecycle status. Filter by `status`, `customerId`, or `membershipTypeId`; optional expansion: `membershipType`.

### Get memberships

 - [GET /memberships](https://docs.api.yogobooking.com/openapi/memberships/memberships.list.md): Retrieve a paginated list of memberships (a customer's subscription to a membership type), including the current status and when the record was last updated.

### Get membership by ID

 - [GET /memberships/{id}](https://docs.api.yogobooking.com/openapi/memberships/memberships.retrieve.md): Retrieve a single membership by ID. Returns 404 if it does not exist.

## Orders

Orders placed by customers, with optional expansion of `customer` and `orderItems`.

### Get orders

 - [GET /orders](https://docs.api.yogobooking.com/openapi/orders/orders.list.md): Retrieve a paginated list of orders

### Get order by ID

 - [GET /orders/{id}](https://docs.api.yogobooking.com/openapi/orders/orders.retrieve.md): Retrieve a single order by ID. Returns 404 if the order does not exist.

## Teachers

Users with the teacher role enabled.

### Get teachers

 - [GET /teachers](https://docs.api.yogobooking.com/openapi/teachers/teachers.list.md): Retrieve a paginated list of teachers (users with the teacher role enabled)

### Get teacher by ID

 - [GET /teachers/{id}](https://docs.api.yogobooking.com/openapi/teachers/teachers.retrieve.md): Retrieve a single teacher by user ID. Returns 404 if the teacher does not exist.

## Write Logs

Audit log of every write (POST/PUT/PATCH/DELETE) the consumer's API keys have made against the public API.

### List write-operation audit logs

 - [GET /write-logs](https://docs.api.yogobooking.com/openapi/write-logs/write_logs.list.md): Audit log of every write (POST/PUT/PATCH/DELETE) the consumer's API keys have made against the public API. Successful writes are logged atomically with the change; failed writes are logged best-effort.

### Get a single audit log row by ID

 - [GET /write-logs/{id}](https://docs.api.yogobooking.com/openapi/write-logs/write_logs.retrieve.md): Returns 404 if the row does not exist.

