{"openapi":"3.1.0","info":{"title":"Soglad Core API","version":"1.0.0"},"components":{"securitySchemes":{"bookingToken":{"type":"http","scheme":"bearer","description":"The token of the hold reply (field \"token\", starting \"st\"). Send it as \"Authorization: Bearer <token>\" on confirm, status and cancel. It is returned only once, by POST /holds."}},"schemas":{}},"paths":{"/v1/places/{place}":{"get":{"summary":"Public facts of a place","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"place","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/places/{place}/services/{slug}":{"get":{"summary":"Public service card of a place","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"place","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/places/{place}/docs/search":{"get":{"summary":"Public document passages of a place","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F]*$"},"in":"query","name":"q","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"place","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/places/{place}/availability":{"get":{"summary":"Free time of one resource on one day","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[^\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F]*$"},"in":"query","name":"resource","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"date","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"place","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/places/{place}/bookings/{id}":{"get":{"summary":"Read a booking","description":"Send \"Authorization: Bearer <token from the hold reply>\". A missing or wrong token answers 404 not_found. Once the booking is confirmed, \"meeting\" carries {\"provider\": \"google_meet\", \"url\": ...} for a place that meets online; it is null before confirmation and for places without online meetings.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"place","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"security":[{"bookingToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/places/{place}/holds":{"post":{"summary":"Hold a slot","description":"The 201 reply carries \"token\" (only in this reply, so keep it) and \"confirm_url\". Next, POST \"confirm_url\" with the header \"Authorization: Bearer <token>\", an Idempotency-Key header and the body {name, email, phone (E.164), terms_version, note?}; email is required. The confirm reply carries \"status_url\" and \"cancel_url\": the same token reads the booking (GET \"status_url\", which is {API base}/bookings/{id}) and cancels it (POST \"cancel_url\", which is {API base}/bookings/{id}/cancel). When staff approve, the status reply has status \"confirmed\" and, for a place that meets online, \"meeting\": {\"provider\": \"google_meet\", \"url\": ...}; the person is also emailed the details. \"meeting\" is null before that. A retry with the same Idempotency-Key returns the same reply, token included. A 403 plan_limit_reached means the business cannot take more online bookings right now: tell the person to contact the business directly.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items","party_size"],"properties":{"items":{"type":"array","items":{"type":"object","required":["resource","start","end"],"properties":{"resource":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[^\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F]*$"},"start":{"type":"string","minLength":1,"maxLength":64},"end":{"type":"string","minLength":1,"maxLength":64}},"additionalProperties":false},"minItems":1,"maxItems":1},"party_size":{"type":"integer","minimum":1,"maximum":10000}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"place","required":true},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,100}$"},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/places/{place}/bookings/{id}/confirm":{"post":{"summary":"Confirm a held booking","description":"Send \"Authorization: Bearer <token from the hold reply>\" and a new Idempotency-Key header. A missing or wrong token answers 404 not_found. The body needs name, email (a valid address: staff approval and the meeting link are sent there), phone in E.164 form and the terms_version of the hold. A 403 plan_limit_reached means the business cannot take more online bookings right now: tell the person to contact the business directly.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","email","phone","terms_version"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F]*$"},"email":{"type":"string","minLength":1,"maxLength":254,"pattern":"^[^\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F]*$"},"phone":{"type":"string","minLength":1,"maxLength":32,"pattern":"^[^\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F]*$"},"terms_version":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[^\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F]*$"},"note":{"anyOf":[{"type":"string","maxLength":2000,"pattern":"^[^\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F]*$"},{"type":"null"}]}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"place","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,100}$"},"in":"header","name":"idempotency-key","required":true}],"security":[{"bookingToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/places/{place}/bookings/{id}/cancel":{"post":{"summary":"Cancel a booking","description":"Send \"Authorization: Bearer <token from the hold reply>\" and an Idempotency-Key header. A missing or wrong token answers 404 not_found.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"null"},{"type":"object","properties":{},"additionalProperties":false}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"place","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,100}$"},"in":"header","name":"idempotency-key","required":true}],"security":[{"bookingToken":[]}],"responses":{"200":{"description":"Default Response"}}}}},"servers":[{"url":"https://api.soglad.ai"}]}