Passa al contenuto principale

Classes API

Auto-generated from the OpenAPI spec. Run node docs-site/scripts/fetch-openapi.js to regenerate.

POST /api/v1/classes/recurring​

Schedule Recurring Classes

Request body

FieldRequiredTypeDescription
template_idYesinteger
instructor_idNointeger
location_idNointeger
starts_atYesstring
ends_atYesstring
capacityYesinteger
notesNostring
days_of_weekYesarray
recurrence_end_dateNostring
max_occurrencesNointeger
required_tag_idNointegerTag restriction (PRODUCT_SPEC.md §4.1a) applied to every instance in the series. Omit to inherit the template's required_tag_id; send explicit null to create the series with no restriction regardless of the template.
is_onlineNoboolean

Responses

  • 201 — Successful Response
  • 422 — Validation Error

GET /api/v1/classes​

List Classes

Parameters

NameInRequiredTypeDescription
start_datequeryNo
end_datequeryNo
instructor_idqueryNo
template_idqueryNo
location_idqueryNo
statusqueryNo

Each returned class includes required_tag_id, required_tag_name, and required_tag_color (denormalized from the tag, null when the class has no restriction), and location_name (denormalized from the class's location_id, null when it doesn't resolve to a real location — same pattern as location_name on Bookings / Appointments).

Responses

  • 200 — Successful Response
  • 422 — Validation Error

POST /api/v1/classes​

Schedule Single Class

Request body

FieldRequiredTypeDescription
template_idYesinteger
instructor_idNointeger
location_idNointeger
starts_atYesstring
ends_atYesstring
capacityYesinteger
notesNostring
is_onlineNoboolean
required_tag_idNointegerTag restriction (PRODUCT_SPEC.md §4.1a) for this instance. Omit to inherit the template's required_tag_id; send explicit null to schedule with no restriction regardless of the template.

Responses

  • 201 — Successful Response
  • 422 — Validation Error

GET /api/v1/classes/{class_id}​

Get Class

Parameters

NameInRequiredTypeDescription
class_idpathYesinteger

Includes the same required_tag_id/required_tag_name/required_tag_color and location_name denormalized fields as GET /classes above.

Responses

  • 200 — Successful Response
  • 422 — Validation Error

PUT /api/v1/classes/{class_id}​

Update Class

Parameters

NameInRequiredTypeDescription
class_idpathYesinteger

Request body

FieldRequiredTypeDescription
instructor_idNointeger
location_idNointeger
starts_atNostring
ends_atNostring
capacityNointeger
notesNostring
is_onlineNoboolean
required_tag_idNointegerChange or clear this instance's tag restriction. Send explicit null to clear it; omit the field to leave it unchanged. Does not affect the template or other instances.

Responses

  • 200 — Successful Response
  • 422 — Validation Error

DELETE /api/v1/classes/{class_id}​

Cancel Class

Parameters

NameInRequiredTypeDescription
class_idpathYesinteger

Responses

  • 200 — Successful Response
  • 422 — Validation Error

POST /api/v1/classes/{class_id}/zoom-meeting/retry​

Retry Zoom Meeting

Manually retry Zoom meeting creation for an online class whose previous attempt failed (zoom_meeting_status == 'failed').

Parameters

NameInRequiredTypeDescription
class_idpathYesinteger

Responses

  • 200 — Successful Response
  • 422 — Validation Error

GET /api/v1/classes/{class_id}/roster​

Get Roster

Parameters

NameInRequiredTypeDescription
class_idpathYesinteger

Responses

  • 200 — Successful Response
  • 422 — Validation Error

GET /api/v1/classes/{class_id}/waitlist​

Get Waitlist

Parameters

NameInRequiredTypeDescription
class_idpathYesinteger

Responses

  • 200 — Successful Response
  • 422 — Validation Error

GET /api/v1/classes/{class_id}/eligible-memberships​

Get Eligible Memberships

Returns only the target client's active memberships that are actually usable to book this specific class right now — reusing the same eligibility logic (_membership_is_usable) that POST /bookings applies when resolving a membership at booking time: the membership's purpose must apply to class bookings, the class's tag restriction (if any) must be satisfied, and the membership must be unlimited or have enough credits_remaining for this class's credit cost. Expired and non-active memberships are never included.

Backs the mobile and backoffice membership pickers shown when a client has more than one active membership and the studio manager (or the client, in the app) must choose which one to use — replacing a previous behavior where every active membership was listed regardless of whether it could actually be used for that class, which could fail with a 409 at booking time.

Parameters

NameInRequiredTypeDescription
class_idpathYesinteger
client_idqueryNointegerThe client whose memberships to check. Required when called with a manager/instructor token. Optional for a client token — if omitted, defaults to the caller's own id; if provided, it must match the caller's own id.

Mixed-audience, same IDOR pattern as the rest of this router and bookings.py:

  • Client token — resolves the target client from the token's own sub. Passing a client_id query param that doesn't match the caller's own id is rejected with 403 FORBIDDEN (never silently coerced to the caller's own id).
  • Manager/instructor token — must pass client_id explicitly; omitting it returns 422 VALIDATION_ERROR.

Each item in the response array is a MembershipResponse, the same shape returned by the Memberships endpoints — including the denormalized membership_type_name, is_unlimited, and usable_for convenience fields.

Responses

  • 200 — Successful Response — array of MembershipResponse, possibly empty if the client has no membership usable for this class.
  • 403 FORBIDDEN — a client token requested a client_id other than its own.
  • 404 NOT_FOUND — no scheduled class with this class_id.
  • 422 VALIDATION_ERROR — a manager/instructor token omitted the required client_id.

POST /api/v1/classes/{class_id}/complete​

Complete Class

Parameters

NameInRequiredTypeDescription
class_idpathYesinteger

Responses

  • 200 — Successful Response
  • 422 — Validation Error

DELETE /api/v1/classes/{class_id}/remove​

Remove Class

Permanently delete a scheduled class. Only allowed when there are no confirmed bookings.

Parameters

NameInRequiredTypeDescription
class_idpathYesinteger

Responses

  • 204 — Successful Response
  • 422 — Validation Error