Create or replace a class
Create a weekly class on your activity listing, or replace it, by your own ID.
PUT
{BASE_URL}/activity/classes/:externalIdA class runs on set days at a set time with a fixed number of spots, and customers book a seat in one
session. Same rules as an activity item: the whole class, a draft until
published, REGISTRATION scope, the Activity module for a provider.
Body
namestringrequired- 1–80 characters.
priceintegerrequired- Per seat, whole taka, 0–1,000,000.
daysinteger[]required- Weekdays it runs,
0= Sunday …6= Saturday, each once. startTimestringrequired- 24-hour
HH:MM, Dhaka time. durationMinutesintegerrequired- 5–720.
spotsintegerrequired- Seats per session, 1–1,000.
runsUntilstring | nulloptional- The last date it runs,
YYYY-MM-DD.nullmeans it keeps running. categorystring | nulloptional- Up to 40 characters.
descriptionstring | nulloptional- Up to 500 characters.
imagestring | nulloptional- A URL from
POST /media. locationIdsstring[]optional- IDs from
GET /locations. linkobject | nulloptional{ url, label }.
Errors name the field: days_required, days_duplicate, startTime_invalid, runsUntil_invalid
(including dates that do not exist, like 2026-02-30), spots_invalid, durationMinutes_invalid.
Deleting a class keeps its past bookings; they just no longer point at it.
Status codes#
| Status | Code | When |
|---|---|---|
201 | — | Created, as a draft. |
200 | — | Replaced, or "dryRun": true for a sandbox key. |
400 | unknown_field, <field>_required, <field>_invalid, <field>_too_long, <field>_too_many | A field is missing or wrong. details.field names it. See Errors. |
400 | image_not_imported | image is not a URL from POST /media. |
400 | location_not_found, locationIds_invalid | A locationIds entry is not one of your locations, or the list is not an array of at most 50 IDs. |
400 | externalId_invalid | The externalId is not 1–128 letters, digits or . _ ~ : -. |
403 | provider_module_not_allowed | A Technology Provider without the Activity module. |
409 | activity_not_set_up | You have no activity listing yet. Set it up in the Partner Portal. |
409 | too_many_classes | The activity already has the most classes it can hold. |
409 | resource_busy | Another request is creating this externalId. Retry in a moment. |
409 | resource_managed_elsewhere | A Technology Provider wrote an externalId another integration holds. |
cURL
curl -X PUT "$LOCALOY_BASE_URL/activity/classes/yoga-am" \
-H "Authorization: Bearer $LOCALOY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Morning yoga",
"price": 500,
"days": [1, 3, 5],
"startTime": "07:00",
"durationMinutes": 60,
"spots": 12,
"runsUntil": "2026-12-31"
}'Response · 201
{
"success": true,
"message": "Class created as a draft — publish it to show it to customers",
"dryRun": false,
"created": true,
"data": {
"externalId": "yoga-am",
"id": "cm4c1ass00000000000001",
"name": "Morning yoga",
"price": 500,
"category": null,
"description": null,
"image": null,
"locationIds": [],
"link": null,
"days": [1, 3, 5],
"startTime": "07:00",
"durationMinutes": 60,
"spots": 12,
"runsUntil": "2026-12-31",
"published": false,
"updatedAt": "2026-11-10T10:00:00.000Z"
}
}