Authentication

The Flow Fitness API uses Bearer Tokens for authentication. All API requests must include an Authorization header with your secret API key.

You can manage your API keys in the developer dashboard (not available in this demo).

Example Header

Authorization: Bearer sk_your_secret_key_here

Requests made without authentication will fail with a 401 Unauthorized error.

Error Codes

The API uses conventional HTTP status codes to indicate the success or failure of a request.

Common Status Codes

CODEMEANINGDESCRIPTION
200 OKSuccessThe request was successful.
201 CreatedSuccessThe resource was created successfully.
204 No ContentSuccessThe request was successful, but there is no content to return (e.g., for a DELETE request).
400 Bad RequestClient ErrorThe request was malformed, with invalid parameters.
401 UnauthorizedClient ErrorAuthentication failed or was not provided.
404 Not FoundClient ErrorThe requested resource does not exist.
409 ConflictClient ErrorThe request could not be completed due to a conflict (e.g., double-booking).
500 Internal Server ErrorServer ErrorSomething went wrong on our end. Please try again later.

List all Classes

Retrieves a paginated list of all available classes. The classes are returned sorted by their start time.

GET/v1/classes

Query Parameters

PARAMETERTYPEDESCRIPTION
limitintegerOptional. A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterstringOptional. A cursor for use in pagination.

Returns

Returns a dictionary with a data property that contains an array of class objects.

Get a single Class

Retrieves the details of a single class by its unique ID.

GET/v1/classes/{id}

Path Parameters

PARAMETERTYPEDESCRIPTION
idstringRequired. The unique identifier of the class to retrieve.

Returns

Returns a class object if a valid ID was provided.

Create a Booking

Books a member into a specific class session. This action is atomic and will fail if the class is full or if the member is already booked into an overlapping session.

POST/v1/bookings

Request Body

PARAMETERTYPEDESCRIPTION
class_session_idstringRequired. The unique identifier for the specific class session. e.g., cs_x7y8z9w0
member_idstringRequired. The unique identifier for the member making the booking. e.g., mem_q1w2e3r4

Returns

Returns the newly created booking object on success.

// ✅ 201 Created - Success Response
{
  "id": "bk_1a2b3c4d5e",
  "object": "booking",
  "member_id": "mem_q1w2e3r4",
  "class_session_id": "cs_x7y8z9w0",
  "status": "confirmed",
  "created": 1678886400
}

Get a Booking

Retrieves the details of a booking by its unique ID. This is useful for checking the status or details of a specific reservation.

GET/v1/bookings/{id}

Path Parameters

PARAMETERTYPEDESCRIPTION
idstringRequired. The unique identifier of the booking to retrieve. e.g., bk_1a2b3c4d5e

Returns

Returns a booking object if a valid ID was provided. If the booking has been cancelled, the status field will be updated accordingly.

// ✅ 200 OK - Success Response
{
  "id": "bk_1a2b3c4d5e",
  "object": "booking",
  "member_id": "mem_q1w2e3r4",
  "class_session_id": "cs_x7y8z9w0",
  "status": "confirmed",
  "created": 1678886400
}

Cancel a Booking

Permanently cancels a booking. This action cannot be undone, though it may be possible to re-book if the class is not full.

DELETE/v1/bookings/{id}

Path Parameters

PARAMETERTYPEDESCRIPTION
idstringRequired. The unique identifier of the booking to cancel. e.g., bk_1a2b3c4d5e

Returns

Returns a 204 No Content status on successful deletion. The booking object's status will be marked as cancelled.

Get a Member

Retrieves the details of a single member by their unique ID. For privacy, some sensitive information may be omitted.

GET/v1/members/{id}

Path Parameters

PARAMETERTYPEDESCRIPTION
idstringRequired. The unique identifier of the member to retrieve. e.g., mem_q1w2e3r4

Returns

Returns a member object if a valid ID was provided.

// ✅ 200 OK - Success Response
{
  "id": "mem_q1w2e3r4",
  "object": "member",
  "name": "Alex Doe",
  "email": "alex.doe@example.com",
  "membership_status": "active",
  "join_date": 1640995200
}