{"openapi":"3.1.0","info":{"title":"Estona API","version":"1.0.0","description":"Availability and appointments of a Business on Estona. Reading the catalogue and Slots and booking as a Client need no key; everything else needs an API key created by an Admin in Settings → API."},"servers":[{"url":"https://unique-gerbil-380.eu-west-1.convex.site/v1"}],"security":[{},{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key (`est_…`), valid only for its own Business."}},"parameters":{"idempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (a UUID). Retrying with the same key within 24 h returns the first result instead of booking twice; the same key with another body is a 409.","schema":{"type":"string","maxLength":255}}},"responses":{"E400":{"description":"Invalid request (`invalid`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E401":{"description":"Missing or invalid API key (`unauthenticated`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E404":{"description":"Not found (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E409":{"description":"The time is taken, the change is no longer allowed, or an Idempotency-Key was reused with another body (`slot_unavailable`, `outside_cancellation_window`, `conflict`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E429":{"description":"Too many requests (`rate_limited`).","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["invalid","unauthenticated","forbidden","not_found","slot_unavailable","conflict","outside_cancellation_window","rate_limited","internal"]},"message":{"type":"string"}}}}},"Business":{"type":"object","required":["name","slug","timeZone","services","practitioners"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"timeZone":{"type":"string","description":"IANA time zone, e.g. `Europe/Madrid`."},"phone":{"type":["string","null"]},"address":{"type":["string","null"]},"services":{"type":"array","items":{"$ref":"#/components/schemas/Service"}},"practitioners":{"type":"array","items":{"$ref":"#/components/schemas/Practitioner"}}}},"Service":{"type":"object","required":["id","name","durationMinutes","priceFromCents","priceToCents","practitionerIds"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"durationMinutes":{"type":"integer"},"priceFromCents":{"type":"integer","description":"Lowest Price among the Practitioners who offer it, in cents."},"priceToCents":{"type":"integer"},"practitionerIds":{"type":"array","items":{"type":"string"}}}},"Practitioner":{"type":"object","required":["id","name","slug"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}}},"Slot":{"type":"object","required":["start","end","practitionerIds"],"properties":{"start":{"type":"string","format":"date-time","description":"ISO 8601, UTC."},"end":{"type":"string","format":"date-time","description":"ISO 8601, UTC."},"practitionerIds":{"type":"array","items":{"type":"string"},"description":"Who is free at this time."}}},"Booking":{"type":"object","required":["id","practitionerId","start","end"],"properties":{"id":{"type":"string"},"practitionerId":{"type":"string"},"start":{"type":"string","format":"date-time","description":"ISO 8601, UTC."},"end":{"type":"string","format":"date-time","description":"ISO 8601, UTC."}}},"Appointment":{"type":"object","required":["id","status","start","end","clientId","serviceId","practitionerId","roomId","priceCents","source"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["booked","completed","cancelled","no_show"]},"start":{"type":"string","format":"date-time","description":"ISO 8601, UTC."},"end":{"type":"string","format":"date-time","description":"ISO 8601, UTC."},"clientId":{"type":"string"},"serviceId":{"type":"string"},"practitionerId":{"type":"string"},"roomId":{"type":["string","null"]},"priceCents":{"type":"integer"},"source":{"type":"string","enum":["public","panel","api"]}}},"Client":{"type":"object","required":["id","name","email","phone"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}}},"ClientInput":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":100},"email":{"type":"string","format":"email"},"phone":{"type":"string"}}}}},"paths":{"/businesses/{slug}":{"get":{"summary":"The Business, its Services and Practitioners","security":[{}],"parameters":[{"name":"slug","in":"path","required":true,"description":"The Business subdomain, e.g. `fisio-laura`.","schema":{"type":"string"}}],"responses":{"200":{"description":"The Business.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Business"}}}}}},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/businesses/{slug}/slots":{"get":{"summary":"Free Slots for a Service","description":"Start times where the Service fits, every 15 minutes, honouring the minimum notice and booking horizon. At most 42 days per request.","security":[{}],"parameters":[{"name":"slug","in":"path","required":true,"description":"The Business subdomain, e.g. `fisio-laura`.","schema":{"type":"string"}},{"name":"serviceId","in":"query","required":true,"schema":{"type":"string"}},{"name":"practitionerId","in":"query","required":false,"schema":{"type":"string"},"description":"Without it, Slots of anyone who offers the Service."},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time","description":"ISO 8601, UTC."},"description":"Defaults to now."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time","description":"ISO 8601, UTC."},"description":"Defaults to `from` + 7 days."}],"responses":{"200":{"description":"Slots in order.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Slot"}}}}}}},"400":{"$ref":"#/components/responses/E400"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/businesses/{slug}/appointments":{"get":{"summary":"Appointments of the Business","security":[{"apiKey":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"The Business subdomain, e.g. `fisio-laura`.","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time","description":"ISO 8601, UTC."},"description":"Defaults to now."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time","description":"ISO 8601, UTC."},"description":"Defaults to `from` + 30 days; at most 62 days."}],"responses":{"200":{"description":"Appointments starting in the range.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Appointment"}}}}}}},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}},"post":{"summary":"Book an Appointment","description":"Without a key it books as the Client (needs `client` and `acceptPrivacy: true`; 5 bookings per hour per IP). With a key it books on behalf of the Business and may use `clientId` instead of `client`. The Client gets the confirmation email either way.","security":[{},{"apiKey":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"The Business subdomain, e.g. `fisio-laura`.","schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["serviceId","start"],"properties":{"serviceId":{"type":"string"},"practitionerId":{"type":"string","description":"Without it, anyone free at that time."},"start":{"type":"string","format":"date-time","description":"One of the Slots."},"client":{"$ref":"#/components/schemas/ClientInput"},"clientId":{"type":"string","description":"With a key: an existing Client."},"acceptPrivacy":{"type":"boolean","description":"Without a key: the Client accepted the privacy policy."}}}}}},"responses":{"201":{"description":"Booked.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Booking"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}}}},"/businesses/{slug}/appointments/{appointmentId}":{"get":{"summary":"One Appointment","security":[{"apiKey":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"The Business subdomain, e.g. `fisio-laura`.","schema":{"type":"string"}},{"name":"appointmentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The Appointment.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Appointment"}}}}}},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/businesses/{slug}/appointments/{appointmentId}/reschedule":{"post":{"summary":"Move an Appointment","description":"Same Service, Client and Practitioner; the new start must be free. The Client gets an email with the new time.","security":[{"apiKey":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"The Business subdomain, e.g. `fisio-laura`.","schema":{"type":"string"}},{"name":"appointmentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["start"],"properties":{"start":{"type":"string","format":"date-time","description":"ISO 8601, UTC."}}}}}},"responses":{"200":{"description":"The moved Appointment.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Appointment"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"429":{"$ref":"#/components/responses/E429"}}}},"/businesses/{slug}/appointments/{appointmentId}/cancel":{"post":{"summary":"Cancel an Appointment","security":[{"apiKey":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"The Business subdomain, e.g. `fisio-laura`.","schema":{"type":"string"}},{"name":"appointmentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"notifyClient":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"Cancelled.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"const":"cancelled"}}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"404":{"$ref":"#/components/responses/E404"},"429":{"$ref":"#/components/responses/E429"}}}},"/businesses/{slug}/clients":{"get":{"summary":"Search Clients","security":[{"apiKey":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"The Business subdomain, e.g. `fisio-laura`.","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"},"description":"Name to search; without it, the latest 50."}],"responses":{"200":{"description":"Up to 50 Clients.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Client"}}}}}}},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}},"post":{"summary":"Create a Client","description":"Returns the existing Client when the email or phone already belongs to one.","security":[{"apiKey":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"The Business subdomain, e.g. `fisio-laura`.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientInput"}}}},"responses":{"201":{"description":"The Client.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"}}}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"429":{"$ref":"#/components/responses/E429"}}}}},"webhooks":{"appointment.created":{"post":{"summary":"An Appointment was booked (web, widget, panel or API)","description":"Signed with Standard Webhooks: verify `webhook-signature` with the secret shown when the webhook was created. Answer with any 2xx within 10 s.","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"},"description":"Same for every retry: use it to ignore duplicates."},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"},"description":"Unix seconds."},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"},"description":"`v1,<base64 HMAC-SHA256>`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","timestamp","data"],"properties":{"type":{"const":"appointment.created"},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601, UTC."},"data":{"$ref":"#/components/schemas/Appointment"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no answer in 10 s, is retried."}}}},"appointment.rescheduled":{"post":{"summary":"An Appointment moved","description":"Signed with Standard Webhooks: verify `webhook-signature` with the secret shown when the webhook was created. Answer with any 2xx within 10 s.","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"},"description":"Same for every retry: use it to ignore duplicates."},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"},"description":"Unix seconds."},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"},"description":"`v1,<base64 HMAC-SHA256>`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","timestamp","data"],"properties":{"type":{"const":"appointment.rescheduled"},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601, UTC."},"data":{"allOf":[{"$ref":"#/components/schemas/Appointment"},{"type":"object","properties":{"previousStart":{"type":"string","format":"date-time","description":"ISO 8601, UTC."}}}]}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no answer in 10 s, is retried."}}}},"appointment.cancelled":{"post":{"summary":"An Appointment was cancelled","description":"Signed with Standard Webhooks: verify `webhook-signature` with the secret shown when the webhook was created. Answer with any 2xx within 10 s.","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"},"description":"Same for every retry: use it to ignore duplicates."},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"},"description":"Unix seconds."},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"},"description":"`v1,<base64 HMAC-SHA256>`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","timestamp","data"],"properties":{"type":{"const":"appointment.cancelled"},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601, UTC."},"data":{"$ref":"#/components/schemas/Appointment"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no answer in 10 s, is retried."}}}},"appointment.completed":{"post":{"summary":"An Appointment ended and counts as attended","description":"Signed with Standard Webhooks: verify `webhook-signature` with the secret shown when the webhook was created. Answer with any 2xx within 10 s.","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"},"description":"Same for every retry: use it to ignore duplicates."},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"},"description":"Unix seconds."},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"},"description":"`v1,<base64 HMAC-SHA256>`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","timestamp","data"],"properties":{"type":{"const":"appointment.completed"},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601, UTC."},"data":{"$ref":"#/components/schemas/Appointment"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no answer in 10 s, is retried."}}}},"appointment.no_show":{"post":{"summary":"The Client did not show up","description":"Signed with Standard Webhooks: verify `webhook-signature` with the secret shown when the webhook was created. Answer with any 2xx within 10 s.","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"},"description":"Same for every retry: use it to ignore duplicates."},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"},"description":"Unix seconds."},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"},"description":"`v1,<base64 HMAC-SHA256>`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","timestamp","data"],"properties":{"type":{"const":"appointment.no_show"},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601, UTC."},"data":{"$ref":"#/components/schemas/Appointment"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no answer in 10 s, is retried."}}}}}}