# Classes

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.&#x20;

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

### Search or retrieve Classes

{% openapi src="/files/XKbqmYpLbwmHfH7drtj3" path="/v1/classes" method="get" %}
[Whautomate -Your Host.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FmvrcLbjRCcKuOC0Vzyor%2FWhautomate%20-Your%20Host.json?alt=media\&token=e36abed1-908d-45ba-830f-519a3f5dabff)
{% endopenapi %}

### Get Individual Class By Id

{% openapi src="/files/XKbqmYpLbwmHfH7drtj3" path="/v1/classes/{classId}" method="get" %}
[Whautomate -Your Host.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FmvrcLbjRCcKuOC0Vzyor%2FWhautomate%20-Your%20Host.json?alt=media\&token=e36abed1-908d-45ba-830f-519a3f5dabff)
{% endopenapi %}

### Create a new Class

{% openapi src="/files/XKbqmYpLbwmHfH7drtj3" path="/v1/classes" method="post" %}
[Whautomate -Your Host.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FmvrcLbjRCcKuOC0Vzyor%2FWhautomate%20-Your%20Host.json?alt=media\&token=e36abed1-908d-45ba-830f-519a3f5dabff)
{% endopenapi %}

### Update Class

{% openapi src="/files/XKbqmYpLbwmHfH7drtj3" path="/v1/classes/{classId}" method="put" %}
[Whautomate -Your Host.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FmvrcLbjRCcKuOC0Vzyor%2FWhautomate%20-Your%20Host.json?alt=media\&token=e36abed1-908d-45ba-830f-519a3f5dabff)
{% endopenapi %}

### Delete Class By Id

{% openapi src="/files/XKbqmYpLbwmHfH7drtj3" path="/v1/classes/{classId}" method="delete" %}
[Whautomate -Your Host.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FmvrcLbjRCcKuOC0Vzyor%2FWhautomate%20-Your%20Host.json?alt=media\&token=e36abed1-908d-45ba-830f-519a3f5dabff)
{% endopenapi %}

### Get Participants of a Class

{% openapi src="/files/XKbqmYpLbwmHfH7drtj3" path="/v1/classes/{classId}/participants" method="get" %}
[Whautomate -Your Host.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FmvrcLbjRCcKuOC0Vzyor%2FWhautomate%20-Your%20Host.json?alt=media\&token=e36abed1-908d-45ba-830f-519a3f5dabff)
{% endopenapi %}

### Add Participant to Class

{% openapi src="/files/XKbqmYpLbwmHfH7drtj3" path="/v1/classes/{classId}/participants/add" method="post" %}
[Whautomate -Your Host.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FmvrcLbjRCcKuOC0Vzyor%2FWhautomate%20-Your%20Host.json?alt=media\&token=e36abed1-908d-45ba-830f-519a3f5dabff)
{% endopenapi %}

### Remove Participant from Class

{% openapi src="/files/XKbqmYpLbwmHfH7drtj3" path="/v1/classes/{classId}/participants/cancel" method="post" %}
[Whautomate -Your Host.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FmvrcLbjRCcKuOC0Vzyor%2FWhautomate%20-Your%20Host.json?alt=media\&token=e36abed1-908d-45ba-830f-519a3f5dabff)
{% endopenapi %}

### Get Class Bookings of Particular Client

{% openapi src="/files/QBZ3q2BuXsAPcs5JohYL" path="/v1/classes/clients/{clientId}/bookings" method="get" %}
[Whautomate Rest API-Production-swagger (1).json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2FGbMZGJNIMrwtDmEbYSXC%2FWhautomate%20Rest%20API-Production-swagger%20\(1\).json?alt=media\&token=10cb125f-a50b-4123-8eb1-64c6d5a25354)
{% endopenapi %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.whautomate.com/product-guides/whautomate-rest-api/classes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
