curl --request POST \
--url https://api.1club.ai/v1/platform/class-types \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"revenueAccountId": 123,
"maxPartySize": 1,
"allowMultiDay": false,
"cancelIfAttendanceZero": false,
"cancelIfAttendanceZeroHoursInAdvance": 0,
"bookingAudience": {
"memberTypes": [
"<string>"
],
"tags": [
"<string>"
],
"membershipPlanIds": [
123
],
"membershipPlanCategoryIds": [
123
]
}
}
'import requests
url = "https://api.1club.ai/v1/platform/class-types"
payload = {
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"revenueAccountId": 123,
"maxPartySize": 1,
"allowMultiDay": False,
"cancelIfAttendanceZero": False,
"cancelIfAttendanceZeroHoursInAdvance": 0,
"bookingAudience": {
"memberTypes": ["<string>"],
"tags": ["<string>"],
"membershipPlanIds": [123],
"membershipPlanCategoryIds": [123]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
slug: '<string>',
description: '<string>',
revenueAccountId: 123,
maxPartySize: 1,
allowMultiDay: false,
cancelIfAttendanceZero: false,
cancelIfAttendanceZeroHoursInAdvance: 0,
bookingAudience: {
memberTypes: ['<string>'],
tags: ['<string>'],
membershipPlanIds: [123],
membershipPlanCategoryIds: [123]
}
})
};
fetch('https://api.1club.ai/v1/platform/class-types', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1club.ai/v1/platform/class-types",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'slug' => '<string>',
'description' => '<string>',
'revenueAccountId' => 123,
'maxPartySize' => 1,
'allowMultiDay' => false,
'cancelIfAttendanceZero' => false,
'cancelIfAttendanceZeroHoursInAdvance' => 0,
'bookingAudience' => [
'memberTypes' => [
'<string>'
],
'tags' => [
'<string>'
],
'membershipPlanIds' => [
123
],
'membershipPlanCategoryIds' => [
123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/class-types"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"revenueAccountId\": 123,\n \"maxPartySize\": 1,\n \"allowMultiDay\": false,\n \"cancelIfAttendanceZero\": false,\n \"cancelIfAttendanceZeroHoursInAdvance\": 0,\n \"bookingAudience\": {\n \"memberTypes\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.1club.ai/v1/platform/class-types")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"revenueAccountId\": 123,\n \"maxPartySize\": 1,\n \"allowMultiDay\": false,\n \"cancelIfAttendanceZero\": false,\n \"cancelIfAttendanceZeroHoursInAdvance\": 0,\n \"bookingAudience\": {\n \"memberTypes\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/class-types")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"revenueAccountId\": 123,\n \"maxPartySize\": 1,\n \"allowMultiDay\": false,\n \"cancelIfAttendanceZero\": false,\n \"cancelIfAttendanceZeroHoursInAdvance\": 0,\n \"bookingAudience\": {\n \"memberTypes\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"revenueAccountId": 123,
"classCount": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"maxPartySize": 123,
"allowMultiDay": true,
"cancelIfAttendanceZero": true,
"cancelIfAttendanceZeroHoursInAdvance": 123,
"bookingAudience": {
"memberTypes": [
"<string>"
],
"tags": [
"<string>"
],
"membershipPlanIds": [
123
],
"membershipPlanCategoryIds": [
123
]
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Create a class type
Adds a kind of class the organization runs. List the existing types first - a club rarely wants two types meaning the same thing, and this endpoint will happily create a duplicate name.
slug is optional and derived from the name when omitted, suffixed if that is taken. Send one explicitly only when something outside 1club already refers to it; an explicit slug that clashes is a 409 rather than a row quietly filed under a different key. Supports the Idempotency-Key header.
curl --request POST \
--url https://api.1club.ai/v1/platform/class-types \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"revenueAccountId": 123,
"maxPartySize": 1,
"allowMultiDay": false,
"cancelIfAttendanceZero": false,
"cancelIfAttendanceZeroHoursInAdvance": 0,
"bookingAudience": {
"memberTypes": [
"<string>"
],
"tags": [
"<string>"
],
"membershipPlanIds": [
123
],
"membershipPlanCategoryIds": [
123
]
}
}
'import requests
url = "https://api.1club.ai/v1/platform/class-types"
payload = {
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"revenueAccountId": 123,
"maxPartySize": 1,
"allowMultiDay": False,
"cancelIfAttendanceZero": False,
"cancelIfAttendanceZeroHoursInAdvance": 0,
"bookingAudience": {
"memberTypes": ["<string>"],
"tags": ["<string>"],
"membershipPlanIds": [123],
"membershipPlanCategoryIds": [123]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
slug: '<string>',
description: '<string>',
revenueAccountId: 123,
maxPartySize: 1,
allowMultiDay: false,
cancelIfAttendanceZero: false,
cancelIfAttendanceZeroHoursInAdvance: 0,
bookingAudience: {
memberTypes: ['<string>'],
tags: ['<string>'],
membershipPlanIds: [123],
membershipPlanCategoryIds: [123]
}
})
};
fetch('https://api.1club.ai/v1/platform/class-types', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1club.ai/v1/platform/class-types",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'slug' => '<string>',
'description' => '<string>',
'revenueAccountId' => 123,
'maxPartySize' => 1,
'allowMultiDay' => false,
'cancelIfAttendanceZero' => false,
'cancelIfAttendanceZeroHoursInAdvance' => 0,
'bookingAudience' => [
'memberTypes' => [
'<string>'
],
'tags' => [
'<string>'
],
'membershipPlanIds' => [
123
],
'membershipPlanCategoryIds' => [
123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/class-types"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"revenueAccountId\": 123,\n \"maxPartySize\": 1,\n \"allowMultiDay\": false,\n \"cancelIfAttendanceZero\": false,\n \"cancelIfAttendanceZeroHoursInAdvance\": 0,\n \"bookingAudience\": {\n \"memberTypes\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.1club.ai/v1/platform/class-types")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"revenueAccountId\": 123,\n \"maxPartySize\": 1,\n \"allowMultiDay\": false,\n \"cancelIfAttendanceZero\": false,\n \"cancelIfAttendanceZeroHoursInAdvance\": 0,\n \"bookingAudience\": {\n \"memberTypes\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/class-types")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"revenueAccountId\": 123,\n \"maxPartySize\": 1,\n \"allowMultiDay\": false,\n \"cancelIfAttendanceZero\": false,\n \"cancelIfAttendanceZeroHoursInAdvance\": 0,\n \"bookingAudience\": {\n \"memberTypes\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"revenueAccountId": 123,
"classCount": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"maxPartySize": 123,
"allowMultiDay": true,
"cancelIfAttendanceZero": true,
"cancelIfAttendanceZeroHoursInAdvance": 123,
"bookingAudience": {
"memberTypes": [
"<string>"
],
"tags": [
"<string>"
],
"membershipPlanIds": [
123
],
"membershipPlanCategoryIds": [
123
]
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Organization-scoped bearer credential: a customer API key (1club_sk_live_...) or an MCP OAuth access token.
Headers
Retry-safe key; a repeat of the same request replays the first response
255Body
Fields accepted when creating a class type. Only name is required; slug is derived from it when omitted, and suffixed if that is taken. The defaults shown are what an omitted field becomes, and unknown fields are rejected.
255Stable key. Derived from the name when omitted; send one only when something outside 1club already refers to it. An explicit slug that clashes is a 409, and a rename never moves it.
120^[a-z0-9]+(-[a-z0-9]+)*$2000Where a sale on this kind of class posts, from GET /v1/platform/revenue-accounts. Leave it unset and the sale posts to whichever account the organization has marked default, resolved at the time of the sale.
How many people one booking may bring, including the booker.
1 <= x <= 1000Whether a class of this kind may run across more than one calendar day.
Whether a class with nobody booked cancels itself.
Hours before the start that cancellation runs. Meaningless unless cancelIfAttendanceZero.
0 <= x <= 720Who something applies to, as a set of predicates a contact must match. null means everybody. The same shape a promotion segment and an automation entry condition use. membershipPlanIds is which plan the contact must HOLD, not which plan a purchase discounts.
Show child attributes
Show child attributes
Response
Class type created
A kind of class the organization runs. Reference the id as classTypeId on a class, or in classTypeIds on a class pay rate policy. One shape for the list, get-by-id, create and update.
Stable key, derived from the name when a create does not send one. A rename never moves it.
Where a sale on this kind of class posts. Null falls back to the organization's default account.
Classes currently run as this type, past and future.
How many people one booking on a class of this kind may bring, including the booker.
Whether a class of this kind may run across more than one calendar day.
Whether a class with nobody booked cancels itself.
Hours before the start that cancellation runs. Meaningless unless cancelIfAttendanceZero.
Who something applies to, as a set of predicates a contact must match. null means everybody. The same shape a promotion segment and an automation entry condition use. membershipPlanIds is which plan the contact must HOLD, not which plan a purchase discounts.
Show child attributes
Show child attributes
Was this page helpful?