Cancel a class booking

PUT https://api.zenoti.com/v1/classes/{class_id}/cancel

Cancels a guest enrollment in a class. If guests are waitlisted, the next waitlisted guest is auto-enrolled.

Before you begin

Permission: Manage API Keys (under Administrator) — Required to access Zenoti APIs.

Endpoint

PUT /v1/classes/{class_id}/cancel

Base URL: https://api.zenoti.com

Request

Headers

Header Required Description
Authorization Yes bearer {{access_token}}

Path parameters

Parameter Type Required Description
class_id string (GUID) Yes Class identifier

Request body

Field Type Required Description
guest_id string (GUID) Yes Guest identifier

Response

Success (200 OK)

{
  "is_cancelled": true,
  "error": null
}

Response fields

Field Type Description
is_cancelled boolean Whether the enrollment was cancelled

Example

curl --request PUT \
  --url 'https://api.zenoti.com/v1/classes/00000000-0000-0000-0000-2267899c6bbb/cancel' \
  --header 'Authorization: bearer {{access_token}}' \
  --header 'Content-Type: application/json' \
  --data '{ "guest_id": "e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b" }'
const response = await fetch('https://api.zenoti.com/v1/classes/{class_id}/cancel', {
  method: 'PUT',
  headers: {
    'Authorization': 'bearer {{access_token}}',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ guest_id: 'e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b' })
});
const data = await response.json();
import requests

response = requests.put(
    'https://api.zenoti.com/v1/classes/{class_id}/cancel',
    headers={
        'Authorization': 'bearer {{access_token}}',
    },
    json={'guest_id': 'e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b'}
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var content = new StringContent(
    JsonSerializer.Serialize(new { guestId = "e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b" }),
    Encoding.UTF8, "application/json");
var response = await client.PutAsync(
    "https://api.zenoti.com/v1/classes/{class_id}/cancel", content);
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'

uri = URI('https://api.zenoti.com/v1/classes/{class_id}/cancel')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
request['Content-Type'] = 'application/json'
request.body = { guest_id: 'e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b' }.to_json
response = http.request(request)
data = JSON.parse(response.body)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.zenoti.com/v1/classes/{class_id}/cancel');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: bearer {{access_token}}',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['guest_id' => 'e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b']));
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);

Error codes

Status Description
401 Unauthorized — invalid or expired access token
404 Resource not found
429 Too many requests — rate limit exceeded (60/min)