Skip to main content

Classes

This API documentation provides a comprehensive guide for interacting with the class management system in Whautomate. This allows you to interact using API and sync classes between multiple systems.

Here's a breakdown of the functionalities offered:

  • Search or Retrieve Classes (GET /v1/classes): This method allows you to find specific classes or retrieve a full list. You can optionally filter the results based on various criteria (e.g., date range, location, instructor).
  • Get Individual Class By Id (GET /v1/classes/{classId}): Use this method to retrieve detailed information about a particular class by providing its unique identifier.
  • Create a New Class (POST /v1/classes): This method enables you to create new classes by specifying details like date, time, location, instructor, service (type of class), and any other relevant information.
  • Update Class (PUT /v1/classes/{classId}): Modify details of an existing class using this method. You can update information like date, time, instructor, or other relevant attributes.
  • Delete Class By Id (DELETE /v1/classes/{classId}): This method allows you to permanently remove a class from the schedule.
  • Get Participants of a Class (GET /v1/classes/{classId}/participants): Retrieve a list of participants enrolled in a specific class by providing its unique identifier.
  • Add Participant to Class (POST /v1/classes/{classId}/participants/add): This method allows you to enroll participants in a specific class.
  • Remove Participant from Class (POST /v1/classes/{classId}/participants/cancel): Use this method to cancel a participant's enrollment from a specific class.
  • Get Class bookings of a Client (GET /v1/classes/clients/{clientId}/bookings): Use this method to get all the classes booked by a particular client using their Id.

By leveraging this API, you can streamline your class management process, ensuring a clear and organized class schedule along with efficient participant management.

API regionapi.whautomate.com

Search or retrieve Classes​

GET /v1/classes
Headers
x-api-keystringrequired
Your Whautomate API key.
Query parameters
limitstring
staffIdstring
endDatestring
locationIdstring
pagestring
startDatestring
Response 200
idstringrequired
locationobjectrequired
staffobjectrequired
timezonestring
datestringrequired
timestringrequired
startTimeUTCstring
startTimestring
endTimeUTCstring
endTimestring
serviceobjectrequired
bookedParticipantsinteger
numberOfParticipantsinteger
statusstring
createdAtstring
updatedAtstring
Request
curl -X GET "https://api.whautomate.com/v1/classes" \
-H "x-api-key: YOUR_API_KEY"
Response 200
[
{
"id": "string",
"location": {
"id": "string",
"title": "string"
},
"staff": {
"id": "string",
"name": "string"
},
"timezone": "string",
"date": "2025-01-01",
"time": "string",
"startTimeUTC": "2025-01-01T10:00:00.000Z",
"startTime": "2025-01-01T10:00:00.000Z",
"endTimeUTC": "2025-01-01T10:00:00.000Z",
"endTime": "2025-01-01T10:00:00.000Z",
"service": {
"id": "string",
"name": "string",
"durationMinutes": 0,
"sellingPrice": 0
},
"bookedParticipants": 0,
"numberOfParticipants": 0,
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}
]

Get Individual Class By Id​

GET /v1/classes/{classId}
Headers
x-api-keystringrequired
Your Whautomate API key.
Path parameters
classIdstringrequired
Response 200
idstringrequired
locationobjectrequired
staffobjectrequired
timezonestring
datestringrequired
timestringrequired
startTimeUTCstring
startTimestring
endTimeUTCstring
endTimestring
serviceobjectrequired
bookedParticipantsinteger
numberOfParticipantsinteger
statusstring
createdAtstring
updatedAtstring
Request
curl -X GET "https://api.whautomate.com/v1/classes/{classId}" \
-H "x-api-key: YOUR_API_KEY"
Response 200
{
"id": "string",
"location": {
"id": "string",
"title": "string"
},
"staff": {
"id": "string",
"name": "string"
},
"timezone": "string",
"date": "2025-01-01",
"time": "string",
"startTimeUTC": "2025-01-01T10:00:00.000Z",
"startTime": "2025-01-01T10:00:00.000Z",
"endTimeUTC": "2025-01-01T10:00:00.000Z",
"endTime": "2025-01-01T10:00:00.000Z",
"service": {
"id": "string",
"name": "string",
"durationMinutes": 0,
"sellingPrice": 0
},
"bookedParticipants": 0,
"numberOfParticipants": 0,
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}

Create a new Class​

POST /v1/classes
Headers
x-api-keystringrequired
Your Whautomate API key.
Body
locationobjectrequired
staffobjectrequired
datestringrequired
Date of the class in YYYY-MM-DD format
timestringrequired
Time of the class
serviceobjectrequired
numberOfParticipantsinteger
Number of participants in the class (optional)
timezonestring
Timezone of the class (optional)
isOnlineClassboolean
Set to true for an online class (optional)
onlineClassLinkstring
Meeting link for an online class (optional)
onlineClassPassCodestring
Meeting passcode for an online class (optional)
advanceSettingsobject

Booking and cancellation cut-offs (optional)

Response 200
idstringrequired
locationobjectrequired
staffobjectrequired
timezonestring
datestringrequired
timestringrequired
startTimeUTCstring
startTimestring
endTimeUTCstring
endTimestring
serviceobjectrequired
bookedParticipantsinteger
numberOfParticipantsinteger
statusstring
createdAtstring
updatedAtstring
Request
curl -X POST "https://api.whautomate.com/v1/classes" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"location": {
"id": "string",
"title": "string"
},
"staff": {
"id": "string",
"name": "string"
},
"date": "string",
"time": "string",
"service": {
"id": "string",
"name": "string",
"durationMinutes": 0,
"sellingPrice": 0
},
"numberOfParticipants": 0,
"timezone": "string"
}'
Response 200
{
"id": "string",
"location": {
"id": "string",
"title": "string"
},
"staff": {
"id": "string",
"name": "string"
},
"timezone": "string",
"date": "2025-01-01",
"time": "string",
"startTimeUTC": "2025-01-01T10:00:00.000Z",
"startTime": "2025-01-01T10:00:00.000Z",
"endTimeUTC": "2025-01-01T10:00:00.000Z",
"endTime": "2025-01-01T10:00:00.000Z",
"service": {
"id": "string",
"name": "string",
"durationMinutes": 0,
"sellingPrice": 0
},
"bookedParticipants": 0,
"numberOfParticipants": 0,
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}

Update Class​

PUT /v1/classes/{classId}
Headers
x-api-keystringrequired
Your Whautomate API key.
Path parameters
classIdstringrequired
Body
locationobjectrequired
staffobjectrequired
datestringrequired
Date of the class in YYYY-MM-DD format
timestringrequired
Time of the class
serviceobjectrequired
numberOfParticipantsinteger
Number of participants in the class (optional)
timezonestring
Timezone of the class (optional)
isOnlineClassboolean
Set to true for an online class (optional)
onlineClassLinkstring
Meeting link for an online class (optional)
onlineClassPassCodestring
Meeting passcode for an online class (optional)
advanceSettingsobject

Booking and cancellation cut-offs (optional)

Response 200
idstringrequired
locationobjectrequired
staffobjectrequired
timezonestring
datestringrequired
timestringrequired
startTimeUTCstring
startTimestring
endTimeUTCstring
endTimestring
serviceobjectrequired
bookedParticipantsinteger
numberOfParticipantsinteger
statusstring
createdAtstring
updatedAtstring
Request
curl -X PUT "https://api.whautomate.com/v1/classes/{classId}" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"location": {
"id": "string",
"title": "string"
},
"staff": {
"id": "string",
"name": "string"
},
"date": "string",
"time": "string",
"service": {
"id": "string",
"name": "string",
"durationMinutes": 0,
"sellingPrice": 0
},
"numberOfParticipants": 0,
"timezone": "string"
}'
Response 200
{
"id": "string",
"location": {
"id": "string",
"title": "string"
},
"staff": {
"id": "string",
"name": "string"
},
"timezone": "string",
"date": "2025-01-01",
"time": "string",
"startTimeUTC": "2025-01-01T10:00:00.000Z",
"startTime": "2025-01-01T10:00:00.000Z",
"endTimeUTC": "2025-01-01T10:00:00.000Z",
"endTime": "2025-01-01T10:00:00.000Z",
"service": {
"id": "string",
"name": "string",
"durationMinutes": 0,
"sellingPrice": 0
},
"bookedParticipants": 0,
"numberOfParticipants": 0,
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}

Delete Class By Id​

DEL /v1/classes/{classId}
Headers
x-api-keystringrequired
Your Whautomate API key.
Path parameters
classIdstringrequired
Response 200
successboolean
Request
curl -X DELETE "https://api.whautomate.com/v1/classes/{classId}" \
-H "x-api-key: YOUR_API_KEY"
Response 200
{
"success": true
}

Get Participants of a Class​

GET /v1/classes/{classId}/participants
Headers
x-api-keystringrequired
Your Whautomate API key.
Path parameters
classIdstringrequired
Response 200
idstring
clientobject
paymentStatusstring
statusstring
createdAtstring
updatedAtstring
Request
curl -X GET "https://api.whautomate.com/v1/classes/{classId}/participants" \
-H "x-api-key: YOUR_API_KEY"
Response 200
[
{
"id": "string",
"client": {
"id": "string",
"fullName": "string"
},
"paymentStatus": "string",
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}
]

Add Participant to Class​

POST /v1/classes/{classId}/participants/add
Headers
x-api-keystringrequired
Your Whautomate API key.
Path parameters
classIdstringrequired
Body
clientobjectrequired
statusstring (enum)
Client's booking status (optional) One of: BOOKED, WAITLISTED.
Response 200
idstring
clientobject
paymentStatusstring
statusstring
createdAtstring
updatedAtstring
Request
curl -X POST "https://api.whautomate.com/v1/classes/{classId}/participants/add" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client": {
"id": "string",
"fullName": "string",
"countryCode": "string",
"phone": "string"
},
"status": "BOOKED"
}'
Response 200
{
"id": "string",
"client": {
"id": "string",
"fullName": "string"
},
"paymentStatus": "string",
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}

Add Participant to Class with Payment​

Books a client into a class like the customer booking portal does. If the class service accepts payment online and the client has no credits to use, nothing is booked yet: the place is held, a payment link is returned and the client is added when they pay. If the class is full and the waitlist is on, the client is waitlisted without payment. Otherwise the client is booked straight away. Needs the Bookings add-on.

POST /v1/classes/{classId}/participants/add-with-payment
Headers
x-api-keystringrequired
Your Whautomate API key.
Path parameters
classIdstringrequired
Body
clientobjectrequired

Either the id of an existing client, or fullName, countryCode and phone for a new one.

Response 200
bookingTypestring
CLASS.
statusstring
PAYMENT_PENDING, BOOKED or WAITLISTED.
paymentRequiredboolean
currencystring
paymentobject
When payment is required: orderId, paymentLink, currency, subTotal, taxAmount, totalAmount, expiresAt, expiresInMinutes and message. Otherwise null.
classParticipantobject
When booked or waitlisted: id, client, status, classId, className, classDate, classTime and createdAt.
Request
curl -X POST "https://api.whautomate.com/v1/classes/{classId}/participants/add-with-payment" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client": { "id": "CLIENT_ID" }
}'
Response 200 (payment required)
{
"bookingType": "CLASS",
"status": "PAYMENT_PENDING",
"paymentRequired": true,
"currency": "SGD",
"payment": {
"orderId": "string",
"paymentLink": "https://...",
"currency": "SGD",
"subTotal": 25,
"taxAmount": 2.25,
"totalAmount": 27.25,
"expiresAt": "2026-10-15T10:10:00.000Z",
"expiresInMinutes": 10,
"message": "string"
},
"classId": "CLASS_ID"
}

Get a Participant of a Class​

GET /v1/classes/{classId}/participants/{participantId}
Headers
x-api-keystringrequired
Your Whautomate API key.
Path parameters
classIdstringrequired
participantIdstringrequired
Response 200
idstring
clientobject
id and fullName.
paymentStatusstring
statusstring
createdAtstring
updatedAtstring
Request
curl -X GET "https://api.whautomate.com/v1/classes/{classId}/participants/{participantId}" \
-H "x-api-key: YOUR_API_KEY"

Returns 404 with Participant not found in the class when the participant is not in that class.

Remove Participant from Class​

POST /v1/classes/{classId}/participants/cancel
Headers
x-api-keystringrequired
Your Whautomate API key.
Path parameters
classIdstringrequired
Body
participantIdstringrequired
Unique identifier for the participant
cancellationReasonstring
Reason for cancellation provided by the participant (optional)
Response 200
idstring
clientobject
paymentStatusstring
statusstring
createdAtstring
updatedAtstring
Request
curl -X POST "https://api.whautomate.com/v1/classes/{classId}/participants/cancel" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"participantId": "string",
"cancellationReason": "string"
}'
Response 200
{
"id": "string",
"client": {
"id": "string",
"fullName": "string"
},
"paymentStatus": "string",
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}

Get Class Bookings of Particular Client​

GET /v1/classes/clients/{clientId}/bookings
Headers
x-api-keystringrequired
Your Whautomate API key.
Path parameters
clientIdstringrequired
Query parameters
limitstring
endDatestring
locationIdstring
pagestring
startDatestring
Response 200
idstring
clientobject
paymentStatusstring
statusstring
createdAtstring
updatedAtstring
classobject
Request
curl -X GET "https://api.whautomate.com/v1/classes/clients/{clientId}/bookings" \
-H "x-api-key: YOUR_API_KEY"
Response 200
[
{
"id": "string",
"client": {
"id": "string",
"fullName": "string"
},
"paymentStatus": "string",
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z",
"class": {
"id": "string",
"location": {
"id": "string",
"title": "string"
},
"staff": {
"id": "string",
"name": "string"
},
"timezone": "string",
"date": "2025-01-01",
"time": "string",
"startTimeUTC": "2025-01-01T10:00:00.000Z",
"startTime": "2025-01-01T10:00:00.000Z",
"endTimeUTC": "2025-01-01T10:00:00.000Z",
"endTime": "2025-01-01T10:00:00.000Z",
"service": {
"id": "string",
"name": "string",
"durationMinutes": 0,
"sellingPrice": 0
},
"bookedParticipants": 0,
"numberOfParticipants": 0,
"status": "string",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z"
}
}
]