{"openapi":"3.1.0","info":{"title":"Calmumi public API","version":"1","description":"Online booking for Calmumi studios. Docs: https://calmumi.vercel.app/en/docs/api"},"servers":[{"url":"https://calmumi.vercel.app/api/v1"}],"components":{"securitySchemes":{"secretKey":{"type":"http","scheme":"bearer","description":"Secret key (cm_sk_…) from Dashboard → Share & embed. Server-side only."}}},"paths":{"/studios/{studio}":{"get":{"operationId":"get-studio","summary":"Studio, locations, services and team","description":"Everything a booking page needs in one call: the studio (name, logo, colour, time zone, currency), its locations, the services with their lengths and prices, and the people who can be booked online. Only what can actually be booked online is listed. Add `?lang=de` for German names and descriptions.","parameters":[{"name":"studio","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"studio":{"slug":"salon-mira","name":"Salon Mira","logoUrl":"https://…/logo.png","brandColor":"#7c3aed","timezone":"Europe/Zurich","currency":"CHF","requireApproval":false,"cancelCutoffHours":24},"locations":[{"id":"6f1c…","slug":"zuerich-west","name":"Zürich West","street":"Hardstrasse 1","zip":"8005","city":"Zürich","phone":"+41 44 000 00 00","email":null}],"services":[{"id":"0b7e…","slug":"haircut","name":"Haircut","description":"Wash, cut and style.","category":"Hair","variants":[{"id":"9a21…","durationMin":45,"price":{"amount":6000,"currency":"CHF"}},{"id":"4c88…","durationMin":60,"price":{"amount":7500,"currency":"CHF"}}],"locationIds":["6f1c…"],"staffIds":["d2f0…"]}],"staff":[{"id":"d2f0…","slug":"anna","name":"Anna","bio":"Colour specialist.","photoUrl":null,"color":"#f59e0b","locationIds":["6f1c…"],"serviceIds":["0b7e…"]}]}}}},"404":{"description":"STUDIO_NOT_AVAILABLE: The studio has no active plan."}}}},"/studios/{studio}/availability":{"get":{"operationId":"get-availability","summary":"Free times","description":"Free start times for one service length (`variant`) at one location, for every local day from `from` to `to` (at most 31 days). Leave out `staff` for “anyone”: each slot lists who is free. Times respect working hours, time off, other bookings with their buffers, and the studio’s notice and advance limits.","parameters":[{"name":"studio","in":"path","required":true,"schema":{"type":"string"}},{"name":"variant","in":"query","required":true,"description":"Service variant id (a length/price option of a service).","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Service variant id (a length/price option of a service)."}},{"name":"location","in":"query","required":true,"description":"Location id.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Location id."}},{"name":"staff","in":"query","required":false,"description":"Only this person. Leave out for \"anyone\".","schema":{"description":"Only this person. Leave out for \"anyone\".","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"from","in":"query","required":true,"description":"First local date.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"First local date."}},{"name":"to","in":"query","required":false,"description":"Last local date (inclusive), at most 31 days after `from`. Defaults to `from`.","schema":{"description":"Last local date (inclusive), at most 31 days after `from`. Defaults to `from`.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"timezone":"Europe/Zurich","days":[{"date":"2026-12-07","slots":[{"start":"2026-12-07T08:00:00.000Z","time":"09:00","staffIds":["d2f0…"]},{"start":"2026-12-07T08:15:00.000Z","time":"09:15","staffIds":["d2f0…"]}]},{"date":"2026-12-08","slots":[]}]}}}},"400":{"description":"RANGE_TOO_LONG: More than 31 days."},"404":{"description":"STAFF_NOT_AVAILABLE: This person doesn’t offer the service here."}}}},"/studios/{studio}/bookings":{"post":{"operationId":"create-booking","summary":"Book","description":"Books a `start` from the availability response. With no `staffId` (“anyone”), the free person with the fewest bookings that day gets it. The client is found by email (or phone) or added. Status is `confirmed`, or `requested` when the studio confirms bookings itself. The client gets a confirmation email with a link to view, move or cancel; the studio is notified.","parameters":[{"name":"studio","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional but recommended: any unique string per booking attempt. Sending the same key again returns the first booking instead of creating a second one.","schema":{"type":"string"}},{"name":"Authorization","in":"header","required":false,"description":"Bearer cm_sk_… — required when calling from a server.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"variantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"locationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"staffId":{"description":"Leave out or null for \"anyone\": the person with the fewest bookings that day gets it.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"start":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"A `start` value from the availability response."},"client":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","maxLength":120,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"language":{"description":"Language for emails. Default: de.","anyOf":[{"type":"string","enum":["en","de","fr","it"]},{"type":"null"}]}},"required":["name","email"]},"note":{"description":"Message from the client to the studio.","anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"marketingConsent":{"type":"boolean"}},"required":["variantId","locationId","start","client"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"reference":"K7QX2M","status":"confirmed","start":"2026-12-07T08:00:00.000Z","end":"2026-12-07T08:45:00.000Z","timezone":"Europe/Zurich","language":"en","studio":{"slug":"salon-mira","name":"Salon Mira","logoUrl":null,"brandColor":"#7c3aed"},"service":{"id":"0b7e…","name":"Haircut"},"variant":{"id":"9a21…","durationMin":45},"price":{"amount":6000,"currency":"CHF"},"staff":{"id":"d2f0…","name":"Anna"},"anyStaff":false,"location":{"id":"6f1c…","name":"Zürich West","street":"Hardstrasse 1","zip":"8005","city":"Zürich","phone":"+41 44 000 00 00","email":null},"client":{"name":"Lena Muster","email":"lena@example.com","phone":"+41 79 000 00 00"},"note":null,"cancelCutoffHours":24,"canChange":true,"manageUrl":"https://calmumi.com/en/booking/3vQ…"}}}},"401":{"description":"INVALID_API_KEY: Unknown or revoked key."},"403":{"description":"BOT_DETECTED: Browser requests from other sites: use the widget or your server."},"409":{"description":"SLOT_TAKEN: The time was taken in the meantime — load availability again."},"429":{"description":"RATE_LIMITED: Too many requests."}}}},"/bookings/{token}":{"get":{"operationId":"get-booking","summary":"A booking","description":"A booking by the secret token from its manage link (`manageUrl`). `canChange` tells whether the client may still move or cancel it.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"reference":"K7QX2M","status":"confirmed","start":"2026-12-07T08:00:00.000Z","end":"2026-12-07T08:45:00.000Z","timezone":"Europe/Zurich","language":"en","studio":{"slug":"salon-mira","name":"Salon Mira","logoUrl":null,"brandColor":"#7c3aed"},"service":{"id":"0b7e…","name":"Haircut"},"variant":{"id":"9a21…","durationMin":45},"price":{"amount":6000,"currency":"CHF"},"staff":{"id":"d2f0…","name":"Anna"},"anyStaff":false,"location":{"id":"6f1c…","name":"Zürich West","street":"Hardstrasse 1","zip":"8005","city":"Zürich","phone":"+41 44 000 00 00","email":null},"client":{"name":"Lena Muster","email":"lena@example.com","phone":"+41 79 000 00 00"},"note":null,"cancelCutoffHours":24,"canChange":true,"manageUrl":"https://calmumi.com/en/booking/3vQ…"}}}},"404":{"description":"BOOKING_NOT_FOUND: Unknown token."}}}},"/bookings/{token}/move":{"post":{"operationId":"move-booking","summary":"Move a booking","description":"Moves the booking to another free `start` (same service, length and location; same person unless the client chose “anyone”). Load free times with the availability endpoint first. Possible until the studio’s cancellation cutoff.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"start":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["start"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"reference":"K7QX2M","status":"confirmed","start":"2026-12-07T08:00:00.000Z","end":"2026-12-07T08:45:00.000Z","timezone":"Europe/Zurich","language":"en","studio":{"slug":"salon-mira","name":"Salon Mira","logoUrl":null,"brandColor":"#7c3aed"},"service":{"id":"0b7e…","name":"Haircut"},"variant":{"id":"9a21…","durationMin":45},"price":{"amount":6000,"currency":"CHF"},"staff":{"id":"d2f0…","name":"Anna"},"anyStaff":false,"location":{"id":"6f1c…","name":"Zürich West","street":"Hardstrasse 1","zip":"8005","city":"Zürich","phone":"+41 44 000 00 00","email":null},"client":{"name":"Lena Muster","email":"lena@example.com","phone":"+41 79 000 00 00"},"note":null,"cancelCutoffHours":24,"canChange":true,"manageUrl":"https://calmumi.com/en/booking/3vQ…"}}}},"409":{"description":"NOT_CHANGEABLE: Cancelled or finished."}}}},"/bookings/{token}/cancel":{"post":{"operationId":"cancel-booking","summary":"Cancel a booking","description":"Cancels the booking, until the studio’s cancellation cutoff. The client gets an email; the studio is notified.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"reference":"K7QX2M","status":"cancelled","start":"2026-12-07T08:00:00.000Z","end":"2026-12-07T08:45:00.000Z","timezone":"Europe/Zurich","language":"en","studio":{"slug":"salon-mira","name":"Salon Mira","logoUrl":null,"brandColor":"#7c3aed"},"service":{"id":"0b7e…","name":"Haircut"},"variant":{"id":"9a21…","durationMin":45},"price":{"amount":6000,"currency":"CHF"},"staff":{"id":"d2f0…","name":"Anna"},"anyStaff":false,"location":{"id":"6f1c…","name":"Zürich West","street":"Hardstrasse 1","zip":"8005","city":"Zürich","phone":"+41 44 000 00 00","email":null},"client":{"name":"Lena Muster","email":"lena@example.com","phone":"+41 79 000 00 00"},"note":null,"cancelCutoffHours":24,"canChange":false,"manageUrl":"https://calmumi.com/en/booking/3vQ…"}}}},"409":{"description":"NOT_CHANGEABLE: Already cancelled or finished."}}}}}}