{"openapi":"3.0.0","info":{"title":"rentservice API","version":"1.0.0"},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{},"parameters":{}},"paths":{"/api/cleaning":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"propertyId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"assigneeUserId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Cleaning schedule","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reservationId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"propertyAddress":{"type":"string","nullable":true},"scheduledAt":{"type":"string","format":"date-time"},"assigneeUserId":{"type":"string","nullable":true,"format":"uuid"},"assigneeName":{"type":"string","nullable":true},"status":{"type":"string","enum":["planned","accepted","done"]},"notificationStatus":{"type":"string","enum":["waiting","delivered"]},"cost":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true},"checkedOutAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","reservationId","propertyId","propertyName","propertyAddress","scheduledAt","assigneeUserId","assigneeName","status","notificationStatus","cost","currency","checkedOutAt"]}}},"required":["items"]}}}}}}},"/api/cleaning/{id}":{"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"assigneeUserId":{"type":"string","nullable":true,"format":"uuid"},"status":{"type":"string","enum":["planned","accepted","done"]},"cost":{"type":"number","minimum":0,"maximum":999999999},"scheduledAt":{"type":"string","format":"date-time"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Updated schedule","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reservationId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"propertyAddress":{"type":"string","nullable":true},"scheduledAt":{"type":"string","format":"date-time"},"assigneeUserId":{"type":"string","nullable":true,"format":"uuid"},"assigneeName":{"type":"string","nullable":true},"status":{"type":"string","enum":["planned","accepted","done"]},"notificationStatus":{"type":"string","enum":["waiting","delivered"]},"cost":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true},"checkedOutAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","reservationId","propertyId","propertyName","propertyAddress","scheduledAt","assigneeUserId","assigneeName","status","notificationStatus","cost","currency","checkedOutAt"]}}},"required":["items"]}}}}}}},"/api/cleaning/checkout/{id}":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Confirmed checkout","content":{"application/json":{"schema":{"type":"object","properties":{"checkedOutAt":{"type":"string","format":"date-time"},"openTasks":{"type":"number"}},"required":["checkedOutAt","openTasks"]}}}}}}},"/api/owners":{"get":{"responses":{"200":{"description":"Owners","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"displayName":{"type":"string","minLength":2,"maxLength":160},"phone":{"type":"string","nullable":true,"maxLength":40,"default":null},"contactEmail":{"type":"string","nullable":true,"format":"email","default":null},"passport":{"type":"string","nullable":true,"maxLength":1000,"default":null},"commissionType":{"type":"string","enum":["gross","net"],"default":"net"},"commissionPercent":{"type":"number","minimum":0,"maximum":100,"default":0},"id":{"type":"string","format":"uuid"},"agreements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"number":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","nullable":true,"format":"date-time"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"fileId":{"type":"string","nullable":true,"format":"uuid"},"terminatedAt":{"type":"string","nullable":true,"format":"date-time"},"terminationReason":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","ownerId","number","startsAt","endsAt","propertyId","fileId","terminatedAt","terminationReason","createdAt"]}},"properties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["displayName","id","agreements","properties"],"additionalProperties":false}}},"required":["items"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"type":"string","minLength":2,"maxLength":160},"phone":{"type":"string","nullable":true,"maxLength":40,"default":null},"contactEmail":{"type":"string","nullable":true,"format":"email","default":null},"passport":{"type":"string","nullable":true,"maxLength":1000,"default":null},"commissionType":{"type":"string","enum":["gross","net"],"default":"net"},"commissionPercent":{"type":"number","minimum":0,"maximum":100,"default":0}},"required":["displayName"],"additionalProperties":false}}}},"responses":{"201":{"description":"Owner","content":{"application/json":{"schema":{"type":"object","properties":{"owner":{"type":"object","properties":{"displayName":{"type":"string","minLength":2,"maxLength":160},"phone":{"type":"string","nullable":true,"maxLength":40,"default":null},"contactEmail":{"type":"string","nullable":true,"format":"email","default":null},"passport":{"type":"string","nullable":true,"maxLength":1000,"default":null},"commissionType":{"type":"string","enum":["gross","net"],"default":"net"},"commissionPercent":{"type":"number","minimum":0,"maximum":100,"default":0},"id":{"type":"string","format":"uuid"},"agreements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"number":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","nullable":true,"format":"date-time"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"fileId":{"type":"string","nullable":true,"format":"uuid"},"terminatedAt":{"type":"string","nullable":true,"format":"date-time"},"terminationReason":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","ownerId","number","startsAt","endsAt","propertyId","fileId","terminatedAt","terminationReason","createdAt"]}},"properties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["displayName","id","agreements","properties"],"additionalProperties":false}},"required":["owner"]}}}}}}},"/api/owners/{id}":{"put":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"type":"string","minLength":2,"maxLength":160},"phone":{"type":"string","nullable":true,"maxLength":40,"default":null},"contactEmail":{"type":"string","nullable":true,"format":"email","default":null},"passport":{"type":"string","nullable":true,"maxLength":1000,"default":null},"commissionType":{"type":"string","enum":["gross","net"],"default":"net"},"commissionPercent":{"type":"number","minimum":0,"maximum":100,"default":0}},"required":["displayName"],"additionalProperties":false}}}},"responses":{"200":{"description":"Owner","content":{"application/json":{"schema":{"type":"object","properties":{"owner":{"type":"object","properties":{"displayName":{"type":"string","minLength":2,"maxLength":160},"phone":{"type":"string","nullable":true,"maxLength":40,"default":null},"contactEmail":{"type":"string","nullable":true,"format":"email","default":null},"passport":{"type":"string","nullable":true,"maxLength":1000,"default":null},"commissionType":{"type":"string","enum":["gross","net"],"default":"net"},"commissionPercent":{"type":"number","minimum":0,"maximum":100,"default":0},"id":{"type":"string","format":"uuid"},"agreements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"number":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","nullable":true,"format":"date-time"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"fileId":{"type":"string","nullable":true,"format":"uuid"},"terminatedAt":{"type":"string","nullable":true,"format":"date-time"},"terminationReason":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","ownerId","number","startsAt","endsAt","propertyId","fileId","terminatedAt","terminationReason","createdAt"]}},"properties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["displayName","id","agreements","properties"],"additionalProperties":false}},"required":["owner"]}}}}}}},"/api/owners/{id}/agreements":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","minLength":1,"maxLength":100},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","nullable":true,"format":"date-time","default":null},"propertyId":{"type":"string","nullable":true,"format":"uuid","default":null},"fileId":{"type":"string","nullable":true,"format":"uuid","default":null}},"required":["number","startsAt"],"additionalProperties":false}}}},"responses":{"201":{"description":"Agreement","content":{"application/json":{"schema":{"type":"object","properties":{"agreement":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"number":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","nullable":true,"format":"date-time"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"fileId":{"type":"string","nullable":true,"format":"uuid"},"terminatedAt":{"type":"string","nullable":true,"format":"date-time"},"terminationReason":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","ownerId","number","startsAt","endsAt","propertyId","fileId","terminatedAt","terminationReason","createdAt"]}},"required":["agreement"]}}}}}}},"/api/owners/agreements/{id}/terminate":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"terminatedAt":{"type":"string","format":"date-time"},"terminationReason":{"type":"string","minLength":1,"maxLength":1000}},"required":["terminatedAt","terminationReason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Terminated agreement","content":{"application/json":{"schema":{"type":"object","properties":{"agreement":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"number":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","nullable":true,"format":"date-time"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"fileId":{"type":"string","nullable":true,"format":"uuid"},"terminatedAt":{"type":"string","nullable":true,"format":"date-time"},"terminationReason":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","ownerId","number","startsAt","endsAt","propertyId","fileId","terminatedAt","terminationReason","createdAt"]}},"required":["agreement"]}}}}}}},"/api/managed-files/booking-template/test-preview":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":100000},"fileId":{"type":"string","nullable":true,"format":"uuid"}},"required":["text","fileId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Тестовый договор"}}}},"/api/managed-files":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"purpose":{"type":"string","enum":["passport","chanote","owner_contract","signature","booking_template","task_photo","assistant"]},"ownerId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"originalName":{"type":"string","minLength":1,"maxLength":200},"contentType":{"type":"string","enum":["application/pdf","text/plain","text/csv","text/markdown","image/jpeg","image/png","image/webp","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]},"byteSize":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":20971520}},"required":["purpose","originalName","contentType","byteSize"],"additionalProperties":false}}}},"responses":{"201":{"description":"Upload","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"upload":{"type":"object","properties":{"method":{"type":"string","enum":["PUT"]},"url":{"type":"string","format":"uri"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"contentLength":{"type":"number"},"expiresAt":{"type":"string"}},"required":["method","url","headers","contentLength","expiresAt"]}},"required":["id","upload"]}}}}}}},"/api/managed-files/{id}/finalize":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"File","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"originalName":{"type":"string"},"purpose":{"type":"string"},"contentType":{"type":"string"},"ownerId":{"type":"string","nullable":true,"format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"uploadedBy":{"type":"string"}},"required":["id","originalName","purpose","contentType","ownerId","propertyId"]}},"required":["file"]}}}}}}},"/api/managed-files/owner/{id}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Files","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"originalName":{"type":"string"},"purpose":{"type":"string"},"contentType":{"type":"string"},"ownerId":{"type":"string","nullable":true,"format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"uploadedBy":{"type":"string"}},"required":["id","originalName","purpose","contentType","ownerId","propertyId"]}}},"required":["items"]}}}}}}},"/api/managed-files/property/{id}/contracts":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Договоры объекта","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"originalName":{"type":"string"},"purpose":{"type":"string"},"contentType":{"type":"string"},"ownerId":{"type":"string","nullable":true,"format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"uploadedBy":{"type":"string"}},"required":["id","originalName","purpose","contentType","ownerId","propertyId"]}}},"required":["items"]}}}}}}},"/api/managed-files/{id}/download":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Private download","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}}}}},"/api/managed-files/booking-template":{"get":{"responses":{"200":{"description":"Template","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":20,"maxLength":100000},"signatureFileId":{"type":"string","nullable":true,"format":"uuid"},"fileId":{"type":"string","nullable":true,"format":"uuid","default":null},"fileContentType":{"type":"string","nullable":true}},"required":["text","signatureFileId"],"additionalProperties":false}}}}}},"put":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":20,"maxLength":100000},"signatureFileId":{"type":"string","nullable":true,"format":"uuid"},"fileId":{"type":"string","nullable":true,"format":"uuid","default":null}},"required":["text","signatureFileId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Template","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":20,"maxLength":100000},"signatureFileId":{"type":"string","nullable":true,"format":"uuid"},"fileId":{"type":"string","nullable":true,"format":"uuid","default":null},"fileContentType":{"type":"string","nullable":true}},"required":["text","signatureFileId"],"additionalProperties":false}}}}}}},"/api/managed-files/booking-template/preview":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":100000},"reservationId":{"type":"string","format":"uuid"}},"required":["text","reservationId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Предпросмотр","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]}}}}}}},"/api/assistant/status":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Whether the assistant can answer, for the UI","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"reason":{"type":"string","enum":["disabled","not_configured","role_not_allowed"]},"maxAttachmentBytes":{"type":"integer","minimum":0,"exclusiveMinimum":true},"dailyMessageLimit":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["enabled","maxAttachmentBytes","dailyMessageLimit"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/assistant/threads":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Own threads, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","title","createdAt","updatedAt"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120}},"additionalProperties":false}}}},"responses":{"201":{"description":"Created thread","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","title","createdAt","updatedAt"]}},"required":["thread"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/assistant/threads/{id}":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Thread with messages","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","title","createdAt","updatedAt"]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["user","assistant","tool"]},"content":{"type":"string"},"toolCall":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"arguments":{"type":"string"},"ok":{"type":"boolean"}},"required":["id","name","arguments","ok"]},"proposal":{"type":"object","nullable":true,"properties":{"id":{"type":"string","minLength":1},"kind":{"type":"string","enum":["task","expense","booking","incident","guide","owner","transaction"]},"section":{"type":"string"},"title":{"type":"string"},"payload":{"type":"object","additionalProperties":{"nullable":true}},"endpoint":{"type":"object","properties":{"method":{"type":"string","enum":["POST"]},"path":{"type":"string"}},"required":["method","path"]}},"required":["id","kind","section","title","payload","endpoint"]},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"contentType":{"type":"string","enum":["application/pdf","text/plain","text/csv","text/markdown","image/jpeg","image/png","image/webp","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]},"byteSize":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["id","name","contentType","byteSize"]}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","role","content","toolCall","proposal","attachments","createdAt"]}}},"required":["thread","messages"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Thread not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted with its messages"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Thread not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/assistant/threads/{id}/messages":{"post":{"security":[{"BearerAuth":[]}],"description":"Отправляет сообщение и отвечает потоком text/event-stream. События: delta {text}, tool {id,name,title,status}, proposal {id,kind,section,title,payload,endpoint}, затем ровно одно done {threadId,messageId} или error {code,message}. Схемы данных событий — assistantStreamEventDataSchemas в packages/contracts.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":8000},"attachmentIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":5},"context":{"type":"object","properties":{"path":{"type":"string","maxLength":200,"pattern":"^\\/[A-Za-z0-9/_\\-[\\]]*$"},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["property","booking","task","incident","owner","guide","expense_document","transaction"]},"id":{"type":"string","format":"uuid"}},"required":["type","id"],"additionalProperties":false}},"required":["path"],"additionalProperties":false}},"required":["text"],"additionalProperties":false}}}},"responses":{"200":{"description":"Server-sent events","content":{"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid message or attachment","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"The assistant is not available to this role (admin settings)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Thread not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Daily message limit reached","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"503":{"description":"ASSISTANT_UNAVAILABLE: disabled or no model key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/register":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"},"password":{"type":"string","minLength":8,"maxLength":128},"displayName":{"anyOf":[{"type":"string","minLength":2,"maxLength":80},{"type":"string","enum":[""]}]},"role":{"type":"string","enum":["organization","owner"]}},"required":["email","password","role"]}}}},"responses":{"201":{"description":"Created user and browser session","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","nullable":true},"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","displayName","role","createdAt"]},"accessToken":{"type":"string"}},"required":["user","accessToken"],"additionalProperties":false}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Cookie auth request came from an untrusted browser origin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Email already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/token/register":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"},"password":{"type":"string","minLength":8,"maxLength":128},"displayName":{"anyOf":[{"type":"string","minLength":2,"maxLength":80},{"type":"string","enum":[""]}]},"role":{"type":"string","enum":["organization","owner"]}},"required":["email","password","role"]}}}},"responses":{"201":{"description":"Created user and explicit token session","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","nullable":true},"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","displayName","role","createdAt"]},"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["user","accessToken","refreshToken"],"additionalProperties":false}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Email already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/login":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"},"password":{"type":"string","minLength":8,"maxLength":128}},"required":["email","password"]}}}},"responses":{"200":{"description":"Created browser session","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","nullable":true},"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","displayName","role","createdAt"]},"accessToken":{"type":"string"}},"required":["user","accessToken"],"additionalProperties":false}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Cookie auth request came from an untrusted browser origin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/token/login":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"},"password":{"type":"string","minLength":8,"maxLength":128}},"required":["email","password"]}}}},"responses":{"200":{"description":"Created explicit token session","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","nullable":true},"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","displayName","role","createdAt"]},"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["user","accessToken","refreshToken"],"additionalProperties":false}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/refresh":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{},"default":{},"additionalProperties":false}}}},"responses":{"200":{"description":"Rotated browser session and returned a new access token","content":{"application/json":{"schema":{"type":"object","properties":{"accessToken":{"type":"string"}},"required":["accessToken"],"additionalProperties":false}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Invalid refresh token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Cookie auth request came from an untrusted browser origin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/token/refresh":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"refreshToken":{"type":"string","minLength":32}},"required":["refreshToken"]}}}},"responses":{"200":{"description":"Rotated explicit token session","content":{"application/json":{"schema":{"type":"object","properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["accessToken","refreshToken"],"additionalProperties":false}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Invalid refresh token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/me":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Current user","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","nullable":true},"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","displayName","role","createdAt"]}},"required":["user"]}}}},"401":{"description":"Invalid access token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/owner-invites":{"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["link","code"]},"contactEmail":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","minLength":2,"maxLength":80}},"required":["channel"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created owner invitation","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"channel":{"type":"string","enum":["link","code"]},"credential":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["id","ownerId","channel","credential","expiresAt"]}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Organization account required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/staff-invites":{"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"type":"object","properties":{"displayName":{"type":"string","minLength":2,"maxLength":160},"jobTitle":{"type":"string","maxLength":120,"default":""},"phone":{"type":"string","maxLength":40,"default":""},"passport":{"type":"string","maxLength":1000,"default":""},"salary":{"type":"number","minimum":0,"maximum":999999999,"default":0},"payoutMethod":{"type":"string","enum":["cash","bank_transfer","card"],"default":"bank_transfer"},"telegramChatId":{"type":"string","nullable":true,"pattern":"^-?\\d+$","default":null},"permissionGroup":{"type":"string","enum":["custom","manager","accountant","cleaner","viewer"],"default":"custom"}},"required":["displayName"],"additionalProperties":false},"email":{"type":"string","maxLength":254,"format":"email"}},"required":["email"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created staff invitation","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"credential":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"email":{"type":"string","maxLength":254,"format":"email"}},"required":["id","credential","expiresAt","email"]}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Organization account required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/staff-invites/{membershipId}/resend":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"membershipId","in":"path"}],"responses":{"201":{"description":"Reissued staff invitation","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"credential":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"email":{"type":"string","maxLength":254,"format":"email"}},"required":["id","credential","expiresAt","email"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/tenant-invites":{"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reservationId":{"type":"string","format":"uuid"},"channel":{"type":"string","enum":["link","email","code","automatic"]},"email":{"type":"string","maxLength":254,"format":"email"},"phone":{"type":"string","minLength":7,"maxLength":32}},"required":["reservationId","channel"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created tenant invitation","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reservationId":{"type":"string","format":"uuid"},"channel":{"type":"string","enum":["link","email","code","automatic"]},"credential":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["id","reservationId","channel","credential","expiresAt"]}}}},"400":{"description":"Invalid payload or reservation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/owner-invites/accept":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["link","code"]},"credential":{"type":"string","minLength":6,"maxLength":256},"email":{"type":"string","maxLength":254,"format":"email"},"password":{"type":"string","minLength":8,"maxLength":128},"displayName":{"type":"string","minLength":2,"maxLength":80},"phone":{"type":"string","minLength":7,"maxLength":32}},"required":["channel","credential","email","password","displayName"],"additionalProperties":false}}}},"responses":{"201":{"description":"Activated invited owner account","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","nullable":true},"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","displayName","role","createdAt"]},"accessToken":{"type":"string"}},"required":["user","accessToken"],"additionalProperties":false}}}},"400":{"description":"Invalid or expired invitation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Cookie auth request came from an untrusted browser origin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/token/owner-invites/accept":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["link","code"]},"credential":{"type":"string","minLength":6,"maxLength":256},"email":{"type":"string","maxLength":254,"format":"email"},"password":{"type":"string","minLength":8,"maxLength":128},"displayName":{"type":"string","minLength":2,"maxLength":80},"phone":{"type":"string","minLength":7,"maxLength":32}},"required":["channel","credential","email","password","displayName"],"additionalProperties":false}}}},"responses":{"201":{"description":"Activated invited owner account","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","nullable":true},"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","displayName","role","createdAt"]},"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["user","accessToken","refreshToken"],"additionalProperties":false}}}},"400":{"description":"Invalid or expired invitation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/token/staff-invites/accept":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"credential":{"type":"string","minLength":43,"maxLength":256},"password":{"type":"string","minLength":8,"maxLength":128},"displayName":{"type":"string","minLength":2,"maxLength":80}},"required":["credential","password","displayName"],"additionalProperties":false}}}},"responses":{"201":{"description":"Activated invited staff account","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","nullable":true},"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","displayName","role","createdAt"]},"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["user","accessToken","refreshToken"],"additionalProperties":false}}}},"400":{"description":"Invalid or expired invitation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/staff-invites/accept":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"credential":{"type":"string","minLength":43,"maxLength":256},"password":{"type":"string","minLength":8,"maxLength":128},"displayName":{"type":"string","minLength":2,"maxLength":80}},"required":["credential","password","displayName"],"additionalProperties":false}}}},"responses":{"201":{"description":"Activated invited staff account","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","nullable":true},"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","displayName","role","createdAt"]},"accessToken":{"type":"string"}},"required":["user","accessToken"],"additionalProperties":false}}}},"400":{"description":"Invalid or expired invitation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Cookie auth request came from an untrusted browser origin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/token/tenant-invites/accept":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["link","email","code","automatic"]},"credential":{"type":"string","minLength":6,"maxLength":256},"email":{"type":"string","maxLength":254,"format":"email"},"password":{"type":"string","minLength":8,"maxLength":128},"displayName":{"type":"string","minLength":2,"maxLength":80}},"required":["channel","credential","email","password","displayName"],"additionalProperties":false}}}},"responses":{"201":{"description":"Activated invited tenant account","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","nullable":true},"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","displayName","role","createdAt"]},"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["user","accessToken","refreshToken"],"additionalProperties":false}}}},"400":{"description":"Invalid or expired invitation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/tenant-invites/accept":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["link","email","code","automatic"]},"credential":{"type":"string","minLength":6,"maxLength":256},"email":{"type":"string","maxLength":254,"format":"email"},"password":{"type":"string","minLength":8,"maxLength":128},"displayName":{"type":"string","minLength":2,"maxLength":80}},"required":["channel","credential","email","password","displayName"],"additionalProperties":false}}}},"responses":{"201":{"description":"Activated invited tenant account","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","nullable":true},"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","displayName","role","createdAt"]},"accessToken":{"type":"string"}},"required":["user","accessToken"],"additionalProperties":false}}}},"400":{"description":"Invalid or expired invitation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Cookie auth request came from an untrusted browser origin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/logout":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{},"default":{},"additionalProperties":false}}}},"responses":{"204":{"description":"Browser session revoked"},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Cookie auth request came from an untrusted browser origin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/token/logout":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"refreshToken":{"type":"string","minLength":32}},"required":["refreshToken"]}}}},"responses":{"204":{"description":"Explicit token session revoked"},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/password-reset/request":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"}},"required":["email"]}}}},"responses":{"202":{"description":"Password reset request accepted","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"boolean","enum":[true]}},"required":["accepted"]}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/auth/password-reset/confirm":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":43,"maxLength":256},"password":{"type":"string","minLength":8,"maxLength":128}},"required":["token","password"]}}}},"responses":{"204":{"description":"Password changed and existing sessions revoked"},"400":{"description":"Invalid payload or reset link","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many authentication requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/billing/overview":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Current organization plan and resolved features","content":{"application/json":{"schema":{"type":"object","properties":{"subscription":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","cancelled","expired"]},"currentPeriodEnd":{"type":"string","nullable":true,"format":"date-time"},"plan":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string"},"name":{"type":"string"},"price":{"type":"string"},"currency":{"type":"string","minLength":3,"maxLength":3},"billingPeriod":{"type":"string","enum":["monthly","yearly"]},"features":{"type":"object","properties":{"maxProperties":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"maxStaff":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"csvSourcesLimit":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"customDomainAgency":{"type":"boolean"},"customDomainProperty":{"type":"boolean"},"onlineBooking":{"type":"boolean"},"whitelabel":{"type":"boolean"},"smsNotifications":{"type":"boolean"}},"required":["maxProperties","maxStaff","csvSourcesLimit","customDomainAgency","customDomainProperty","onlineBooking","whitelabel","smsNotifications"],"additionalProperties":false}},"required":["id","code","name","price","currency","billingPeriod","features"]}},"required":["id","status","currentPeriodEnd","plan"]},"billingEnabled":{"type":"boolean","enum":[false]}},"required":["subscription","billingEnabled"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Organization required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/bookings":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"propertyId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","enum":["pending","confirmed","completed","cancelled","no_show"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","maxLength":120},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Visible reservations","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"infants":{"type":"integer","minimum":0,"default":0},"sourceDetail":{"type":"string","enum":["airbnb","booking","direct","agency","other"],"default":"agency"},"checkedOutAt":{"type":"string","nullable":true,"format":"date-time","default":null},"contractText":{"type":"string","nullable":true,"default":null},"contractSignatureId":{"type":"string","nullable":true,"format":"uuid","default":null},"contractFileId":{"type":"string","nullable":true,"format":"uuid","default":null},"contractGeneratedAt":{"type":"string","nullable":true,"format":"date-time","default":null},"id":{"type":"string","format":"uuid"},"property":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"timezone":{"type":"string"},"managerContact":{"type":"object","properties":{"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true}},"required":["name","email","phone"]}},"required":["id","name","timezone","managerContact"]},"tenantUserId":{"type":"string","nullable":true,"format":"uuid"},"source":{"type":"string","enum":["manual","ota","direct"]},"status":{"type":"string","enum":["pending","confirmed","completed","cancelled","no_show"]},"guestName":{"type":"string"},"guestEmail":{"type":"string","nullable":true,"format":"email"},"guestPhone":{"type":"string","nullable":true},"guestWishes":{"type":"string","nullable":true},"adults":{"type":"integer","minimum":0,"exclusiveMinimum":true},"children":{"type":"integer","minimum":0},"babyCrib":{"type":"boolean"},"highChair":{"type":"boolean"},"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"totalAmount":{"type":"number","minimum":0,"maximum":999999999999.99},"settledAmount":{"type":"number","nullable":true,"minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"paymentMethod":{"type":"string","nullable":true,"enum":["cash","bank_transfer","card",null]},"paymentStatus":{"type":"string","enum":["unpaid","paid","partially_paid"]},"paidAt":{"type":"string","nullable":true,"format":"date-time"},"cancellationInitiator":{"type":"string","nullable":true,"enum":["guest","agency","ota",null]},"cancellationReason":{"type":"string","nullable":true},"cancellationComment":{"type":"string","nullable":true},"cancelledAt":{"type":"string","nullable":true,"format":"date-time"},"cleaningMode":{"type":"string","enum":["included","separate","not_required"]},"cleaningPrice":{"type":"number","nullable":true,"minimum":0,"maximum":999999999999.99},"cleaningCurrency":{"type":"string","nullable":true,"minLength":3,"maxLength":3},"securityDeposit":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"reservationId":{"type":"string","format":"uuid"},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"receiptMethod":{"type":"string"},"status":{"type":"string","enum":["expected","received","returned","retained"]},"receivedAt":{"type":"string","nullable":true,"format":"date-time"},"returnedAt":{"type":"string","nullable":true,"format":"date-time"},"retentionReason":{"type":"string","nullable":true},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}}},"required":["id","reservationId","amount","currency","receiptMethod","status","receivedAt","returnedAt","retentionReason","incidentId","photoUrls"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","property","tenantUserId","source","status","guestName","guestEmail","guestPhone","guestWishes","adults","children","babyCrib","highChair","checkIn","checkOut","totalAmount","settledAmount","currency","paymentMethod","paymentStatus","paidAt","cancellationInitiator","cancellationReason","cancellationComment","cancelledAt","cleaningMode","cleaningPrice","cleaningCurrency","securityDeposit","createdAt","updatedAt"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"infants":{"type":"integer","minimum":0,"maximum":100,"default":0},"sourceDetail":{"type":"string","enum":["airbnb","booking","direct","agency","other"],"default":"agency"},"createdAt":{"type":"string","format":"date-time"},"paidAt":{"type":"string","format":"date-time"},"generateContract":{"type":"boolean","default":false},"includeSignature":{"type":"boolean","default":false},"deposit":{"type":"object","properties":{"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string"},"receiptMethod":{"type":"string","enum":["cash","bank_transfer","card"]},"status":{"type":"string","enum":["expected","received"]}},"required":["amount","currency","receiptMethod","status"],"additionalProperties":false},"propertyId":{"type":"string","format":"uuid"},"guestName":{"type":"string","minLength":2,"maxLength":160},"guestEmail":{"type":"string","maxLength":254,"format":"email"},"guestPhone":{"type":"string","minLength":7,"maxLength":32},"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"totalAmount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string"},"status":{"type":"string","enum":["pending","confirmed"],"default":"confirmed"},"guestWishes":{"type":"string","maxLength":2000},"adults":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":1},"children":{"type":"integer","minimum":0,"maximum":100,"default":0},"babyCrib":{"type":"boolean","default":false},"highChair":{"type":"boolean","default":false},"paymentMethod":{"type":"string","enum":["cash","bank_transfer","card"]},"paymentStatus":{"type":"string","enum":["unpaid","paid","partially_paid"],"default":"unpaid"},"paidAmount":{"type":"number","minimum":0.01,"maximum":999999999999.99},"cleaningMode":{"type":"string","enum":["included","separate","not_required"],"default":"included"},"cleaningPrice":{"type":"number","minimum":0,"maximum":999999999999.99},"cleaningCurrency":{"type":"string","minLength":3,"maxLength":3}},"required":["propertyId","guestName","checkIn","checkOut","totalAmount","currency"],"additionalProperties":false}}}},"responses":{"201":{"description":"Manual reservation created","content":{"application/json":{"schema":{"type":"object","properties":{"reservation":{"type":"object","properties":{"infants":{"type":"integer","minimum":0,"default":0},"sourceDetail":{"type":"string","enum":["airbnb","booking","direct","agency","other"],"default":"agency"},"checkedOutAt":{"type":"string","nullable":true,"format":"date-time","default":null},"contractText":{"type":"string","nullable":true,"default":null},"contractSignatureId":{"type":"string","nullable":true,"format":"uuid","default":null},"contractFileId":{"type":"string","nullable":true,"format":"uuid","default":null},"contractGeneratedAt":{"type":"string","nullable":true,"format":"date-time","default":null},"id":{"type":"string","format":"uuid"},"property":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"timezone":{"type":"string"},"managerContact":{"type":"object","properties":{"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true}},"required":["name","email","phone"]}},"required":["id","name","timezone","managerContact"]},"tenantUserId":{"type":"string","nullable":true,"format":"uuid"},"source":{"type":"string","enum":["manual","ota","direct"]},"status":{"type":"string","enum":["pending","confirmed","completed","cancelled","no_show"]},"guestName":{"type":"string"},"guestEmail":{"type":"string","nullable":true,"format":"email"},"guestPhone":{"type":"string","nullable":true},"guestWishes":{"type":"string","nullable":true},"adults":{"type":"integer","minimum":0,"exclusiveMinimum":true},"children":{"type":"integer","minimum":0},"babyCrib":{"type":"boolean"},"highChair":{"type":"boolean"},"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"totalAmount":{"type":"number","minimum":0,"maximum":999999999999.99},"settledAmount":{"type":"number","nullable":true,"minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"paymentMethod":{"type":"string","nullable":true,"enum":["cash","bank_transfer","card",null]},"paymentStatus":{"type":"string","enum":["unpaid","paid","partially_paid"]},"paidAt":{"type":"string","nullable":true,"format":"date-time"},"cancellationInitiator":{"type":"string","nullable":true,"enum":["guest","agency","ota",null]},"cancellationReason":{"type":"string","nullable":true},"cancellationComment":{"type":"string","nullable":true},"cancelledAt":{"type":"string","nullable":true,"format":"date-time"},"cleaningMode":{"type":"string","enum":["included","separate","not_required"]},"cleaningPrice":{"type":"number","nullable":true,"minimum":0,"maximum":999999999999.99},"cleaningCurrency":{"type":"string","nullable":true,"minLength":3,"maxLength":3},"securityDeposit":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"reservationId":{"type":"string","format":"uuid"},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"receiptMethod":{"type":"string"},"status":{"type":"string","enum":["expected","received","returned","retained"]},"receivedAt":{"type":"string","nullable":true,"format":"date-time"},"returnedAt":{"type":"string","nullable":true,"format":"date-time"},"retentionReason":{"type":"string","nullable":true},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}}},"required":["id","reservationId","amount","currency","receiptMethod","status","receivedAt","returnedAt","retentionReason","incidentId","photoUrls"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","property","tenantUserId","source","status","guestName","guestEmail","guestPhone","guestWishes","adults","children","babyCrib","highChair","checkIn","checkOut","totalAmount","settledAmount","currency","paymentMethod","paymentStatus","paidAt","cancellationInitiator","cancellationReason","cancellationComment","cancelledAt","cleaningMode","cleaningPrice","cleaningCurrency","securityDeposit","createdAt","updatedAt"]}},"required":["reservation"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Date conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/bookings/{reservationId}":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"reservationId","in":"path"}],"responses":{"200":{"description":"Reservation","content":{"application/json":{"schema":{"type":"object","properties":{"reservation":{"type":"object","properties":{"infants":{"type":"integer","minimum":0,"default":0},"sourceDetail":{"type":"string","enum":["airbnb","booking","direct","agency","other"],"default":"agency"},"checkedOutAt":{"type":"string","nullable":true,"format":"date-time","default":null},"contractText":{"type":"string","nullable":true,"default":null},"contractSignatureId":{"type":"string","nullable":true,"format":"uuid","default":null},"contractFileId":{"type":"string","nullable":true,"format":"uuid","default":null},"contractGeneratedAt":{"type":"string","nullable":true,"format":"date-time","default":null},"id":{"type":"string","format":"uuid"},"property":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"timezone":{"type":"string"},"managerContact":{"type":"object","properties":{"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true}},"required":["name","email","phone"]}},"required":["id","name","timezone","managerContact"]},"tenantUserId":{"type":"string","nullable":true,"format":"uuid"},"source":{"type":"string","enum":["manual","ota","direct"]},"status":{"type":"string","enum":["pending","confirmed","completed","cancelled","no_show"]},"guestName":{"type":"string"},"guestEmail":{"type":"string","nullable":true,"format":"email"},"guestPhone":{"type":"string","nullable":true},"guestWishes":{"type":"string","nullable":true},"adults":{"type":"integer","minimum":0,"exclusiveMinimum":true},"children":{"type":"integer","minimum":0},"babyCrib":{"type":"boolean"},"highChair":{"type":"boolean"},"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"totalAmount":{"type":"number","minimum":0,"maximum":999999999999.99},"settledAmount":{"type":"number","nullable":true,"minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"paymentMethod":{"type":"string","nullable":true,"enum":["cash","bank_transfer","card",null]},"paymentStatus":{"type":"string","enum":["unpaid","paid","partially_paid"]},"paidAt":{"type":"string","nullable":true,"format":"date-time"},"cancellationInitiator":{"type":"string","nullable":true,"enum":["guest","agency","ota",null]},"cancellationReason":{"type":"string","nullable":true},"cancellationComment":{"type":"string","nullable":true},"cancelledAt":{"type":"string","nullable":true,"format":"date-time"},"cleaningMode":{"type":"string","enum":["included","separate","not_required"]},"cleaningPrice":{"type":"number","nullable":true,"minimum":0,"maximum":999999999999.99},"cleaningCurrency":{"type":"string","nullable":true,"minLength":3,"maxLength":3},"securityDeposit":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"reservationId":{"type":"string","format":"uuid"},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"receiptMethod":{"type":"string"},"status":{"type":"string","enum":["expected","received","returned","retained"]},"receivedAt":{"type":"string","nullable":true,"format":"date-time"},"returnedAt":{"type":"string","nullable":true,"format":"date-time"},"retentionReason":{"type":"string","nullable":true},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}}},"required":["id","reservationId","amount","currency","receiptMethod","status","receivedAt","returnedAt","retentionReason","incidentId","photoUrls"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","property","tenantUserId","source","status","guestName","guestEmail","guestPhone","guestWishes","adults","children","babyCrib","highChair","checkIn","checkOut","totalAmount","settledAmount","currency","paymentMethod","paymentStatus","paidAt","cancellationInitiator","cancellationReason","cancellationComment","cancelledAt","cleaningMode","cleaningPrice","cleaningCurrency","securityDeposit","createdAt","updatedAt"]}},"required":["reservation"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"reservationId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"guestName":{"type":"string","minLength":2,"maxLength":160},"guestEmail":{"type":"string","nullable":true,"maxLength":254,"format":"email"},"guestPhone":{"type":"string","nullable":true,"minLength":7,"maxLength":32},"guestWishes":{"type":"string","nullable":true,"maxLength":2000},"adults":{"type":"integer","minimum":1,"maximum":100},"children":{"type":"integer","minimum":0,"maximum":100},"infants":{"type":"integer","minimum":0,"maximum":100},"babyCrib":{"type":"boolean"},"highChair":{"type":"boolean"},"totalAmount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string"},"source":{"type":"string","enum":["manual","ota","direct"]},"sourceDetail":{"type":"string","enum":["airbnb","booking","direct","agency","other"]}},"required":["checkIn","checkOut","guestName","guestEmail","guestPhone","guestWishes","adults","children","infants","babyCrib","highChair","totalAmount","currency","source","sourceDetail"],"additionalProperties":false}}}},"responses":{"200":{"description":"Reservation updated","content":{"application/json":{"schema":{"type":"object","properties":{"reservation":{"type":"object","properties":{"infants":{"type":"integer","minimum":0,"default":0},"sourceDetail":{"type":"string","enum":["airbnb","booking","direct","agency","other"],"default":"agency"},"checkedOutAt":{"type":"string","nullable":true,"format":"date-time","default":null},"contractText":{"type":"string","nullable":true,"default":null},"contractSignatureId":{"type":"string","nullable":true,"format":"uuid","default":null},"contractFileId":{"type":"string","nullable":true,"format":"uuid","default":null},"contractGeneratedAt":{"type":"string","nullable":true,"format":"date-time","default":null},"id":{"type":"string","format":"uuid"},"property":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"timezone":{"type":"string"},"managerContact":{"type":"object","properties":{"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true}},"required":["name","email","phone"]}},"required":["id","name","timezone","managerContact"]},"tenantUserId":{"type":"string","nullable":true,"format":"uuid"},"source":{"type":"string","enum":["manual","ota","direct"]},"status":{"type":"string","enum":["pending","confirmed","completed","cancelled","no_show"]},"guestName":{"type":"string"},"guestEmail":{"type":"string","nullable":true,"format":"email"},"guestPhone":{"type":"string","nullable":true},"guestWishes":{"type":"string","nullable":true},"adults":{"type":"integer","minimum":0,"exclusiveMinimum":true},"children":{"type":"integer","minimum":0},"babyCrib":{"type":"boolean"},"highChair":{"type":"boolean"},"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"totalAmount":{"type":"number","minimum":0,"maximum":999999999999.99},"settledAmount":{"type":"number","nullable":true,"minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"paymentMethod":{"type":"string","nullable":true,"enum":["cash","bank_transfer","card",null]},"paymentStatus":{"type":"string","enum":["unpaid","paid","partially_paid"]},"paidAt":{"type":"string","nullable":true,"format":"date-time"},"cancellationInitiator":{"type":"string","nullable":true,"enum":["guest","agency","ota",null]},"cancellationReason":{"type":"string","nullable":true},"cancellationComment":{"type":"string","nullable":true},"cancelledAt":{"type":"string","nullable":true,"format":"date-time"},"cleaningMode":{"type":"string","enum":["included","separate","not_required"]},"cleaningPrice":{"type":"number","nullable":true,"minimum":0,"maximum":999999999999.99},"cleaningCurrency":{"type":"string","nullable":true,"minLength":3,"maxLength":3},"securityDeposit":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"reservationId":{"type":"string","format":"uuid"},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"receiptMethod":{"type":"string"},"status":{"type":"string","enum":["expected","received","returned","retained"]},"receivedAt":{"type":"string","nullable":true,"format":"date-time"},"returnedAt":{"type":"string","nullable":true,"format":"date-time"},"retentionReason":{"type":"string","nullable":true},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}}},"required":["id","reservationId","amount","currency","receiptMethod","status","receivedAt","returnedAt","retentionReason","incidentId","photoUrls"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","property","tenantUserId","source","status","guestName","guestEmail","guestPhone","guestWishes","adults","children","babyCrib","highChair","checkIn","checkOut","totalAmount","settledAmount","currency","paymentMethod","paymentStatus","paidAt","cancellationInitiator","cancellationReason","cancellationComment","cancelledAt","cleaningMode","cleaningPrice","cleaningCurrency","securityDeposit","createdAt","updatedAt"]}},"required":["reservation"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Date conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/bookings/{reservationId}/contract":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"reservationId","in":"path"}],"responses":{"200":{"description":"Договор сформирован","content":{"application/json":{"schema":{"type":"object","properties":{"reservation":{"type":"object","properties":{"infants":{"type":"integer","minimum":0,"default":0},"sourceDetail":{"type":"string","enum":["airbnb","booking","direct","agency","other"],"default":"agency"},"checkedOutAt":{"type":"string","nullable":true,"format":"date-time","default":null},"contractText":{"type":"string","nullable":true,"default":null},"contractSignatureId":{"type":"string","nullable":true,"format":"uuid","default":null},"contractFileId":{"type":"string","nullable":true,"format":"uuid","default":null},"contractGeneratedAt":{"type":"string","nullable":true,"format":"date-time","default":null},"id":{"type":"string","format":"uuid"},"property":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"timezone":{"type":"string"},"managerContact":{"type":"object","properties":{"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true}},"required":["name","email","phone"]}},"required":["id","name","timezone","managerContact"]},"tenantUserId":{"type":"string","nullable":true,"format":"uuid"},"source":{"type":"string","enum":["manual","ota","direct"]},"status":{"type":"string","enum":["pending","confirmed","completed","cancelled","no_show"]},"guestName":{"type":"string"},"guestEmail":{"type":"string","nullable":true,"format":"email"},"guestPhone":{"type":"string","nullable":true},"guestWishes":{"type":"string","nullable":true},"adults":{"type":"integer","minimum":0,"exclusiveMinimum":true},"children":{"type":"integer","minimum":0},"babyCrib":{"type":"boolean"},"highChair":{"type":"boolean"},"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"totalAmount":{"type":"number","minimum":0,"maximum":999999999999.99},"settledAmount":{"type":"number","nullable":true,"minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"paymentMethod":{"type":"string","nullable":true,"enum":["cash","bank_transfer","card",null]},"paymentStatus":{"type":"string","enum":["unpaid","paid","partially_paid"]},"paidAt":{"type":"string","nullable":true,"format":"date-time"},"cancellationInitiator":{"type":"string","nullable":true,"enum":["guest","agency","ota",null]},"cancellationReason":{"type":"string","nullable":true},"cancellationComment":{"type":"string","nullable":true},"cancelledAt":{"type":"string","nullable":true,"format":"date-time"},"cleaningMode":{"type":"string","enum":["included","separate","not_required"]},"cleaningPrice":{"type":"number","nullable":true,"minimum":0,"maximum":999999999999.99},"cleaningCurrency":{"type":"string","nullable":true,"minLength":3,"maxLength":3},"securityDeposit":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"reservationId":{"type":"string","format":"uuid"},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"receiptMethod":{"type":"string"},"status":{"type":"string","enum":["expected","received","returned","retained"]},"receivedAt":{"type":"string","nullable":true,"format":"date-time"},"returnedAt":{"type":"string","nullable":true,"format":"date-time"},"retentionReason":{"type":"string","nullable":true},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}}},"required":["id","reservationId","amount","currency","receiptMethod","status","receivedAt","returnedAt","retentionReason","incidentId","photoUrls"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","property","tenantUserId","source","status","guestName","guestEmail","guestPhone","guestWishes","adults","children","babyCrib","highChair","checkIn","checkOut","totalAmount","settledAmount","currency","paymentMethod","paymentStatus","paidAt","cancellationInitiator","cancellationReason","cancellationComment","cancelledAt","cleaningMode","cleaningPrice","cleaningCurrency","securityDeposit","createdAt","updatedAt"]}},"required":["reservation"]}}}}}},"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"reservationId","in":"path"}],"responses":{"200":{"description":"Booking contract","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"signatureUrl":{"type":"string","nullable":true,"format":"uri"}},"required":["text","signatureUrl"]}}}}}}},"/api/bookings/{reservationId}/status":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"reservationId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["pending","confirmed","completed","cancelled","no_show"]},"cancellationInitiator":{"type":"string","enum":["guest","agency","ota"]},"cancellationReason":{"type":"string","minLength":1,"maxLength":300},"cancellationComment":{"type":"string","nullable":true,"maxLength":2000}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Status updated","content":{"application/json":{"schema":{"type":"object","properties":{"reservation":{"type":"object","properties":{"infants":{"type":"integer","minimum":0,"default":0},"sourceDetail":{"type":"string","enum":["airbnb","booking","direct","agency","other"],"default":"agency"},"checkedOutAt":{"type":"string","nullable":true,"format":"date-time","default":null},"contractText":{"type":"string","nullable":true,"default":null},"contractSignatureId":{"type":"string","nullable":true,"format":"uuid","default":null},"contractFileId":{"type":"string","nullable":true,"format":"uuid","default":null},"contractGeneratedAt":{"type":"string","nullable":true,"format":"date-time","default":null},"id":{"type":"string","format":"uuid"},"property":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"timezone":{"type":"string"},"managerContact":{"type":"object","properties":{"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true}},"required":["name","email","phone"]}},"required":["id","name","timezone","managerContact"]},"tenantUserId":{"type":"string","nullable":true,"format":"uuid"},"source":{"type":"string","enum":["manual","ota","direct"]},"status":{"type":"string","enum":["pending","confirmed","completed","cancelled","no_show"]},"guestName":{"type":"string"},"guestEmail":{"type":"string","nullable":true,"format":"email"},"guestPhone":{"type":"string","nullable":true},"guestWishes":{"type":"string","nullable":true},"adults":{"type":"integer","minimum":0,"exclusiveMinimum":true},"children":{"type":"integer","minimum":0},"babyCrib":{"type":"boolean"},"highChair":{"type":"boolean"},"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"totalAmount":{"type":"number","minimum":0,"maximum":999999999999.99},"settledAmount":{"type":"number","nullable":true,"minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"paymentMethod":{"type":"string","nullable":true,"enum":["cash","bank_transfer","card",null]},"paymentStatus":{"type":"string","enum":["unpaid","paid","partially_paid"]},"paidAt":{"type":"string","nullable":true,"format":"date-time"},"cancellationInitiator":{"type":"string","nullable":true,"enum":["guest","agency","ota",null]},"cancellationReason":{"type":"string","nullable":true},"cancellationComment":{"type":"string","nullable":true},"cancelledAt":{"type":"string","nullable":true,"format":"date-time"},"cleaningMode":{"type":"string","enum":["included","separate","not_required"]},"cleaningPrice":{"type":"number","nullable":true,"minimum":0,"maximum":999999999999.99},"cleaningCurrency":{"type":"string","nullable":true,"minLength":3,"maxLength":3},"securityDeposit":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"reservationId":{"type":"string","format":"uuid"},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"receiptMethod":{"type":"string"},"status":{"type":"string","enum":["expected","received","returned","retained"]},"receivedAt":{"type":"string","nullable":true,"format":"date-time"},"returnedAt":{"type":"string","nullable":true,"format":"date-time"},"retentionReason":{"type":"string","nullable":true},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}}},"required":["id","reservationId","amount","currency","receiptMethod","status","receivedAt","returnedAt","retentionReason","incidentId","photoUrls"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","property","tenantUserId","source","status","guestName","guestEmail","guestPhone","guestWishes","adults","children","babyCrib","highChair","checkIn","checkOut","totalAmount","settledAmount","currency","paymentMethod","paymentStatus","paidAt","cancellationInitiator","cancellationReason","cancellationComment","cancelledAt","cleaningMode","cleaningPrice","cleaningCurrency","securityDeposit","createdAt","updatedAt"]}},"required":["reservation"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Date conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/bookings/{reservationId}/payments":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"reservationId","in":"path"}],"responses":{"200":{"description":"Платежи брони","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reservationId":{"type":"string","format":"uuid"},"amount":{"type":"number","minimum":0,"exclusiveMinimum":true},"currency":{"type":"string","minLength":3,"maxLength":3},"paidAt":{"type":"string","format":"date-time"},"method":{"type":"string","enum":["cash","bank_transfer","card"]},"note":{"type":"string","nullable":true},"transactionId":{"type":"string","format":"uuid"},"createdByUserId":{"type":"string","nullable":true,"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","reservationId","amount","currency","paidAt","method","note","transactionId","createdByUserId","createdAt","updatedAt"]}}},"required":["items"]}}}},"403":{"description":"Нет доступа","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Бронь не найдена","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"reservationId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","minimum":0.01,"maximum":999999999999.99},"paidAt":{"type":"string","format":"date-time"},"method":{"type":"string","enum":["cash","bank_transfer","card"]},"note":{"type":"string","nullable":true,"maxLength":2000}},"required":["amount","paidAt","method"],"additionalProperties":false}}}},"responses":{"201":{"description":"Платёж создан","content":{"application/json":{"schema":{"type":"object","properties":{"payment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reservationId":{"type":"string","format":"uuid"},"amount":{"type":"number","minimum":0,"exclusiveMinimum":true},"currency":{"type":"string","minLength":3,"maxLength":3},"paidAt":{"type":"string","format":"date-time"},"method":{"type":"string","enum":["cash","bank_transfer","card"]},"note":{"type":"string","nullable":true},"transactionId":{"type":"string","format":"uuid"},"createdByUserId":{"type":"string","nullable":true,"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","reservationId","amount","currency","paidAt","method","note","transactionId","createdByUserId","createdAt","updatedAt"]}},"required":["payment"]}}}},"400":{"description":"Неверный платёж","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Нет доступа","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Бронь не найдена","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/bookings/{reservationId}/payments/{paymentId}":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"reservationId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"paymentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","minimum":0.01,"maximum":999999999999.99},"paidAt":{"type":"string","format":"date-time"},"method":{"type":"string","enum":["cash","bank_transfer","card"]},"note":{"type":"string","nullable":true,"maxLength":2000}},"additionalProperties":false}}}},"responses":{"200":{"description":"Платёж обновлён","content":{"application/json":{"schema":{"type":"object","properties":{"payment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reservationId":{"type":"string","format":"uuid"},"amount":{"type":"number","minimum":0,"exclusiveMinimum":true},"currency":{"type":"string","minLength":3,"maxLength":3},"paidAt":{"type":"string","format":"date-time"},"method":{"type":"string","enum":["cash","bank_transfer","card"]},"note":{"type":"string","nullable":true},"transactionId":{"type":"string","format":"uuid"},"createdByUserId":{"type":"string","nullable":true,"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","reservationId","amount","currency","paidAt","method","note","transactionId","createdByUserId","createdAt","updatedAt"]}},"required":["payment"]}}}},"403":{"description":"Нет доступа","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Платёж не найден","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"reservationId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"paymentId","in":"path"}],"responses":{"200":{"description":"Платёж удалён","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}}}},"403":{"description":"Нет доступа","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Платёж не найден","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/bookings/{reservationId}/deposit":{"put":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"reservationId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"receiptMethod":{"type":"string","minLength":1,"maxLength":120},"status":{"type":"string","enum":["expected","received","returned","retained"]},"retentionReason":{"type":"string","nullable":true,"maxLength":1000,"default":null},"incidentId":{"type":"string","nullable":true,"format":"uuid","default":null},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":20,"default":[]}},"required":["amount","currency","receiptMethod","status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Deposit saved","content":{"application/json":{"schema":{"type":"object","properties":{"deposit":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reservationId":{"type":"string","format":"uuid"},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"receiptMethod":{"type":"string"},"status":{"type":"string","enum":["expected","received","returned","retained"]},"receivedAt":{"type":"string","nullable":true,"format":"date-time"},"returnedAt":{"type":"string","nullable":true,"format":"date-time"},"retentionReason":{"type":"string","nullable":true},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}}},"required":["id","reservationId","amount","currency","receiptMethod","status","receivedAt","returnedAt","retentionReason","incidentId","photoUrls"]}},"required":["deposit"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/bookings/{reservationId}/contract/file":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"reservationId","in":"path"}],"responses":{"200":{"description":"Файл договора","content":{"application/json":{"schema":{"type":"object","properties":{"contentType":{"type":"string","enum":["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]}},"required":["contentType"]}}}}}}},"/api/finance/transactions":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"propertyId","in":"query"},{"schema":{"type":"string","enum":["income","expense"]},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","enum":["organization","owner"]},"required":false,"name":"managedBy","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"outstanding","in":"query"}],"responses":{"200":{"description":"Ledger","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","nullable":true,"format":"uuid"},"property":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"reservationId":{"type":"string","nullable":true,"format":"uuid"},"documentId":{"type":"string","nullable":true,"format":"uuid"},"source":{"type":"string","enum":["manual","reservation","payroll","payout"]},"sourceId":{"type":"string","nullable":true,"format":"uuid"},"type":{"type":"string","enum":["income","expense"]},"categoryCode":{"type":"string"},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"occurredAt":{"type":"string","format":"date-time"},"dueAt":{"type":"string","nullable":true,"format":"date-time"},"settledAt":{"type":"string","nullable":true,"format":"date-time"},"note":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","property","reservationId","type","categoryCode","amount","currency","occurredAt","dueAt","settledAt","note","createdAt","updatedAt"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"documentId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"reservationId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["income","expense"]},"categoryCode":{"type":"string","minLength":2,"maxLength":80},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"occurredAt":{"type":"string","format":"date-time"},"dueAt":{"type":"string","format":"date-time"},"settled":{"type":"boolean","default":true},"note":{"type":"string","maxLength":500}},"required":["type","categoryCode","amount","currency","occurredAt"],"additionalProperties":false}}}},"responses":{"201":{"description":"Transaction created","content":{"application/json":{"schema":{"type":"object","properties":{"transaction":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","nullable":true,"format":"uuid"},"property":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"reservationId":{"type":"string","nullable":true,"format":"uuid"},"documentId":{"type":"string","nullable":true,"format":"uuid"},"source":{"type":"string","enum":["manual","reservation","payroll","payout"]},"sourceId":{"type":"string","nullable":true,"format":"uuid"},"type":{"type":"string","enum":["income","expense"]},"categoryCode":{"type":"string"},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"occurredAt":{"type":"string","format":"date-time"},"dueAt":{"type":"string","nullable":true,"format":"date-time"},"settledAt":{"type":"string","nullable":true,"format":"date-time"},"note":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","property","reservationId","type","categoryCode","amount","currency","occurredAt","dueAt","settledAt","note","createdAt","updatedAt"]}},"required":["transaction"]}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/finance/transactions/{id}":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"documentId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["income","expense"]},"categoryCode":{"type":"string","minLength":2,"maxLength":80},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"occurredAt":{"type":"string","format":"date-time"},"dueAt":{"type":"string","format":"date-time"},"settled":{"type":"boolean","default":true},"note":{"type":"string","maxLength":500}},"required":["type","categoryCode","amount","currency","occurredAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Transaction updated","content":{"application/json":{"schema":{"type":"object","properties":{"transaction":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","nullable":true,"format":"uuid"},"property":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"reservationId":{"type":"string","nullable":true,"format":"uuid"},"documentId":{"type":"string","nullable":true,"format":"uuid"},"source":{"type":"string","enum":["manual","reservation","payroll","payout"]},"sourceId":{"type":"string","nullable":true,"format":"uuid"},"type":{"type":"string","enum":["income","expense"]},"categoryCode":{"type":"string"},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"occurredAt":{"type":"string","format":"date-time"},"dueAt":{"type":"string","nullable":true,"format":"date-time"},"settledAt":{"type":"string","nullable":true,"format":"date-time"},"note":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","property","reservationId","type","categoryCode","amount","currency","occurredAt","dueAt","settledAt","note","createdAt","updatedAt"]}},"required":["transaction"]}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/finance/payouts":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Payouts","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"periodStart":{"type":"string","format":"date-time"},"periodEnd":{"type":"string","format":"date-time"},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string","enum":["planned","paid","cancelled"]},"paidAt":{"type":"string","nullable":true,"format":"date-time"},"transactionId":{"type":"string","nullable":true,"format":"uuid"},"note":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","ownerId","propertyId","periodStart","periodEnd","amount","currency","status","paidAt","transactionId","note","createdAt","updatedAt"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"automatic":{"type":"boolean"},"ownerId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"periodStart":{"type":"string","format":"date-time"},"periodEnd":{"type":"string","format":"date-time"},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"note":{"type":"string","maxLength":500}},"required":["ownerId","periodStart","periodEnd","amount","currency"],"additionalProperties":false}}}},"responses":{"201":{"description":"Payout created","content":{"application/json":{"schema":{"type":"object","properties":{"payout":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"periodStart":{"type":"string","format":"date-time"},"periodEnd":{"type":"string","format":"date-time"},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string","enum":["planned","paid","cancelled"]},"paidAt":{"type":"string","nullable":true,"format":"date-time"},"transactionId":{"type":"string","nullable":true,"format":"uuid"},"note":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","ownerId","propertyId","periodStart","periodEnd","amount","currency","status","paidAt","transactionId","note","createdAt","updatedAt"]}},"required":["payout"]}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/finance/payouts/preview":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"ownerId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"propertyId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"periodStart","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"periodEnd","in":"query"},{"schema":{"type":"string","minLength":3,"maxLength":3},"required":true,"name":"currency","in":"query"}],"responses":{"200":{"description":"Payout preview","content":{"application/json":{"schema":{"type":"object","properties":{"accrued":{"type":"number"},"alreadyPaid":{"type":"number"},"suggested":{"type":"number"}},"required":["accrued","alreadyPaid","suggested"]}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/finance/payouts/{id}":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["planned","paid","cancelled"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Payout updated","content":{"application/json":{"schema":{"type":"object","properties":{"payout":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"periodStart":{"type":"string","format":"date-time"},"periodEnd":{"type":"string","format":"date-time"},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string","enum":["planned","paid","cancelled"]},"paidAt":{"type":"string","nullable":true,"format":"date-time"},"transactionId":{"type":"string","nullable":true,"format":"uuid"},"note":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","ownerId","propertyId","periodStart","periodEnd","amount","currency","status","paidAt","transactionId","note","createdAt","updatedAt"]}},"required":["payout"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/finance/summary":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"propertyId","in":"query"},{"schema":{"type":"string","enum":["income","expense"]},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","enum":["organization","owner"]},"required":false,"name":"managedBy","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"outstanding","in":"query"}],"responses":{"200":{"description":"P&L summary","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"currencies":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"income":{"type":"number","minimum":0,"maximum":999999999999.99},"expense":{"type":"number","minimum":0,"maximum":999999999999.99},"net":{"type":"number"},"receivable":{"type":"number","minimum":0,"maximum":999999999999.99},"payable":{"type":"number","minimum":0,"maximum":999999999999.99},"ownerPayoutPlanned":{"type":"number","minimum":0,"maximum":999999999999.99},"ownerPayoutPaid":{"type":"number","minimum":0,"maximum":999999999999.99}},"required":["currency","income","expense","net","receivable","payable","ownerPayoutPlanned","ownerPayoutPaid"]}}},"required":["currencies"]}},"required":["summary"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/finance/owner-settlements":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"propertyId","in":"query"},{"schema":{"type":"string","enum":["income","expense"]},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","enum":["organization","owner"]},"required":false,"name":"managedBy","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"outstanding","in":"query"}],"responses":{"200":{"description":"Owner balances","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"ownerId":{"type":"string","format":"uuid"},"ownerName":{"type":"string"},"currency":{"type":"string"},"accrued":{"type":"number"},"commission":{"type":"number"},"paid":{"type":"number"},"planned":{"type":"number"},"balance":{"type":"number"},"properties":{"type":"array","items":{"type":"object","properties":{"propertyId":{"type":"string","format":"uuid"},"name":{"type":"string"},"income":{"type":"number"},"expense":{"type":"number"},"commission":{"type":"number"},"accrued":{"type":"number"}},"required":["propertyId","name","income","expense","commission","accrued"]}}},"required":["ownerId","ownerName","currency","accrued","commission","paid","planned","balance","properties"]}}},"required":["items"]}}}}}}},"/api/expense-documents/uploads":{"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"propertyId":{"type":"string","nullable":true,"format":"uuid","default":null},"originalName":{"type":"string","minLength":1,"maxLength":255},"contentType":{"type":"string","enum":["application/pdf","text/csv","image/png","image/jpeg"]},"byteSize":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":20971520}},"required":["originalName","contentType","byteSize"],"additionalProperties":false}}}},"responses":{"201":{"description":"Upload ticket","content":{"application/json":{"schema":{"type":"object","properties":{"upload":{"type":"object","properties":{"documentId":{"type":"string","format":"uuid"},"method":{"type":"string","enum":["PUT"]},"url":{"type":"string","format":"uri"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"contentLength":{"type":"integer","minimum":0,"exclusiveMinimum":true},"expiresAt":{"type":"string","format":"date-time"}},"required":["documentId","method","url","headers","contentLength","expiresAt"]}},"required":["upload"]}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/expense-documents/{documentId}/finalize":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"documentId","in":"path"}],"responses":{"200":{"description":"Queued for recognition","content":{"application/json":{"schema":{"type":"object","properties":{"document":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"originalName":{"type":"string"},"contentType":{"type":"string","enum":["application/pdf","text/csv","image/png","image/jpeg"]},"byteSize":{"type":"integer","minimum":0,"exclusiveMinimum":true},"uploadStatus":{"type":"string","enum":["pending_upload","queued","processing","ready","failed"]},"recognitionError":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"transactionId":{"type":"string","nullable":true,"format":"uuid","default":null},"expense":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"category":{"type":"string","enum":["rent","utilities","cleaning","repair","agency_commission","maintenance_service","goods_purchase","owner_payout","payroll","other"]},"amount":{"type":"number","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3},"expenseDate":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["recognized","confirmed","corrected","rejected"]}},"required":["id","propertyId","category","amount","currency","expenseDate","status"]}},"required":["id","propertyId","originalName","contentType","byteSize","uploadStatus","recognitionError","createdAt","expense"]}},"required":["document"]}}}},"400":{"description":"Upload incomplete","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/expense-documents":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Expense documents","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"originalName":{"type":"string"},"contentType":{"type":"string","enum":["application/pdf","text/csv","image/png","image/jpeg"]},"byteSize":{"type":"integer","minimum":0,"exclusiveMinimum":true},"uploadStatus":{"type":"string","enum":["pending_upload","queued","processing","ready","failed"]},"recognitionError":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"transactionId":{"type":"string","nullable":true,"format":"uuid","default":null},"expense":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"category":{"type":"string","enum":["rent","utilities","cleaning","repair","agency_commission","maintenance_service","goods_purchase","owner_payout","payroll","other"]},"amount":{"type":"number","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3},"expenseDate":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["recognized","confirmed","corrected","rejected"]}},"required":["id","propertyId","category","amount","currency","expenseDate","status"]}},"required":["id","propertyId","originalName","contentType","byteSize","uploadStatus","recognitionError","createdAt","expense"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/expense-documents/{documentId}/confirm":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"documentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"propertyId":{"type":"string","nullable":true,"format":"uuid"},"category":{"type":"string","enum":["rent","utilities","cleaning","repair","agency_commission","maintenance_service","goods_purchase","owner_payout","payroll","other"]},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"expenseDate":{"type":"string","format":"date-time"}},"required":["propertyId","category","amount","currency","expenseDate"],"additionalProperties":false}}}},"responses":{"200":{"description":"Confirmed expense","content":{"application/json":{"schema":{"type":"object","properties":{"document":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"originalName":{"type":"string"},"contentType":{"type":"string","enum":["application/pdf","text/csv","image/png","image/jpeg"]},"byteSize":{"type":"integer","minimum":0,"exclusiveMinimum":true},"uploadStatus":{"type":"string","enum":["pending_upload","queued","processing","ready","failed"]},"recognitionError":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"transactionId":{"type":"string","nullable":true,"format":"uuid","default":null},"expense":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"category":{"type":"string","enum":["rent","utilities","cleaning","repair","agency_commission","maintenance_service","goods_purchase","owner_payout","payroll","other"]},"amount":{"type":"number","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3},"expenseDate":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["recognized","confirmed","corrected","rejected"]}},"required":["id","propertyId","category","amount","currency","expenseDate","status"]}},"required":["id","propertyId","originalName","contentType","byteSize","uploadStatus","recognitionError","createdAt","expense"]}},"required":["document"]}}}},"400":{"description":"Not ready","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/expense-documents/{documentId}/reject":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"documentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"rejected":{"type":"boolean","enum":[true]}},"required":["rejected"],"additionalProperties":false}}}},"responses":{"200":{"description":"Rejected expense","content":{"application/json":{"schema":{"type":"object","properties":{"document":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"originalName":{"type":"string"},"contentType":{"type":"string","enum":["application/pdf","text/csv","image/png","image/jpeg"]},"byteSize":{"type":"integer","minimum":0,"exclusiveMinimum":true},"uploadStatus":{"type":"string","enum":["pending_upload","queued","processing","ready","failed"]},"recognitionError":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"transactionId":{"type":"string","nullable":true,"format":"uuid","default":null},"expense":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"category":{"type":"string","enum":["rent","utilities","cleaning","repair","agency_commission","maintenance_service","goods_purchase","owner_payout","payroll","other"]},"amount":{"type":"number","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3},"expenseDate":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["recognized","confirmed","corrected","rejected"]}},"required":["id","propertyId","category","amount","currency","expenseDate","status"]}},"required":["id","propertyId","originalName","contentType","byteSize","uploadStatus","recognitionError","createdAt","expense"]}},"required":["document"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/csv-imports/uploads":{"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"propertyId":{"type":"string","format":"uuid"},"sourceName":{"type":"string","minLength":2,"maxLength":80},"originalName":{"type":"string","minLength":1,"maxLength":255},"byteSize":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":20971520},"delimiter":{"type":"string","minLength":1,"maxLength":1,"default":","},"mapping":{"type":"object","properties":{"guestName":{"type":"string","minLength":1},"guestEmail":{"type":"string","minLength":1},"guestPhone":{"type":"string","minLength":1},"checkIn":{"type":"string","minLength":1},"checkOut":{"type":"string","minLength":1},"totalAmount":{"type":"string","minLength":1},"currency":{"type":"string","minLength":1},"status":{"type":"string","minLength":1}},"required":["guestName","checkIn","checkOut","totalAmount","currency"],"additionalProperties":false}},"required":["propertyId","sourceName","originalName","byteSize","mapping"],"additionalProperties":false}}}},"responses":{"201":{"description":"CSV upload","content":{"application/json":{"schema":{"type":"object","properties":{"upload":{"type":"object","properties":{"jobId":{"type":"string","format":"uuid"},"method":{"type":"string","enum":["PUT"]},"url":{"type":"string","format":"uri"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"contentLength":{"type":"integer","minimum":0,"exclusiveMinimum":true},"expiresAt":{"type":"string","format":"date-time"}},"required":["jobId","method","url","headers","contentLength","expiresAt"]}},"required":["upload"]}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/csv-imports/{jobId}/finalize":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"jobId","in":"path"}],"responses":{"200":{"description":"Queued","content":{"application/json":{"schema":{"type":"object","properties":{"job":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"sourceName":{"type":"string"},"originalName":{"type":"string"},"status":{"type":"string","enum":["pending_upload","queued","processing","completed","failed"]},"rowsTotal":{"type":"integer","minimum":0},"rowsImported":{"type":"integer","minimum":0},"rowsRejected":{"type":"integer","minimum":0},"error":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"rows":{"type":"array","items":{"type":"object","properties":{"rowNumber":{"type":"integer","minimum":0,"exclusiveMinimum":true},"status":{"type":"string","enum":["imported","rejected"]},"error":{"type":"string","nullable":true},"reservationId":{"type":"string","nullable":true,"format":"uuid"},"rawData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["rowNumber","status","error","reservationId","rawData"]}}},"required":["id","propertyId","sourceName","originalName","status","rowsTotal","rowsImported","rowsRejected","error","createdAt"]}},"required":["job"]}}}},"400":{"description":"Upload incomplete","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/csv-imports":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Imports","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"sourceName":{"type":"string"},"originalName":{"type":"string"},"status":{"type":"string","enum":["pending_upload","queued","processing","completed","failed"]},"rowsTotal":{"type":"integer","minimum":0},"rowsImported":{"type":"integer","minimum":0},"rowsRejected":{"type":"integer","minimum":0},"error":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"rows":{"type":"array","items":{"type":"object","properties":{"rowNumber":{"type":"integer","minimum":0,"exclusiveMinimum":true},"status":{"type":"string","enum":["imported","rejected"]},"error":{"type":"string","nullable":true},"reservationId":{"type":"string","nullable":true,"format":"uuid"},"rawData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["rowNumber","status","error","reservationId","rawData"]}}},"required":["id","propertyId","sourceName","originalName","status","rowsTotal","rowsImported","rowsRejected","error","createdAt"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/csv-imports/{jobId}":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"jobId","in":"path"}],"responses":{"200":{"description":"Import audit","content":{"application/json":{"schema":{"type":"object","properties":{"job":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"sourceName":{"type":"string"},"originalName":{"type":"string"},"status":{"type":"string","enum":["pending_upload","queued","processing","completed","failed"]},"rowsTotal":{"type":"integer","minimum":0},"rowsImported":{"type":"integer","minimum":0},"rowsRejected":{"type":"integer","minimum":0},"error":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"rows":{"type":"array","items":{"type":"object","properties":{"rowNumber":{"type":"integer","minimum":0,"exclusiveMinimum":true},"status":{"type":"string","enum":["imported","rejected"]},"error":{"type":"string","nullable":true},"reservationId":{"type":"string","nullable":true,"format":"uuid"},"rawData":{"type":"object","additionalProperties":{"type":"string"}}},"required":["rowNumber","status","error","reservationId","rawData"]}}},"required":["id","propertyId","sourceName","originalName","status","rowsTotal","rowsImported","rowsRejected","error","createdAt"]}},"required":["job"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/staff":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Staff directory or own membership","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"jobTitle":{"type":"string","nullable":true,"default":null},"phone":{"type":"string","nullable":true,"default":null},"passport":{"type":"string","nullable":true,"default":null},"salary":{"type":"number","default":0},"payoutMethod":{"type":"string","nullable":true,"default":null},"telegramChatId":{"type":"string","nullable":true,"default":null},"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"displayName":{"type":"string","nullable":true},"status":{"type":"string","enum":["invited","active","suspended","ended"]},"inviteExpiresAt":{"type":"string","nullable":true,"format":"date-time"},"permissions":{"type":"array","items":{"type":"object","properties":{"section":{"type":"string","enum":["objects","bookings","finance","csv_import","staff","reports","domains","public_pages","incidents","support","tasks","reviews","guides","lockbox"]},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"canRead":{"type":"boolean"},"canWrite":{"type":"boolean"},"canManage":{"type":"boolean"}},"required":["section","propertyId","canRead","canWrite","canManage"]}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","userId","email","displayName","status","inviteExpiresAt","permissions","createdAt"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/staff/{membershipId}/permissions":{"put":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"membershipId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"permissions":{"type":"array","items":{"type":"object","properties":{"section":{"type":"string","enum":["objects","bookings","finance","csv_import","staff","reports","domains","public_pages","incidents","support","tasks","reviews","guides","lockbox"]},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"canRead":{"type":"boolean"},"canWrite":{"type":"boolean"},"canManage":{"type":"boolean"}},"required":["section","propertyId","canRead","canWrite","canManage"]},"maxItems":500}},"required":["permissions"],"additionalProperties":false}}}},"responses":{"200":{"description":"ACL replaced","content":{"application/json":{"schema":{"type":"object","properties":{"member":{"type":"object","properties":{"jobTitle":{"type":"string","nullable":true,"default":null},"phone":{"type":"string","nullable":true,"default":null},"passport":{"type":"string","nullable":true,"default":null},"salary":{"type":"number","default":0},"payoutMethod":{"type":"string","nullable":true,"default":null},"telegramChatId":{"type":"string","nullable":true,"default":null},"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"displayName":{"type":"string","nullable":true},"status":{"type":"string","enum":["invited","active","suspended","ended"]},"inviteExpiresAt":{"type":"string","nullable":true,"format":"date-time"},"permissions":{"type":"array","items":{"type":"object","properties":{"section":{"type":"string","enum":["objects","bookings","finance","csv_import","staff","reports","domains","public_pages","incidents","support","tasks","reviews","guides","lockbox"]},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"canRead":{"type":"boolean"},"canWrite":{"type":"boolean"},"canManage":{"type":"boolean"}},"required":["section","propertyId","canRead","canWrite","canManage"]}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","userId","email","displayName","status","inviteExpiresAt","permissions","createdAt"]}},"required":["member"]}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/staff/{membershipId}/status":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"membershipId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["active","suspended","ended"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Status updated","content":{"application/json":{"schema":{"type":"object","properties":{"member":{"type":"object","properties":{"jobTitle":{"type":"string","nullable":true,"default":null},"phone":{"type":"string","nullable":true,"default":null},"passport":{"type":"string","nullable":true,"default":null},"salary":{"type":"number","default":0},"payoutMethod":{"type":"string","nullable":true,"default":null},"telegramChatId":{"type":"string","nullable":true,"default":null},"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"displayName":{"type":"string","nullable":true},"status":{"type":"string","enum":["invited","active","suspended","ended"]},"inviteExpiresAt":{"type":"string","nullable":true,"format":"date-time"},"permissions":{"type":"array","items":{"type":"object","properties":{"section":{"type":"string","enum":["objects","bookings","finance","csv_import","staff","reports","domains","public_pages","incidents","support","tasks","reviews","guides","lockbox"]},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"canRead":{"type":"boolean"},"canWrite":{"type":"boolean"},"canManage":{"type":"boolean"}},"required":["section","propertyId","canRead","canWrite","canManage"]}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","userId","email","displayName","status","inviteExpiresAt","permissions","createdAt"]}},"required":["member"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/staff/{membershipId}":{"put":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"membershipId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"type":"string","minLength":2,"maxLength":160},"jobTitle":{"type":"string","maxLength":120,"default":""},"phone":{"type":"string","maxLength":40,"default":""},"passport":{"type":"string","maxLength":1000,"default":""},"salary":{"type":"number","minimum":0,"maximum":999999999,"default":0},"payoutMethod":{"type":"string","enum":["cash","bank_transfer","card"],"default":"bank_transfer"},"telegramChatId":{"type":"string","nullable":true,"pattern":"^-?\\d+$","default":null},"permissionGroup":{"type":"string","enum":["custom","manager","accountant","cleaner","viewer"],"default":"custom"},"email":{"type":"string","maxLength":254,"format":"email"}},"required":["displayName","email"],"additionalProperties":false}}}},"responses":{"200":{"description":"Staff profile","content":{"application/json":{"schema":{"type":"object","properties":{"member":{"type":"object","properties":{"jobTitle":{"type":"string","nullable":true,"default":null},"phone":{"type":"string","nullable":true,"default":null},"passport":{"type":"string","nullable":true,"default":null},"salary":{"type":"number","default":0},"payoutMethod":{"type":"string","nullable":true,"default":null},"telegramChatId":{"type":"string","nullable":true,"default":null},"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"displayName":{"type":"string","nullable":true},"status":{"type":"string","enum":["invited","active","suspended","ended"]},"inviteExpiresAt":{"type":"string","nullable":true,"format":"date-time"},"permissions":{"type":"array","items":{"type":"object","properties":{"section":{"type":"string","enum":["objects","bookings","finance","csv_import","staff","reports","domains","public_pages","incidents","support","tasks","reviews","guides","lockbox"]},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"canRead":{"type":"boolean"},"canWrite":{"type":"boolean"},"canManage":{"type":"boolean"}},"required":["section","propertyId","canRead","canWrite","canManage"]}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","userId","email","displayName","status","inviteExpiresAt","permissions","createdAt"]}},"required":["member"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Email already used by another account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/report-config/rules":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Rules","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"level":{"type":"string","enum":["organization","owner","property"]},"ownerId":{"type":"string","nullable":true,"format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"blockCode":{"type":"string","enum":["pnl","income","expenses","agency_commission","owner_payouts","cash_flow","occupancy","booking_sources","cancellations","incidents","documents","staff_access","bookings","tasks","reviews","guides","lockbox"]},"visible":{"type":"boolean"}},"required":["id","level","ownerId","propertyId","blockCode","visible"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"level":{"type":"string","enum":["organization","owner","property"]},"ownerId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"rules":{"type":"array","items":{"type":"object","properties":{"blockCode":{"type":"string","enum":["pnl","income","expenses","agency_commission","owner_payouts","cash_flow","occupancy","booking_sources","cancellations","incidents","documents","staff_access","bookings","tasks","reviews","guides","lockbox"]},"visible":{"type":"boolean"}},"required":["blockCode","visible"]},"maxItems":17}},"required":["level","rules"],"additionalProperties":false}}}},"responses":{"200":{"description":"Rules replaced","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"level":{"type":"string","enum":["organization","owner","property"]},"ownerId":{"type":"string","nullable":true,"format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"blockCode":{"type":"string","enum":["pnl","income","expenses","agency_commission","owner_payouts","cash_flow","occupancy","booking_sources","cancellations","incidents","documents","staff_access","bookings","tasks","reviews","guides","lockbox"]},"visible":{"type":"boolean"}},"required":["id","level","ownerId","propertyId","blockCode","visible"]}}},"required":["items"]}}}},"400":{"description":"Invalid scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/report-config/scopes":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Available scopes","content":{"application/json":{"schema":{"type":"object","properties":{"owners":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"displayName":{"type":"string","nullable":true},"contactEmail":{"type":"string","nullable":true}},"required":["id","displayName","contactEmail"]}},"properties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","ownerId","name"]}}},"required":["owners","properties"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/report-config/effective":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"propertyId","in":"query"}],"responses":{"200":{"description":"Resolved visibility","content":{"application/json":{"schema":{"type":"object","properties":{"propertyId":{"type":"string","format":"uuid"},"blocks":{"type":"array","items":{"type":"object","properties":{"blockCode":{"type":"string","enum":["pnl","income","expenses","agency_commission","owner_payouts","cash_flow","occupancy","booking_sources","cancellations","incidents","documents","staff_access","bookings","tasks","reviews","guides","lockbox"]},"visible":{"type":"boolean"},"source":{"type":"string","enum":["default","organization","owner","property"]}},"required":["blockCode","visible","source"]}}},"required":["propertyId","blocks"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/domains":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Domains","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["organization","property"]},"organizationId":{"type":"string","nullable":true,"format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"domain":{"type":"string","minLength":4,"maxLength":253},"dnsRecordName":{"type":"string"},"dnsRecordValue":{"type":"string"},"cnameTarget":{"type":"string"},"status":{"type":"string","enum":["pending_dns","provisioning","active","error"]},"sslStatus":{"type":"string","enum":["pending","issued","error"]},"lastCheckedAt":{"type":"string","nullable":true,"format":"date-time"},"activatedAt":{"type":"string","nullable":true,"format":"date-time"},"error":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","kind","organizationId","propertyId","domain","dnsRecordName","dnsRecordValue","cnameTarget","status","sslStatus","lastCheckedAt","activatedAt","error","createdAt"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["organization","property"]},"propertyId":{"type":"string","format":"uuid"},"domain":{"type":"string","minLength":4,"maxLength":253}},"required":["kind","domain"],"additionalProperties":false}}}},"responses":{"201":{"description":"Domain created","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["organization","property"]},"organizationId":{"type":"string","nullable":true,"format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"domain":{"type":"string","minLength":4,"maxLength":253},"dnsRecordName":{"type":"string"},"dnsRecordValue":{"type":"string"},"cnameTarget":{"type":"string"},"status":{"type":"string","enum":["pending_dns","provisioning","active","error"]},"sslStatus":{"type":"string","enum":["pending","issued","error"]},"lastCheckedAt":{"type":"string","nullable":true,"format":"date-time"},"activatedAt":{"type":"string","nullable":true,"format":"date-time"},"error":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","kind","organizationId","propertyId","domain","dnsRecordName","dnsRecordValue","cnameTarget","status","sslStatus","lastCheckedAt","activatedAt","error","createdAt"]}},"required":["domain"]}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/domains/{domainId}/verify":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"domainId","in":"path"}],"responses":{"200":{"description":"DNS checked","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["organization","property"]},"organizationId":{"type":"string","nullable":true,"format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"domain":{"type":"string","minLength":4,"maxLength":253},"dnsRecordName":{"type":"string"},"dnsRecordValue":{"type":"string"},"cnameTarget":{"type":"string"},"status":{"type":"string","enum":["pending_dns","provisioning","active","error"]},"sslStatus":{"type":"string","enum":["pending","issued","error"]},"lastCheckedAt":{"type":"string","nullable":true,"format":"date-time"},"activatedAt":{"type":"string","nullable":true,"format":"date-time"},"error":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","kind","organizationId","propertyId","domain","dnsRecordName","dnsRecordValue","cnameTarget","status","sslStatus","lastCheckedAt","activatedAt","error","createdAt"]}},"required":["domain"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/domains/{domainId}":{"delete":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"domainId","in":"path"}],"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean","enum":[true]}},"required":["removed"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/public-pages/resolve/{slug}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":253},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Published page","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"guides":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"topic":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false}]}},"defaultLocale":{"type":"string"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"topic":{"type":"string"},"content":{"type":"string"}},"required":["topic","content"]}},"isPublished":{"type":"boolean"},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","topic","content","media","defaultLocale","translations","isPublished","sortOrder","createdAt","updatedAt"]}},"amenities":{"type":"array","items":{"type":"string"}},"location":{"type":"string","nullable":true},"distanceToSea":{"type":"string","nullable":true},"nearestShop":{"type":"string","nullable":true},"nightlyPrice":{"type":"string","nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3},"seoTitle":{"type":"string","nullable":true},"seoDescription":{"type":"string","nullable":true},"defaultLocale":{"type":"string","maxLength":5,"pattern":"^[a-z]{2}(?:-[a-z]{2})?$"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","minLength":1,"maxLength":10000},"amenities":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"maxItems":100},"location":{"type":"string","nullable":true,"maxLength":500},"distanceToSea":{"type":"string","nullable":true,"maxLength":200},"nearestShop":{"type":"string","nullable":true,"maxLength":200}},"required":["title","description","amenities","location","distanceToSea","nearestShop"],"additionalProperties":false}},"catalogVisible":{"type":"boolean"},"chatEnabled":{"type":"boolean"},"status":{"type":"string","enum":["draft","published"]},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"onlineBookingEnabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"propertyName":{"type":"string"},"propertyAddress":{"type":"string","nullable":true}},"required":["id","propertyId","slug","title","description","photoUrls","amenities","location","distanceToSea","nearestShop","nightlyPrice","currency","seoTitle","seoDescription","defaultLocale","translations","catalogVisible","chatEnabled","status","publishedAt","onlineBookingEnabled","createdAt","updatedAt","propertyName","propertyAddress"]}},"required":["page"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/public-pages/catalog":{"get":{"responses":{"200":{"description":"Cross-agency catalog","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"guides":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"topic":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false}]}},"defaultLocale":{"type":"string"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"topic":{"type":"string"},"content":{"type":"string"}},"required":["topic","content"]}},"isPublished":{"type":"boolean"},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","topic","content","media","defaultLocale","translations","isPublished","sortOrder","createdAt","updatedAt"]}},"amenities":{"type":"array","items":{"type":"string"}},"location":{"type":"string","nullable":true},"distanceToSea":{"type":"string","nullable":true},"nearestShop":{"type":"string","nullable":true},"nightlyPrice":{"type":"string","nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3},"seoTitle":{"type":"string","nullable":true},"seoDescription":{"type":"string","nullable":true},"defaultLocale":{"type":"string","maxLength":5,"pattern":"^[a-z]{2}(?:-[a-z]{2})?$"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","minLength":1,"maxLength":10000},"amenities":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"maxItems":100},"location":{"type":"string","nullable":true,"maxLength":500},"distanceToSea":{"type":"string","nullable":true,"maxLength":200},"nearestShop":{"type":"string","nullable":true,"maxLength":200}},"required":["title","description","amenities","location","distanceToSea","nearestShop"],"additionalProperties":false}},"catalogVisible":{"type":"boolean"},"chatEnabled":{"type":"boolean"},"status":{"type":"string","enum":["draft","published"]},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"onlineBookingEnabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"propertyName":{"type":"string"},"propertyAddress":{"type":"string","nullable":true}},"required":["id","propertyId","slug","title","description","photoUrls","amenities","location","distanceToSea","nearestShop","nightlyPrice","currency","seoTitle","seoDescription","defaultLocale","translations","catalogVisible","chatEnabled","status","publishedAt","onlineBookingEnabled","createdAt","updatedAt","propertyName","propertyAddress"]}}},"required":["items"]}}}}}}},"/api/public-pages/resolve/{slug}/chat":{"post":{"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":253},"required":true,"name":"slug","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"guestName":{"type":"string","minLength":1,"maxLength":120},"guestEmail":{"type":"string","maxLength":320,"format":"email"},"body":{"type":"string","minLength":1,"maxLength":4000}},"required":["guestName","guestEmail","body"],"additionalProperties":false}}}},"responses":{"201":{"description":"Guest chat started","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"guestName":{"type":"string"},"guestEmail":{"type":"string","format":"email"},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sender":{"type":"string","enum":["guest","manager"]},"body":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","sender","body","createdAt"]}}},"required":["id","guestName","guestEmail","status","createdAt","updatedAt","messages"]},"accessToken":{"type":"string","minLength":32}},"required":["thread","accessToken"]}}}},"403":{"description":"Disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/public-pages/chat/{threadId}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"threadId","in":"path"},{"schema":{"type":"string","minLength":32},"required":true,"name":"accessToken","in":"query"}],"responses":{"200":{"description":"Guest chat","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"guestName":{"type":"string"},"guestEmail":{"type":"string","format":"email"},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sender":{"type":"string","enum":["guest","manager"]},"body":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","sender","body","createdAt"]}}},"required":["id","guestName","guestEmail","status","createdAt","updatedAt","messages"]}},"required":["thread"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/public-pages/chat/{threadId}/messages":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"threadId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"accessToken":{"type":"string","minLength":32},"body":{"type":"string","minLength":1,"maxLength":4000}},"required":["accessToken","body"],"additionalProperties":false}}}},"responses":{"200":{"description":"Message added","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"guestName":{"type":"string"},"guestEmail":{"type":"string","format":"email"},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sender":{"type":"string","enum":["guest","manager"]},"body":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","sender","body","createdAt"]}}},"required":["id","guestName","guestEmail","status","createdAt","updatedAt","messages"]}},"required":["thread"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/public-pages/manage":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Managed pages","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"guides":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"topic":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false}]}},"defaultLocale":{"type":"string"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"topic":{"type":"string"},"content":{"type":"string"}},"required":["topic","content"]}},"isPublished":{"type":"boolean"},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","topic","content","media","defaultLocale","translations","isPublished","sortOrder","createdAt","updatedAt"]}},"amenities":{"type":"array","items":{"type":"string"}},"location":{"type":"string","nullable":true},"distanceToSea":{"type":"string","nullable":true},"nearestShop":{"type":"string","nullable":true},"nightlyPrice":{"type":"string","nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3},"seoTitle":{"type":"string","nullable":true},"seoDescription":{"type":"string","nullable":true},"defaultLocale":{"type":"string","maxLength":5,"pattern":"^[a-z]{2}(?:-[a-z]{2})?$"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","minLength":1,"maxLength":10000},"amenities":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"maxItems":100},"location":{"type":"string","nullable":true,"maxLength":500},"distanceToSea":{"type":"string","nullable":true,"maxLength":200},"nearestShop":{"type":"string","nullable":true,"maxLength":200}},"required":["title","description","amenities","location","distanceToSea","nearestShop"],"additionalProperties":false}},"catalogVisible":{"type":"boolean"},"chatEnabled":{"type":"boolean"},"status":{"type":"string","enum":["draft","published"]},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"onlineBookingEnabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"propertyName":{"type":"string"},"propertyAddress":{"type":"string","nullable":true}},"required":["id","propertyId","slug","title","description","photoUrls","amenities","location","distanceToSea","nearestShop","nightlyPrice","currency","seoTitle","seoDescription","defaultLocale","translations","catalogVisible","chatEnabled","status","publishedAt","onlineBookingEnabled","createdAt","updatedAt","propertyName","propertyAddress"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"propertyId":{"type":"string","format":"uuid"},"slug":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"title":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","minLength":1,"maxLength":10000},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":50,"default":[]},"amenities":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"maxItems":100,"default":[]},"location":{"type":"string","nullable":true,"maxLength":500,"default":null},"distanceToSea":{"type":"string","nullable":true,"maxLength":200,"default":null},"nearestShop":{"type":"string","nullable":true,"maxLength":200,"default":null},"nightlyPrice":{"type":"number","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":999999999999,"default":null},"currency":{"type":"string","minLength":3,"maxLength":3},"seoTitle":{"type":"string","nullable":true,"maxLength":160,"default":null},"seoDescription":{"type":"string","nullable":true,"maxLength":300,"default":null},"defaultLocale":{"type":"string","maxLength":5,"pattern":"^[a-z]{2}(?:-[a-z]{2})?$","default":"ru"},"catalogVisible":{"type":"boolean","default":false},"chatEnabled":{"type":"boolean","default":true},"onlineBookingEnabled":{"type":"boolean","default":false}},"required":["propertyId","slug","title","description","currency"],"additionalProperties":false}}}},"responses":{"200":{"description":"Page saved","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"guides":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"topic":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false}]}},"defaultLocale":{"type":"string"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"topic":{"type":"string"},"content":{"type":"string"}},"required":["topic","content"]}},"isPublished":{"type":"boolean"},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","topic","content","media","defaultLocale","translations","isPublished","sortOrder","createdAt","updatedAt"]}},"amenities":{"type":"array","items":{"type":"string"}},"location":{"type":"string","nullable":true},"distanceToSea":{"type":"string","nullable":true},"nearestShop":{"type":"string","nullable":true},"nightlyPrice":{"type":"string","nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3},"seoTitle":{"type":"string","nullable":true},"seoDescription":{"type":"string","nullable":true},"defaultLocale":{"type":"string","maxLength":5,"pattern":"^[a-z]{2}(?:-[a-z]{2})?$"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","minLength":1,"maxLength":10000},"amenities":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"maxItems":100},"location":{"type":"string","nullable":true,"maxLength":500},"distanceToSea":{"type":"string","nullable":true,"maxLength":200},"nearestShop":{"type":"string","nullable":true,"maxLength":200}},"required":["title","description","amenities","location","distanceToSea","nearestShop"],"additionalProperties":false}},"catalogVisible":{"type":"boolean"},"chatEnabled":{"type":"boolean"},"status":{"type":"string","enum":["draft","published"]},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"onlineBookingEnabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"propertyName":{"type":"string"},"propertyAddress":{"type":"string","nullable":true}},"required":["id","propertyId","slug","title","description","photoUrls","amenities","location","distanceToSea","nearestShop","nightlyPrice","currency","seoTitle","seoDescription","defaultLocale","translations","catalogVisible","chatEnabled","status","publishedAt","onlineBookingEnabled","createdAt","updatedAt","propertyName","propertyAddress"]}},"required":["page"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Property not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Slug conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/public-pages/manage/{propertyId}/publish":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"propertyId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"published":{"type":"boolean"}},"required":["published"],"additionalProperties":false}}}},"responses":{"200":{"description":"Publication changed","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"guides":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"topic":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false}]}},"defaultLocale":{"type":"string"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"topic":{"type":"string"},"content":{"type":"string"}},"required":["topic","content"]}},"isPublished":{"type":"boolean"},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","topic","content","media","defaultLocale","translations","isPublished","sortOrder","createdAt","updatedAt"]}},"amenities":{"type":"array","items":{"type":"string"}},"location":{"type":"string","nullable":true},"distanceToSea":{"type":"string","nullable":true},"nearestShop":{"type":"string","nullable":true},"nightlyPrice":{"type":"string","nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3},"seoTitle":{"type":"string","nullable":true},"seoDescription":{"type":"string","nullable":true},"defaultLocale":{"type":"string","maxLength":5,"pattern":"^[a-z]{2}(?:-[a-z]{2})?$"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","minLength":1,"maxLength":10000},"amenities":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"maxItems":100},"location":{"type":"string","nullable":true,"maxLength":500},"distanceToSea":{"type":"string","nullable":true,"maxLength":200},"nearestShop":{"type":"string","nullable":true,"maxLength":200}},"required":["title","description","amenities","location","distanceToSea","nearestShop"],"additionalProperties":false}},"catalogVisible":{"type":"boolean"},"chatEnabled":{"type":"boolean"},"status":{"type":"string","enum":["draft","published"]},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"onlineBookingEnabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"propertyName":{"type":"string"},"propertyAddress":{"type":"string","nullable":true}},"required":["id","propertyId","slug","title","description","photoUrls","amenities","location","distanceToSea","nearestShop","nightlyPrice","currency","seoTitle","seoDescription","defaultLocale","translations","catalogVisible","chatEnabled","status","publishedAt","onlineBookingEnabled","createdAt","updatedAt","propertyName","propertyAddress"]}},"required":["page"]}}}},"400":{"description":"Incomplete page","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/public-pages/manage/{propertyId}/translate":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"propertyId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string","maxLength":5,"pattern":"^[a-z]{2}(?:-[a-z]{2})?$"}},"required":["locale"],"additionalProperties":false}}}},"responses":{"200":{"description":"Translated","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"guides":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"topic":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false}]}},"defaultLocale":{"type":"string"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"topic":{"type":"string"},"content":{"type":"string"}},"required":["topic","content"]}},"isPublished":{"type":"boolean"},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","topic","content","media","defaultLocale","translations","isPublished","sortOrder","createdAt","updatedAt"]}},"amenities":{"type":"array","items":{"type":"string"}},"location":{"type":"string","nullable":true},"distanceToSea":{"type":"string","nullable":true},"nearestShop":{"type":"string","nullable":true},"nightlyPrice":{"type":"string","nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3},"seoTitle":{"type":"string","nullable":true},"seoDescription":{"type":"string","nullable":true},"defaultLocale":{"type":"string","maxLength":5,"pattern":"^[a-z]{2}(?:-[a-z]{2})?$"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","minLength":1,"maxLength":10000},"amenities":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"maxItems":100},"location":{"type":"string","nullable":true,"maxLength":500},"distanceToSea":{"type":"string","nullable":true,"maxLength":200},"nearestShop":{"type":"string","nullable":true,"maxLength":200}},"required":["title","description","amenities","location","distanceToSea","nearestShop"],"additionalProperties":false}},"catalogVisible":{"type":"boolean"},"chatEnabled":{"type":"boolean"},"status":{"type":"string","enum":["draft","published"]},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"onlineBookingEnabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"propertyName":{"type":"string"},"propertyAddress":{"type":"string","nullable":true}},"required":["id","propertyId","slug","title","description","photoUrls","amenities","location","distanceToSea","nearestShop","nightlyPrice","currency","seoTitle","seoDescription","defaultLocale","translations","catalogVisible","chatEnabled","status","publishedAt","onlineBookingEnabled","createdAt","updatedAt","propertyName","propertyAddress"]}},"required":["page"]}}}},"400":{"description":"Invalid locale","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"503":{"description":"Translation unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/public-pages/manage/{propertyId}/chats":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"propertyId","in":"path"}],"responses":{"200":{"description":"Page chats","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"guestName":{"type":"string"},"guestEmail":{"type":"string","format":"email"},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sender":{"type":"string","enum":["guest","manager"]},"body":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","sender","body","createdAt"]}}},"required":["id","guestName","guestEmail","status","createdAt","updatedAt","messages"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/public-pages/manage/chats/{threadId}/messages":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"threadId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":4000}},"required":["body"],"additionalProperties":false}}}},"responses":{"200":{"description":"Manager reply","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"guestName":{"type":"string"},"guestEmail":{"type":"string","format":"email"},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sender":{"type":"string","enum":["guest","manager"]},"body":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","sender","body","createdAt"]}}},"required":["id","guestName","guestEmail","status","createdAt","updatedAt","messages"]}},"required":["thread"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/public-pages/manage/chats/{threadId}/status":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"threadId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","closed"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Chat status","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"guestName":{"type":"string"},"guestEmail":{"type":"string","format":"email"},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sender":{"type":"string","enum":["guest","manager"]},"body":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","sender","body","createdAt"]}}},"required":["id","guestName","guestEmail","status","createdAt","updatedAt","messages"]}},"required":["thread"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/support":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["open","in_progress","closed"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Tickets","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"requesterType":{"type":"string","enum":["organization","owner"]},"requesterUserId":{"type":"string","format":"uuid"},"requesterEmail":{"type":"string","format":"email"},"requesterName":{"type":"string","nullable":true},"subject":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","closed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sender":{"type":"string","enum":["requester","support"]},"body":{"type":"string"},"attachmentUrls":{"type":"array","items":{"type":"string","format":"uri"}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","sender","body","attachmentUrls","createdAt"]}}},"required":["id","requesterType","requesterUserId","requesterEmail","requesterName","subject","status","createdAt","updatedAt","messages"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Unavailable for role","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","minLength":3,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":10000},"attachmentUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10,"default":[]}},"required":["subject","body"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"ticket":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"requesterType":{"type":"string","enum":["organization","owner"]},"requesterUserId":{"type":"string","format":"uuid"},"requesterEmail":{"type":"string","format":"email"},"requesterName":{"type":"string","nullable":true},"subject":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","closed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sender":{"type":"string","enum":["requester","support"]},"body":{"type":"string"},"attachmentUrls":{"type":"array","items":{"type":"string","format":"uri"}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","sender","body","attachmentUrls","createdAt"]}}},"required":["id","requesterType","requesterUserId","requesterEmail","requesterName","subject","status","createdAt","updatedAt","messages"]}},"required":["ticket"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Unavailable for role","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/support/{ticketId}":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"ticketId","in":"path"}],"responses":{"200":{"description":"Ticket","content":{"application/json":{"schema":{"type":"object","properties":{"ticket":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"requesterType":{"type":"string","enum":["organization","owner"]},"requesterUserId":{"type":"string","format":"uuid"},"requesterEmail":{"type":"string","format":"email"},"requesterName":{"type":"string","nullable":true},"subject":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","closed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sender":{"type":"string","enum":["requester","support"]},"body":{"type":"string"},"attachmentUrls":{"type":"array","items":{"type":"string","format":"uri"}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","sender","body","attachmentUrls","createdAt"]}}},"required":["id","requesterType","requesterUserId","requesterEmail","requesterName","subject","status","createdAt","updatedAt","messages"]}},"required":["ticket"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/support/{ticketId}/messages":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"ticketId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000},"attachmentUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10,"default":[]}},"required":["body"],"additionalProperties":false}}}},"responses":{"200":{"description":"Message added","content":{"application/json":{"schema":{"type":"object","properties":{"ticket":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"requesterType":{"type":"string","enum":["organization","owner"]},"requesterUserId":{"type":"string","format":"uuid"},"requesterEmail":{"type":"string","format":"email"},"requesterName":{"type":"string","nullable":true},"subject":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","closed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sender":{"type":"string","enum":["requester","support"]},"body":{"type":"string"},"attachmentUrls":{"type":"array","items":{"type":"string","format":"uri"}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","sender","body","attachmentUrls","createdAt"]}}},"required":["id","requesterType","requesterUserId","requesterEmail","requesterName","subject","status","createdAt","updatedAt","messages"]}},"required":["ticket"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Closed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/support/{ticketId}/status":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"ticketId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","in_progress","closed"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Status updated","content":{"application/json":{"schema":{"type":"object","properties":{"ticket":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"requesterType":{"type":"string","enum":["organization","owner"]},"requesterUserId":{"type":"string","format":"uuid"},"requesterEmail":{"type":"string","format":"email"},"requesterName":{"type":"string","nullable":true},"subject":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","closed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sender":{"type":"string","enum":["requester","support"]},"body":{"type":"string"},"attachmentUrls":{"type":"array","items":{"type":"string","format":"uri"}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","sender","body","attachmentUrls","createdAt"]}}},"required":["id","requesterType","requesterUserId","requesterEmail","requesterName","subject","status","createdAt","updatedAt","messages"]}},"required":["ticket"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/incidents":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"propertyId","in":"query"},{"schema":{"type":"string","enum":["open","in_progress","resolved"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Incidents","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"reportedByUserId":{"type":"string","format":"uuid"},"description":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","resolved"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"description":{"type":"string"},"expenseId":{"type":"string","nullable":true,"format":"uuid"},"expenseAmount":{"type":"string","nullable":true},"expenseCurrency":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","description","expenseId","expenseAmount","expenseCurrency","createdAt"]}}},"required":["id","propertyId","propertyName","reportedByUserId","description","status","createdAt","updatedAt","steps"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"propertyId":{"type":"string","format":"uuid"},"description":{"type":"string","minLength":3,"maxLength":10000}},"required":["propertyId","description"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"incident":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"reportedByUserId":{"type":"string","format":"uuid"},"description":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","resolved"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"description":{"type":"string"},"expenseId":{"type":"string","nullable":true,"format":"uuid"},"expenseAmount":{"type":"string","nullable":true},"expenseCurrency":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","description","expenseId","expenseAmount","expenseCurrency","createdAt"]}}},"required":["id","propertyId","propertyName","reportedByUserId","description","status","createdAt","updatedAt","steps"]}},"required":["incident"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Property not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/incidents/{incidentId}":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"incidentId","in":"path"}],"responses":{"200":{"description":"Incident","content":{"application/json":{"schema":{"type":"object","properties":{"incident":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"reportedByUserId":{"type":"string","format":"uuid"},"description":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","resolved"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"description":{"type":"string"},"expenseId":{"type":"string","nullable":true,"format":"uuid"},"expenseAmount":{"type":"string","nullable":true},"expenseCurrency":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","description","expenseId","expenseAmount","expenseCurrency","createdAt"]}}},"required":["id","propertyId","propertyName","reportedByUserId","description","status","createdAt","updatedAt","steps"]}},"required":["incident"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/incidents/{incidentId}/status":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"incidentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","in_progress","resolved"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"incident":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"reportedByUserId":{"type":"string","format":"uuid"},"description":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","resolved"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"description":{"type":"string"},"expenseId":{"type":"string","nullable":true,"format":"uuid"},"expenseAmount":{"type":"string","nullable":true},"expenseCurrency":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","description","expenseId","expenseAmount","expenseCurrency","createdAt"]}}},"required":["id","propertyId","propertyName","reportedByUserId","description","status","createdAt","updatedAt","steps"]}},"required":["incident"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/incidents/{incidentId}/steps":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"incidentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":10000},"expenseId":{"type":"string","nullable":true,"format":"uuid","default":null}},"required":["description"],"additionalProperties":false}}}},"responses":{"200":{"description":"Step added","content":{"application/json":{"schema":{"type":"object","properties":{"incident":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"reportedByUserId":{"type":"string","format":"uuid"},"description":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","resolved"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"description":{"type":"string"},"expenseId":{"type":"string","nullable":true,"format":"uuid"},"expenseAmount":{"type":"string","nullable":true},"expenseCurrency":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","description","expenseId","expenseAmount","expenseCurrency","createdAt"]}}},"required":["id","propertyId","propertyName","reportedByUserId","description","status","createdAt","updatedAt","steps"]}},"required":["incident"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Expense mismatch","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/online-booking/{slug}/availability":{"get":{"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":253},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","format":"date"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date"},"required":true,"name":"to","in":"query"}],"responses":{"200":{"description":"Unavailable intervals","content":{"application/json":{"schema":{"type":"object","properties":{"propertyId":{"type":"string","format":"uuid"},"timezone":{"type":"string"},"unavailable":{"type":"array","items":{"type":"object","properties":{"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"}},"required":["checkIn","checkOut"]}}},"required":["propertyId","timezone","unavailable"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/online-booking/{slug}/quote":{"post":{"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":253},"required":true,"name":"slug","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"checkIn":{"type":"string","format":"date"},"checkOut":{"type":"string","format":"date"}},"required":["checkIn","checkOut"],"additionalProperties":false}}}},"responses":{"200":{"description":"Server quote","content":{"application/json":{"schema":{"type":"object","properties":{"quote":{"type":"object","properties":{"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"nights":{"type":"integer","minimum":0,"exclusiveMinimum":true},"nightlyPrice":{"type":"number","minimum":0,"exclusiveMinimum":true},"totalAmount":{"type":"number","minimum":0,"exclusiveMinimum":true},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["checkIn","checkOut","nights","nightlyPrice","totalAmount","currency"]}},"required":["quote"]}}}},"403":{"description":"Disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Unavailable dates","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/online-booking/{slug}/checkout":{"post":{"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":253},"required":true,"name":"slug","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"checkIn":{"type":"string","format":"date"},"checkOut":{"type":"string","format":"date"},"guestName":{"type":"string","minLength":2,"maxLength":160},"guestEmail":{"type":"string","maxLength":320,"format":"email"},"guestPhone":{"type":"string","minLength":7,"maxLength":32},"idempotencyKey":{"type":"string","minLength":16,"maxLength":100},"paymentToken":{"type":"string","minLength":1,"maxLength":2000}},"required":["checkIn","checkOut","guestName","guestEmail","idempotencyKey","paymentToken"],"additionalProperties":false}}}},"responses":{"200":{"description":"Payment attempted","content":{"application/json":{"schema":{"type":"object","properties":{"booking":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reservationId":{"type":"string","nullable":true,"format":"uuid"},"status":{"type":"string","enum":["awaiting_payment","payment_failed","confirmed"]},"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"totalAmount":{"type":"number","minimum":0,"exclusiveMinimum":true},"currency":{"type":"string","minLength":3,"maxLength":3},"createdAt":{"type":"string","format":"date-time"}},"required":["id","reservationId","status","checkIn","checkOut","totalAmount","currency","createdAt"]}},"required":["booking"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Unavailable dates","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"503":{"description":"Payments disabled or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/tasks/assignees":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"propertyId","in":"query"}],"responses":{"200":{"description":"Eligible assignees","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"email":{"type":"string","format":"email"},"jobTitle":{"type":"string","nullable":true}},"required":["id","name","email","jobTitle"]}}},"required":["items"]}}}},"404":{"description":"Property not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/tasks":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"propertyId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"assigneeUserId","in":"query"},{"schema":{"type":"string","enum":["open","in_progress","done"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"dueBefore","in":"query"}],"responses":{"200":{"description":"Tasks","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"photoFileId":{"type":"string","nullable":true,"format":"uuid","default":null},"referenceUrl":{"type":"string","nullable":true,"format":"uri","default":null},"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"type":{"type":"string","enum":["todo","purchase","replacement"]},"title":{"type":"string"},"note":{"type":"string","nullable":true},"assigneeUserId":{"type":"string","nullable":true,"format":"uuid"},"assigneeName":{"type":"string","nullable":true},"assigneeEmail":{"type":"string","nullable":true,"format":"email"},"dueAt":{"type":"string","nullable":true,"format":"date-time"},"status":{"type":"string","enum":["open","in_progress","done"]},"beforePhotoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"afterPhotoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"reservationId":{"type":"string","nullable":true,"format":"uuid"},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"securityDepositId":{"type":"string","nullable":true,"format":"uuid"},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","type","title","note","assigneeUserId","assigneeName","assigneeEmail","dueAt","status","beforePhotoUrls","afterPhotoUrls","reservationId","incidentId","securityDepositId","completedAt","createdAt","updatedAt"]}}},"required":["items"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"photoFileId":{"type":"string","nullable":true,"format":"uuid","default":null},"referenceUrl":{"type":"string","nullable":true,"format":"uri","default":null},"propertyId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["todo","purchase","replacement"],"default":"todo"},"title":{"type":"string","minLength":1,"maxLength":200},"note":{"type":"string","nullable":true,"maxLength":10000,"default":null},"assigneeUserId":{"type":"string","nullable":true,"format":"uuid","default":null},"dueAt":{"type":"string","nullable":true,"format":"date-time","default":null},"beforePhotoUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":20,"default":[]},"afterPhotoUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":20,"default":[]},"reservationId":{"type":"string","nullable":true,"format":"uuid","default":null},"incidentId":{"type":"string","nullable":true,"format":"uuid","default":null},"securityDepositId":{"type":"string","nullable":true,"format":"uuid","default":null}},"required":["propertyId","title"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"type":"object","properties":{"photoFileId":{"type":"string","nullable":true,"format":"uuid","default":null},"referenceUrl":{"type":"string","nullable":true,"format":"uri","default":null},"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"type":{"type":"string","enum":["todo","purchase","replacement"]},"title":{"type":"string"},"note":{"type":"string","nullable":true},"assigneeUserId":{"type":"string","nullable":true,"format":"uuid"},"assigneeName":{"type":"string","nullable":true},"assigneeEmail":{"type":"string","nullable":true,"format":"email"},"dueAt":{"type":"string","nullable":true,"format":"date-time"},"status":{"type":"string","enum":["open","in_progress","done"]},"beforePhotoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"afterPhotoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"reservationId":{"type":"string","nullable":true,"format":"uuid"},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"securityDepositId":{"type":"string","nullable":true,"format":"uuid"},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","type","title","note","assigneeUserId","assigneeName","assigneeEmail","dueAt","status","beforePhotoUrls","afterPhotoUrls","reservationId","incidentId","securityDepositId","completedAt","createdAt","updatedAt"]}},"required":["task"]}}}},"404":{"description":"Property not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Invalid link","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/tasks/{taskId}":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"taskId","in":"path"}],"responses":{"200":{"description":"Task","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"type":"object","properties":{"photoFileId":{"type":"string","nullable":true,"format":"uuid","default":null},"referenceUrl":{"type":"string","nullable":true,"format":"uri","default":null},"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"type":{"type":"string","enum":["todo","purchase","replacement"]},"title":{"type":"string"},"note":{"type":"string","nullable":true},"assigneeUserId":{"type":"string","nullable":true,"format":"uuid"},"assigneeName":{"type":"string","nullable":true},"assigneeEmail":{"type":"string","nullable":true,"format":"email"},"dueAt":{"type":"string","nullable":true,"format":"date-time"},"status":{"type":"string","enum":["open","in_progress","done"]},"beforePhotoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"afterPhotoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"reservationId":{"type":"string","nullable":true,"format":"uuid"},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"securityDepositId":{"type":"string","nullable":true,"format":"uuid"},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","type","title","note","assigneeUserId","assigneeName","assigneeEmail","dueAt","status","beforePhotoUrls","afterPhotoUrls","reservationId","incidentId","securityDepositId","completedAt","createdAt","updatedAt"]}},"required":["task"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"taskId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"photoFileId":{"type":"string","nullable":true,"format":"uuid","default":null},"referenceUrl":{"type":"string","nullable":true,"format":"uri","default":null},"type":{"type":"string","enum":["todo","purchase","replacement"],"default":"todo"},"title":{"type":"string","minLength":1,"maxLength":200},"note":{"type":"string","nullable":true,"maxLength":10000,"default":null},"assigneeUserId":{"type":"string","nullable":true,"format":"uuid","default":null},"dueAt":{"type":"string","nullable":true,"format":"date-time","default":null},"beforePhotoUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":20,"default":[]},"afterPhotoUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":20,"default":[]},"reservationId":{"type":"string","nullable":true,"format":"uuid","default":null},"incidentId":{"type":"string","nullable":true,"format":"uuid","default":null},"securityDepositId":{"type":"string","nullable":true,"format":"uuid","default":null}},"additionalProperties":false}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"type":"object","properties":{"photoFileId":{"type":"string","nullable":true,"format":"uuid","default":null},"referenceUrl":{"type":"string","nullable":true,"format":"uri","default":null},"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"type":{"type":"string","enum":["todo","purchase","replacement"]},"title":{"type":"string"},"note":{"type":"string","nullable":true},"assigneeUserId":{"type":"string","nullable":true,"format":"uuid"},"assigneeName":{"type":"string","nullable":true},"assigneeEmail":{"type":"string","nullable":true,"format":"email"},"dueAt":{"type":"string","nullable":true,"format":"date-time"},"status":{"type":"string","enum":["open","in_progress","done"]},"beforePhotoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"afterPhotoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"reservationId":{"type":"string","nullable":true,"format":"uuid"},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"securityDepositId":{"type":"string","nullable":true,"format":"uuid"},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","type","title","note","assigneeUserId","assigneeName","assigneeEmail","dueAt","status","beforePhotoUrls","afterPhotoUrls","reservationId","incidentId","securityDepositId","completedAt","createdAt","updatedAt"]}},"required":["task"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Invalid link","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/tasks/{taskId}/status":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"taskId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","in_progress","done"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"type":"object","properties":{"photoFileId":{"type":"string","nullable":true,"format":"uuid","default":null},"referenceUrl":{"type":"string","nullable":true,"format":"uri","default":null},"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"type":{"type":"string","enum":["todo","purchase","replacement"]},"title":{"type":"string"},"note":{"type":"string","nullable":true},"assigneeUserId":{"type":"string","nullable":true,"format":"uuid"},"assigneeName":{"type":"string","nullable":true},"assigneeEmail":{"type":"string","nullable":true,"format":"email"},"dueAt":{"type":"string","nullable":true,"format":"date-time"},"status":{"type":"string","enum":["open","in_progress","done"]},"beforePhotoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"afterPhotoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"reservationId":{"type":"string","nullable":true,"format":"uuid"},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"securityDepositId":{"type":"string","nullable":true,"format":"uuid"},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","type","title","note","assigneeUserId","assigneeName","assigneeEmail","dueAt","status","beforePhotoUrls","afterPhotoUrls","reservationId","incidentId","securityDepositId","completedAt","createdAt","updatedAt"]}},"required":["task"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/reviews":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"propertyId","in":"query"},{"schema":{"type":"string","enum":["positive","neutral","negative"]},"required":false,"name":"sentiment","in":"query"},{"schema":{"type":"string","enum":["none","draft","approved","published"]},"required":false,"name":"replyStatus","in":"query"}],"responses":{"200":{"description":"Reviews","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"source":{"type":"string","enum":["manual","airbnb","booking","other"]},"externalId":{"type":"string","nullable":true},"guestName":{"type":"string","nullable":true},"rating":{"type":"integer","minimum":1,"maximum":5},"body":{"type":"string"},"language":{"type":"string"},"sentiment":{"type":"string","nullable":true,"enum":["positive","neutral","negative",null]},"analysis":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"suggestedReply":{"type":"string","nullable":true},"reply":{"type":"string","nullable":true},"replyStatus":{"type":"string","enum":["none","draft","approved","published"]},"translations":{"type":"object","additionalProperties":{"type":"string"}},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","source","externalId","guestName","rating","body","language","sentiment","analysis","suggestedReply","reply","replyStatus","translations","publishedAt","createdAt","updatedAt"]}}},"required":["items"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"propertyId":{"type":"string","format":"uuid"},"source":{"type":"string","enum":["manual","airbnb","booking","other"],"default":"manual"},"externalId":{"type":"string","nullable":true,"maxLength":300,"default":null},"guestName":{"type":"string","nullable":true,"maxLength":160,"default":null},"rating":{"type":"integer","minimum":1,"maximum":5},"body":{"type":"string","minLength":1,"maxLength":10000},"language":{"type":"string","minLength":2,"maxLength":16,"default":"und"},"publishedAt":{"type":"string","nullable":true,"format":"date-time","default":null}},"required":["propertyId","rating","body"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"review":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"source":{"type":"string","enum":["manual","airbnb","booking","other"]},"externalId":{"type":"string","nullable":true},"guestName":{"type":"string","nullable":true},"rating":{"type":"integer","minimum":1,"maximum":5},"body":{"type":"string"},"language":{"type":"string"},"sentiment":{"type":"string","nullable":true,"enum":["positive","neutral","negative",null]},"analysis":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"suggestedReply":{"type":"string","nullable":true},"reply":{"type":"string","nullable":true},"replyStatus":{"type":"string","enum":["none","draft","approved","published"]},"translations":{"type":"object","additionalProperties":{"type":"string"}},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","source","externalId","guestName","rating","body","language","sentiment","analysis","suggestedReply","reply","replyStatus","translations","publishedAt","createdAt","updatedAt"]}},"required":["review"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Duplicate","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/reviews/{reviewId}/analyze":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"reviewId","in":"path"}],"responses":{"200":{"description":"Analyzed","content":{"application/json":{"schema":{"type":"object","properties":{"review":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"source":{"type":"string","enum":["manual","airbnb","booking","other"]},"externalId":{"type":"string","nullable":true},"guestName":{"type":"string","nullable":true},"rating":{"type":"integer","minimum":1,"maximum":5},"body":{"type":"string"},"language":{"type":"string"},"sentiment":{"type":"string","nullable":true,"enum":["positive","neutral","negative",null]},"analysis":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"suggestedReply":{"type":"string","nullable":true},"reply":{"type":"string","nullable":true},"replyStatus":{"type":"string","enum":["none","draft","approved","published"]},"translations":{"type":"object","additionalProperties":{"type":"string"}},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","source","externalId","guestName","rating","body","language","sentiment","analysis","suggestedReply","reply","replyStatus","translations","publishedAt","createdAt","updatedAt"]}},"required":["review"]}}}},"503":{"description":"AI unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/reviews/{reviewId}/translate":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"reviewId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string","minLength":2,"maxLength":16}},"required":["locale"],"additionalProperties":false}}}},"responses":{"200":{"description":"Translated","content":{"application/json":{"schema":{"type":"object","properties":{"review":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"source":{"type":"string","enum":["manual","airbnb","booking","other"]},"externalId":{"type":"string","nullable":true},"guestName":{"type":"string","nullable":true},"rating":{"type":"integer","minimum":1,"maximum":5},"body":{"type":"string"},"language":{"type":"string"},"sentiment":{"type":"string","nullable":true,"enum":["positive","neutral","negative",null]},"analysis":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"suggestedReply":{"type":"string","nullable":true},"reply":{"type":"string","nullable":true},"replyStatus":{"type":"string","enum":["none","draft","approved","published"]},"translations":{"type":"object","additionalProperties":{"type":"string"}},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","source","externalId","guestName","rating","body","language","sentiment","analysis","suggestedReply","reply","replyStatus","translations","publishedAt","createdAt","updatedAt"]}},"required":["review"]}}}},"503":{"description":"AI unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/reviews/{reviewId}/reply":{"put":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"reviewId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reply":{"type":"string","minLength":1,"maxLength":10000},"status":{"type":"string","enum":["draft","approved","published"]}},"required":["reply","status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Reply saved","content":{"application/json":{"schema":{"type":"object","properties":{"review":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"source":{"type":"string","enum":["manual","airbnb","booking","other"]},"externalId":{"type":"string","nullable":true},"guestName":{"type":"string","nullable":true},"rating":{"type":"integer","minimum":1,"maximum":5},"body":{"type":"string"},"language":{"type":"string"},"sentiment":{"type":"string","nullable":true,"enum":["positive","neutral","negative",null]},"analysis":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"suggestedReply":{"type":"string","nullable":true},"reply":{"type":"string","nullable":true},"replyStatus":{"type":"string","enum":["none","draft","approved","published"]},"translations":{"type":"object","additionalProperties":{"type":"string"}},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","source","externalId","guestName","rating","body","language","sentiment","analysis","suggestedReply","reply","replyStatus","translations","publishedAt","createdAt","updatedAt"]}},"required":["review"]}}}}}}},"/api/guides":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"propertyId","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"published","in":"query"}],"responses":{"200":{"description":"Guides","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"topic":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false}]}},"defaultLocale":{"type":"string"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"topic":{"type":"string"},"content":{"type":"string"}},"required":["topic","content"]}},"isPublished":{"type":"boolean"},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","topic","content","media","defaultLocale","translations","isPublished","sortOrder","createdAt","updatedAt"]}}},"required":["items"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"propertyId":{"type":"string","format":"uuid"},"topic":{"type":"string","minLength":1,"maxLength":300},"content":{"type":"string","minLength":1,"maxLength":50000},"media":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false}]},"maxItems":30,"default":[]},"defaultLocale":{"type":"string","minLength":2,"maxLength":16,"default":"ru"},"isPublished":{"type":"boolean","default":false},"sortOrder":{"type":"integer","minimum":0,"maximum":10000,"default":0}},"required":["propertyId","topic","content"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"guide":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"topic":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false}]}},"defaultLocale":{"type":"string"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"topic":{"type":"string"},"content":{"type":"string"}},"required":["topic","content"]}},"isPublished":{"type":"boolean"},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","topic","content","media","defaultLocale","translations","isPublished","sortOrder","createdAt","updatedAt"]}},"required":["guide"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/guides/{guideId}":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"guideId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"topic":{"type":"string","minLength":1,"maxLength":300},"content":{"type":"string","minLength":1,"maxLength":50000},"media":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false}]},"maxItems":30,"default":[]},"defaultLocale":{"type":"string","minLength":2,"maxLength":16,"default":"ru"},"isPublished":{"type":"boolean","default":false},"sortOrder":{"type":"integer","minimum":0,"maximum":10000,"default":0}},"additionalProperties":false}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"guide":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"topic":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false}]}},"defaultLocale":{"type":"string"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"topic":{"type":"string"},"content":{"type":"string"}},"required":["topic","content"]}},"isPublished":{"type":"boolean"},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","topic","content","media","defaultLocale","translations","isPublished","sortOrder","createdAt","updatedAt"]}},"required":["guide"]}}}}}}},"/api/guides/{guideId}/translate":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"guideId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string","minLength":2,"maxLength":16}},"required":["locale"],"additionalProperties":false}}}},"responses":{"200":{"description":"Translated","content":{"application/json":{"schema":{"type":"object","properties":{"guide":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"topic":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"additionalProperties":false}]}},"defaultLocale":{"type":"string"},"translations":{"type":"object","additionalProperties":{"type":"object","properties":{"topic":{"type":"string"},"content":{"type":"string"}},"required":["topic","content"]}},"isPublished":{"type":"boolean"},"sortOrder":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","topic","content","media","defaultLocale","translations","isPublished","sortOrder","createdAt","updatedAt"]}},"required":["guide"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/lockboxes":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"propertyId","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"active","in":"query"}],"responses":{"200":{"description":"Lockboxes","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"label":{"type":"string"},"location":{"type":"string"},"codeLastFour":{"type":"string","minLength":4,"maxLength":4},"code":{"type":"string","minLength":4,"maxLength":32},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","label","location","codeLastFour","active","createdAt","updatedAt"]}}},"required":["items"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"propertyId":{"type":"string","format":"uuid"},"label":{"type":"string","minLength":1,"maxLength":160},"location":{"type":"string","minLength":1,"maxLength":1000},"code":{"type":"string","minLength":4,"maxLength":32},"active":{"type":"boolean","default":true}},"required":["propertyId","label","location","code"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"lockbox":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"label":{"type":"string"},"location":{"type":"string"},"codeLastFour":{"type":"string","minLength":4,"maxLength":4},"code":{"type":"string","minLength":4,"maxLength":32},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","label","location","codeLastFour","active","createdAt","updatedAt"]}},"required":["lockbox"]}}}},"503":{"description":"Encryption unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/lockboxes/{lockboxId}":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"lockboxId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":160},"location":{"type":"string","minLength":1,"maxLength":1000},"code":{"type":"string","minLength":4,"maxLength":32},"active":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"lockbox":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"label":{"type":"string"},"location":{"type":"string"},"codeLastFour":{"type":"string","minLength":4,"maxLength":4},"code":{"type":"string","minLength":4,"maxLength":32},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","label","location","codeLastFour","active","createdAt","updatedAt"]}},"required":["lockbox"]}}}}}}},"/api/lockboxes/{lockboxId}/reveal":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"lockboxId","in":"path"}],"responses":{"200":{"description":"Code revealed","content":{"application/json":{"schema":{"type":"object","properties":{"lockbox":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"label":{"type":"string"},"location":{"type":"string"},"codeLastFour":{"type":"string","minLength":4,"maxLength":4},"code":{"type":"string","minLength":4,"maxLength":32},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","propertyId","propertyName","label","location","codeLastFour","active","createdAt","updatedAt"]}},"required":["lockbox"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"503":{"description":"Encryption unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/payroll":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"staffMembershipId","in":"query"},{"schema":{"type":"string","enum":["draft","approved","paid"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Payroll","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"staffMembershipId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"recipientUserId":{"type":"string","format":"uuid"},"recipientName":{"type":"string","nullable":true},"recipientEmail":{"type":"string","format":"email"},"periodStart":{"type":"string","format":"date-time"},"periodEnd":{"type":"string","format":"date-time"},"hours":{"type":"number","nullable":true,"minimum":0},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string","enum":["draft","approved","paid"]},"paidAt":{"type":"string","nullable":true,"format":"date-time"},"transactionId":{"type":"string","nullable":true,"format":"uuid"},"note":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","staffMembershipId","propertyId","recipientUserId","recipientName","recipientEmail","periodStart","periodEnd","hours","amount","currency","status","paidAt","transactionId","note","createdAt","updatedAt"]}}},"required":["items"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"staffMembershipId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"periodStart":{"type":"string","format":"date-time"},"periodEnd":{"type":"string","format":"date-time"},"hours":{"type":"number","nullable":true,"minimum":0,"default":null},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"note":{"type":"string","nullable":true,"maxLength":2000,"default":null}},"required":["staffMembershipId","periodStart","periodEnd","amount","currency"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"staffMembershipId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"recipientUserId":{"type":"string","format":"uuid"},"recipientName":{"type":"string","nullable":true},"recipientEmail":{"type":"string","format":"email"},"periodStart":{"type":"string","format":"date-time"},"periodEnd":{"type":"string","format":"date-time"},"hours":{"type":"number","nullable":true,"minimum":0},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string","enum":["draft","approved","paid"]},"paidAt":{"type":"string","nullable":true,"format":"date-time"},"transactionId":{"type":"string","nullable":true,"format":"uuid"},"note":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","staffMembershipId","propertyId","recipientUserId","recipientName","recipientEmail","periodStart","periodEnd","hours","amount","currency","status","paidAt","transactionId","note","createdAt","updatedAt"]}},"required":["record"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/payroll/{payrollId}/status":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"payrollId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["draft","approved","paid"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"staffMembershipId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"recipientUserId":{"type":"string","format":"uuid"},"recipientName":{"type":"string","nullable":true},"recipientEmail":{"type":"string","format":"email"},"periodStart":{"type":"string","format":"date-time"},"periodEnd":{"type":"string","format":"date-time"},"hours":{"type":"number","nullable":true,"minimum":0},"amount":{"type":"number","minimum":0,"maximum":999999999999.99},"currency":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string","enum":["draft","approved","paid"]},"paidAt":{"type":"string","nullable":true,"format":"date-time"},"transactionId":{"type":"string","nullable":true,"format":"uuid"},"note":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","staffMembershipId","propertyId","recipientUserId","recipientName","recipientEmail","periodStart","periodEnd","hours","amount","currency","status","paidAt","transactionId","note","createdAt","updatedAt"]}},"required":["record"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/reports":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"propertyId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"timeZone","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":90,"default":14},"required":false,"name":"upcomingDays","in":"query"}],"responses":{"200":{"description":"Analytics reports","content":{"application/json":{"schema":{"type":"object","properties":{"report":{"type":"object","properties":{"trend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"currency":{"type":"string"},"income":{"type":"number"},"expense":{"type":"number"}},"required":["date","currency","income","expense"]},"default":[]},"occupancyTrend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"occupancyPct":{"type":"number"}},"required":["date","occupancyPct"]},"default":[]},"properties":{"type":"array","items":{"type":"object","properties":{"propertyId":{"type":"string","format":"uuid"},"name":{"type":"string"},"currency":{"type":"string","minLength":3,"maxLength":3},"revenue":{"type":"number"},"bookedNights":{"type":"integer","minimum":0}},"required":["propertyId","name","currency","revenue","bookedNights"]},"default":[]},"staffActions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"actorName":{"type":"string"},"action":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"propertyId":{"type":"string","nullable":true}},"required":["id","actorName","action","createdAt","propertyId"]},"default":[]},"period":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"availableNights":{"type":"integer","minimum":0}},"required":["from","to","availableNights"]},"scope":{"type":"object","properties":{"propertyId":{"type":"string","nullable":true,"format":"uuid"},"propertyName":{"type":"string","nullable":true}},"required":["propertyId","propertyName"]},"visibility":{"type":"object","additionalProperties":{"type":"boolean"}},"pnl":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"income":{"type":"number"},"expense":{"type":"number"},"net":{"type":"number"},"planned":{"type":"number","nullable":true}},"required":["currency","income","expense","net","planned"]}},"occupancy":{"type":"object","properties":{"bookedNights":{"type":"integer","minimum":0},"availableNights":{"type":"integer","minimum":0},"occupancyPct":{"type":"number"},"adr":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amount":{"type":"number"}},"required":["currency","amount"]}},"revpar":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amount":{"type":"number"}},"required":["currency","amount"]}}},"required":["bookedNights","availableNights","occupancyPct","adr","revpar"]},"bookingSources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["manual","ota","direct"]},"reservations":{"type":"integer","minimum":0},"nights":{"type":"integer","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3},"revenue":{"type":"number"}},"required":["source","reservations","nights","currency","revenue"]}},"agencyCommission":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amount":{"type":"number"}},"required":["currency","amount"]}},"payouts":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"planned":{"type":"number"},"paid":{"type":"number"},"outstanding":{"type":"number"}},"required":["currency","planned","paid","outstanding"]}},"cashFlow":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"cashIn":{"type":"number"},"cashOut":{"type":"number"},"net":{"type":"number"}},"required":["currency","cashIn","cashOut","net"]}},"expenses":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"currency":{"type":"string","minLength":3,"maxLength":3},"amount":{"type":"number"}},"required":["category","currency","amount"]}},"cancellations":{"type":"object","properties":{"cancelled":{"type":"integer","minimum":0},"noShow":{"type":"integer","minimum":0},"settled":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amount":{"type":"number"}},"required":["currency","amount"]}}},"required":["cancelled","noShow","settled"]},"incidents":{"type":"object","properties":{"open":{"type":"integer","minimum":0},"inProgress":{"type":"integer","minimum":0},"resolved":{"type":"integer","minimum":0},"resolutionCost":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amount":{"type":"number"}},"required":["currency","amount"]}}},"required":["open","inProgress","resolved","resolutionCost"]},"staffAccess":{"type":"array","items":{"type":"object","properties":{"staffMembershipId":{"type":"string","format":"uuid"},"staffName":{"type":"string","nullable":true},"staffEmail":{"type":"string","format":"email"},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"section":{"type":"string"},"canRead":{"type":"boolean"},"canWrite":{"type":"boolean"},"canManage":{"type":"boolean"}},"required":["staffMembershipId","staffName","staffEmail","propertyId","section","canRead","canWrite","canManage"]}},"upcoming":{"type":"array","items":{"type":"object","properties":{"reservationId":{"type":"string","format":"uuid"},"propertyId":{"type":"string","format":"uuid"},"propertyName":{"type":"string"},"guestName":{"type":"string"},"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["pending","confirmed"]}},"required":["reservationId","propertyId","propertyName","guestName","checkIn","checkOut","status"]}}},"required":["period","scope","visibility","pnl","occupancy","bookingSources","agencyCommission","payouts","cashFlow","expenses","cancellations","incidents","staffAccess","upcoming"]}},"required":["report"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Scope not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/reports/export":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"propertyId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"timeZone","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":90,"default":14},"required":false,"name":"upcomingDays","in":"query"},{"schema":{"type":"string","enum":["pdf","xlsx"]},"required":true,"name":"format","in":"query"},{"schema":{"type":"string","format":"date"},"required":true,"name":"periodFrom","in":"query"},{"schema":{"type":"string","format":"date"},"required":true,"name":"periodTo","in":"query"}],"responses":{"200":{"description":"Report file"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Scope not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/marketplace/providers":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","maxLength":100},"required":false,"name":"category","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"serviceArea","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"includeInactive","in":"query"}],"responses":{"200":{"description":"Providers","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"categories":{"type":"array","items":{"type":"string"}},"serviceAreas":{"type":"array","items":{"type":"string"}},"contacts":{"type":"object","properties":{"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true,"format":"uri"}},"required":["email","phone","website"]},"verificationStatus":{"type":"string","enum":["pending","verified","rejected"]},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","categories","serviceAreas","contacts","verificationStatus","active","createdAt","updatedAt"]}}},"required":["items"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":200},"description":{"type":"string","nullable":true,"maxLength":5000,"default":null},"categories":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"minItems":1,"maxItems":30},"serviceAreas":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":100},"contacts":{"type":"object","properties":{"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true,"format":"uri"}},"required":["email","phone","website"]},"verificationStatus":{"type":"string","enum":["pending","verified","rejected"],"default":"pending"},"active":{"type":"boolean","default":true}},"required":["name","categories","serviceAreas","contacts"],"additionalProperties":false}}}},"responses":{"201":{"description":"Provider created","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"categories":{"type":"array","items":{"type":"string"}},"serviceAreas":{"type":"array","items":{"type":"string"}},"contacts":{"type":"object","properties":{"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true,"format":"uri"}},"required":["email","phone","website"]},"verificationStatus":{"type":"string","enum":["pending","verified","rejected"]},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","categories","serviceAreas","contacts","verificationStatus","active","createdAt","updatedAt"]}},"required":["provider"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/marketplace/providers/{providerId}":{"put":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"providerId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":200},"description":{"type":"string","nullable":true,"maxLength":5000,"default":null},"categories":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"minItems":1,"maxItems":30},"serviceAreas":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":100},"contacts":{"type":"object","properties":{"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true,"format":"uri"}},"required":["email","phone","website"]},"verificationStatus":{"type":"string","enum":["pending","verified","rejected"],"default":"pending"},"active":{"type":"boolean","default":true}},"required":["name","categories","serviceAreas","contacts"],"additionalProperties":false}}}},"responses":{"200":{"description":"Provider updated","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"categories":{"type":"array","items":{"type":"string"}},"serviceAreas":{"type":"array","items":{"type":"string"}},"contacts":{"type":"object","properties":{"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true,"format":"uri"}},"required":["email","phone","website"]},"verificationStatus":{"type":"string","enum":["pending","verified","rejected"]},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","categories","serviceAreas","contacts","verificationStatus","active","createdAt","updatedAt"]}},"required":["provider"]}}}}}}},"/api/marketplace/requests":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Requests","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"providerId":{"type":"string","nullable":true,"format":"uuid"},"providerName":{"type":"string","nullable":true},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"propertyName":{"type":"string","nullable":true},"taskId":{"type":"string","nullable":true,"format":"uuid"},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"category":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["new","sent","accepted","completed","cancelled"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","providerId","providerName","propertyId","propertyName","taskId","incidentId","category","description","status","createdAt","updatedAt"]}}},"required":["items"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"providerId":{"type":"string","nullable":true,"format":"uuid","default":null},"propertyId":{"type":"string","nullable":true,"format":"uuid","default":null},"taskId":{"type":"string","nullable":true,"format":"uuid","default":null},"incidentId":{"type":"string","nullable":true,"format":"uuid","default":null},"category":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","minLength":5,"maxLength":10000}},"required":["category","description"],"additionalProperties":false}}}},"responses":{"201":{"description":"Request created","content":{"application/json":{"schema":{"type":"object","properties":{"request":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"providerId":{"type":"string","nullable":true,"format":"uuid"},"providerName":{"type":"string","nullable":true},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"propertyName":{"type":"string","nullable":true},"taskId":{"type":"string","nullable":true,"format":"uuid"},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"category":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["new","sent","accepted","completed","cancelled"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","providerId","providerName","propertyId","propertyName","taskId","incidentId","category","description","status","createdAt","updatedAt"]}},"required":["request"]}}}},"409":{"description":"Invalid link","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/marketplace/requests/{requestId}/status":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"requestId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["new","sent","accepted","completed","cancelled"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"request":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"providerId":{"type":"string","nullable":true,"format":"uuid"},"providerName":{"type":"string","nullable":true},"propertyId":{"type":"string","nullable":true,"format":"uuid"},"propertyName":{"type":"string","nullable":true},"taskId":{"type":"string","nullable":true,"format":"uuid"},"incidentId":{"type":"string","nullable":true,"format":"uuid"},"category":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["new","sent","accepted","completed","cancelled"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","providerId","providerName","propertyId","propertyName","taskId","incidentId","category","description","status","createdAt","updatedAt"]}},"required":["request"]}}}}}}},"/api/notifications":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Notifications","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"link":{"type":"string","nullable":true},"readAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","type","title","body","link","readAt","createdAt"]}},"unreadCount":{"type":"integer","minimum":0}},"required":["items","unreadCount"]}}}}}}},"/api/notifications/{notificationId}":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"notificationId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"read":{"type":"boolean"}},"required":["read"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"notification":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"link":{"type":"string","nullable":true},"readAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","type","title","body","link","readAt","createdAt"]}},"required":["notification"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/objects/markets":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Markets","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"countryCode":{"type":"string","minLength":2,"maxLength":2},"currencyDefault":{"type":"string","minLength":3,"maxLength":3}},"required":["id","countryCode","currencyDefault"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/objects/owners":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Organization owners available for property assignment","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true}},"required":["id","name","email","phone"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/objects/photo-uploads":{"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"contentType":{"type":"string","enum":["image/jpeg","image/png","image/heic","image/heif"]},"byteSize":{"type":"integer","minimum":64,"maximum":5242880}},"required":["contentType","byteSize"],"additionalProperties":false}}}},"responses":{"201":{"description":"Property photo upload ticket","content":{"application/json":{"schema":{"type":"object","properties":{"upload":{"type":"object","properties":{"uploadId":{"type":"string","format":"uuid"},"method":{"type":"string","enum":["PUT"]},"url":{"type":"string","minLength":1,"maxLength":2048},"headers":{"type":"object","additionalProperties":{"type":"string"}},"contentLength":{"type":"integer","minimum":0,"exclusiveMinimum":true},"expiresAt":{"type":"string","format":"date-time"}},"required":["uploadId","method","url","headers","contentLength","expiresAt"],"additionalProperties":false}},"required":["upload"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/objects/photo-uploads/{uploadId}/finalize":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"uploadId","in":"path"}],"responses":{"200":{"description":"Validated property photo","content":{"application/json":{"schema":{"type":"object","properties":{"photo":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"contentType":{"type":"string","enum":["image/jpeg","image/png","image/heic","image/heif"]},"byteSize":{"type":"integer","minimum":0,"exclusiveMinimum":true},"url":{"type":"string","format":"uri"}},"required":["id","contentType","byteSize","url"],"additionalProperties":false}},"required":["photo"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Property not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/objects":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Visible properties","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","nullable":true,"format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"market":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"countryCode":{"type":"string","minLength":2,"maxLength":2},"currencyDefault":{"type":"string","minLength":3,"maxLength":3}},"required":["id","countryCode","currencyDefault"]},"name":{"type":"string"},"address":{"type":"string","nullable":true},"district":{"type":"string","nullable":true},"areaSqm":{"type":"number","nullable":true,"minimum":0,"exclusiveMinimum":true},"bedrooms":{"type":"integer","nullable":true,"minimum":0},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"coverPhotoUrl":{"type":"string","nullable":true,"format":"uri","default":null},"keyPickupPlan":{"type":"string","nullable":true},"ownerContact":{"type":"object","properties":{"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true}},"required":["name","email","phone"]},"managementContacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"phone":{"type":"string"},"responsibilityArea":{"type":"string"}},"required":["id","name","phone","responsibilityArea"]}},"managedBy":{"type":"string","enum":["organization","owner"]},"timezone":{"type":"string"},"contractStatus":{"type":"string","enum":["active","terminated"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","ownerId","market","name","address","district","areaSqm","bedrooms","photoUrls","keyPickupPlan","ownerContact","managementContacts","managedBy","timezone","contractStatus","createdAt","updatedAt"]}}},"required":["items"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ownerId":{"type":"string","format":"uuid"},"ownerName":{"type":"string","minLength":2,"maxLength":160},"ownerEmail":{"type":"string","format":"email"},"ownerPhone":{"type":"string","minLength":7,"maxLength":32},"marketId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":2,"maxLength":160},"address":{"type":"string","maxLength":500},"managedBy":{"type":"string","enum":["organization","owner"]},"timezone":{"type":"string","minLength":1,"maxLength":100,"default":"Asia/Bangkok"},"district":{"type":"string","maxLength":160},"areaSqm":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":1000000},"bedrooms":{"type":"integer","minimum":0,"maximum":1000},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":50,"default":[]},"keyPickupPlan":{"type":"string","maxLength":5000},"photoUploadIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":50,"default":[]}},"required":["name","managedBy"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created property","content":{"application/json":{"schema":{"type":"object","properties":{"property":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","nullable":true,"format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"market":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"countryCode":{"type":"string","minLength":2,"maxLength":2},"currencyDefault":{"type":"string","minLength":3,"maxLength":3}},"required":["id","countryCode","currencyDefault"]},"name":{"type":"string"},"address":{"type":"string","nullable":true},"district":{"type":"string","nullable":true},"areaSqm":{"type":"number","nullable":true,"minimum":0,"exclusiveMinimum":true},"bedrooms":{"type":"integer","nullable":true,"minimum":0},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"coverPhotoUrl":{"type":"string","nullable":true,"format":"uri","default":null},"keyPickupPlan":{"type":"string","nullable":true},"ownerContact":{"type":"object","properties":{"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true}},"required":["name","email","phone"]},"managementContacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"phone":{"type":"string"},"responsibilityArea":{"type":"string"}},"required":["id","name","phone","responsibilityArea"]}},"managedBy":{"type":"string","enum":["organization","owner"]},"timezone":{"type":"string"},"contractStatus":{"type":"string","enum":["active","terminated"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","ownerId","market","name","address","district","areaSqm","bedrooms","photoUrls","keyPickupPlan","ownerContact","managementContacts","managedBy","timezone","contractStatus","createdAt","updatedAt"]}},"required":["property"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Property not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/objects/{propertyId}":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"propertyId","in":"path"}],"responses":{"200":{"description":"Property","content":{"application/json":{"schema":{"type":"object","properties":{"property":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","nullable":true,"format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"market":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"countryCode":{"type":"string","minLength":2,"maxLength":2},"currencyDefault":{"type":"string","minLength":3,"maxLength":3}},"required":["id","countryCode","currencyDefault"]},"name":{"type":"string"},"address":{"type":"string","nullable":true},"district":{"type":"string","nullable":true},"areaSqm":{"type":"number","nullable":true,"minimum":0,"exclusiveMinimum":true},"bedrooms":{"type":"integer","nullable":true,"minimum":0},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"coverPhotoUrl":{"type":"string","nullable":true,"format":"uri","default":null},"keyPickupPlan":{"type":"string","nullable":true},"ownerContact":{"type":"object","properties":{"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true}},"required":["name","email","phone"]},"managementContacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"phone":{"type":"string"},"responsibilityArea":{"type":"string"}},"required":["id","name","phone","responsibilityArea"]}},"managedBy":{"type":"string","enum":["organization","owner"]},"timezone":{"type":"string"},"contractStatus":{"type":"string","enum":["active","terminated"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","ownerId","market","name","address","district","areaSqm","bedrooms","photoUrls","keyPickupPlan","ownerContact","managementContacts","managedBy","timezone","contractStatus","createdAt","updatedAt"]}},"required":["property"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Property not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"propertyId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"photoUploadIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":50},"name":{"type":"string","minLength":2,"maxLength":160},"address":{"type":"string","nullable":true,"maxLength":500},"timezone":{"type":"string","minLength":1,"maxLength":100},"contractStatus":{"type":"string","enum":["active","terminated"]},"district":{"type":"string","nullable":true,"maxLength":160},"areaSqm":{"type":"number","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":1000000},"bedrooms":{"type":"integer","nullable":true,"minimum":0,"maximum":1000},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":50},"coverPhotoUrl":{"type":"string","nullable":true,"format":"uri"},"keyPickupPlan":{"type":"string","nullable":true,"maxLength":5000},"managementContacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":160},"phone":{"type":"string","minLength":7,"maxLength":32},"responsibilityArea":{"type":"string","minLength":1,"maxLength":300}},"required":["name","phone","responsibilityArea"],"additionalProperties":false},"maxItems":20}},"additionalProperties":false}}}},"responses":{"200":{"description":"Updated property","content":{"application/json":{"schema":{"type":"object","properties":{"property":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","nullable":true,"format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"market":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"countryCode":{"type":"string","minLength":2,"maxLength":2},"currencyDefault":{"type":"string","minLength":3,"maxLength":3}},"required":["id","countryCode","currencyDefault"]},"name":{"type":"string"},"address":{"type":"string","nullable":true},"district":{"type":"string","nullable":true},"areaSqm":{"type":"number","nullable":true,"minimum":0,"exclusiveMinimum":true},"bedrooms":{"type":"integer","nullable":true,"minimum":0},"photoUrls":{"type":"array","items":{"type":"string","format":"uri"}},"coverPhotoUrl":{"type":"string","nullable":true,"format":"uri","default":null},"keyPickupPlan":{"type":"string","nullable":true},"ownerContact":{"type":"object","properties":{"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true}},"required":["name","email","phone"]},"managementContacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"phone":{"type":"string"},"responsibilityArea":{"type":"string"}},"required":["id","name","phone","responsibilityArea"]}},"managedBy":{"type":"string","enum":["organization","owner"]},"timezone":{"type":"string"},"contractStatus":{"type":"string","enum":["active","terminated"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","ownerId","market","name","address","district","areaSqm","bedrooms","photoUrls","keyPickupPlan","ownerContact","managementContacts","managedBy","timezone","contractStatus","createdAt","updatedAt"]}},"required":["property"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Property not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/users/me":{"patch":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"anyOf":[{"type":"string","minLength":2,"maxLength":80},{"nullable":true}]}},"required":["displayName"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated current user profile","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","nullable":true},"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","displayName","role","createdAt"]}},"required":["user"],"additionalProperties":false}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/admin/settings/ai":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"AI settings: effective values (admin settings over env), secret status without values, usage","content":{"application/json":{"schema":{"type":"object","properties":{"assistant":{"type":"object","properties":{"enabled":{"type":"boolean"},"model":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[\\w.:/-]+$"},"apiUrl":{"type":"string","maxLength":500,"format":"uri"},"dailyMessageLimit":{"type":"integer","minimum":1,"maximum":10000},"organizationDailyMessageLimit":{"type":"integer","minimum":1,"maximum":1000000},"maxAttachmentMb":{"type":"integer","minimum":1,"maximum":50},"allowedRoles":{"type":"array","items":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"maxItems":5},"proposalsEnabled":{"type":"boolean"},"systemPromptAddendum":{"type":"string","maxLength":2000}},"required":["enabled","model","apiUrl","dailyMessageLimit","organizationDailyMessageLimit","maxAttachmentMb","allowedRoles","proposalsEnabled","systemPromptAddendum"]},"provider":{"type":"object","properties":{"apiKey":{"type":"object","properties":{"configured":{"type":"boolean"},"last4":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true,"format":"date-time"},"updatedBy":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["configured","last4","updatedAt","updatedBy"]},"source":{"type":"string","enum":["db","env","none"]}},"required":["apiKey","source"]},"ocr":{"type":"object","properties":{"url":{"type":"string","nullable":true},"timeoutMs":{"type":"integer","minimum":0,"exclusiveMinimum":true},"token":{"type":"object","properties":{"configured":{"type":"boolean"},"last4":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true,"format":"date-time"},"updatedBy":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["configured","last4","updatedAt","updatedBy"]}},"required":["url","timeoutMs","token"]},"usage":{"type":"object","properties":{"messagesToday":{"type":"integer","minimum":0},"messagesLast7Days":{"type":"integer","minimum":0},"topOrganizations":{"type":"array","items":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string"},"messages":{"type":"integer","minimum":0}},"required":["organizationId","name","messages"]},"maxItems":5}},"required":["messagesToday","messagesLast7Days","topOrganizations"]},"secretsWritable":{"type":"boolean"},"updatedAt":{"type":"string","nullable":true,"format":"date-time"},"updatedBy":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["assistant","provider","ocr","usage","secretsWritable","updatedAt","updatedBy"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Administrator access required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"security":[{"BearerAuth":[]}],"description":"Частичное обновление. provider.apiKey / ocr.token: строка — задать (хранится зашифрованной), null — удалить из настроек (останется значение из env, если есть). Секреты в ответе — только {configured, last4, updatedAt, updatedBy}.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"assistant":{"type":"object","properties":{"enabled":{"type":"boolean"},"model":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[\\w.:/-]+$"},"apiUrl":{"type":"string","maxLength":500,"format":"uri"},"dailyMessageLimit":{"type":"integer","minimum":1,"maximum":10000},"organizationDailyMessageLimit":{"type":"integer","minimum":1,"maximum":1000000},"maxAttachmentMb":{"type":"integer","minimum":1,"maximum":50},"allowedRoles":{"type":"array","items":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"maxItems":5},"proposalsEnabled":{"type":"boolean"},"systemPromptAddendum":{"type":"string","maxLength":2000}},"additionalProperties":false},"provider":{"type":"object","properties":{"apiKey":{"type":"string","nullable":true,"minLength":8,"maxLength":500,"pattern":"^\\S+$"}},"additionalProperties":false},"ocr":{"type":"object","properties":{"url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"string","enum":[""]}]},"timeoutMs":{"type":"integer","minimum":1000,"maximum":60000},"token":{"type":"string","nullable":true,"minLength":1,"maxLength":1000,"pattern":"^\\S+$"}},"additionalProperties":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"AI settings: effective values (admin settings over env), secret status without values, usage","content":{"application/json":{"schema":{"type":"object","properties":{"assistant":{"type":"object","properties":{"enabled":{"type":"boolean"},"model":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[\\w.:/-]+$"},"apiUrl":{"type":"string","maxLength":500,"format":"uri"},"dailyMessageLimit":{"type":"integer","minimum":1,"maximum":10000},"organizationDailyMessageLimit":{"type":"integer","minimum":1,"maximum":1000000},"maxAttachmentMb":{"type":"integer","minimum":1,"maximum":50},"allowedRoles":{"type":"array","items":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"maxItems":5},"proposalsEnabled":{"type":"boolean"},"systemPromptAddendum":{"type":"string","maxLength":2000}},"required":["enabled","model","apiUrl","dailyMessageLimit","organizationDailyMessageLimit","maxAttachmentMb","allowedRoles","proposalsEnabled","systemPromptAddendum"]},"provider":{"type":"object","properties":{"apiKey":{"type":"object","properties":{"configured":{"type":"boolean"},"last4":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true,"format":"date-time"},"updatedBy":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["configured","last4","updatedAt","updatedBy"]},"source":{"type":"string","enum":["db","env","none"]}},"required":["apiKey","source"]},"ocr":{"type":"object","properties":{"url":{"type":"string","nullable":true},"timeoutMs":{"type":"integer","minimum":0,"exclusiveMinimum":true},"token":{"type":"object","properties":{"configured":{"type":"boolean"},"last4":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true,"format":"date-time"},"updatedBy":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["configured","last4","updatedAt","updatedBy"]}},"required":["url","timeoutMs","token"]},"usage":{"type":"object","properties":{"messagesToday":{"type":"integer","minimum":0},"messagesLast7Days":{"type":"integer","minimum":0},"topOrganizations":{"type":"array","items":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string"},"messages":{"type":"integer","minimum":0}},"required":["organizationId","name","messages"]},"maxItems":5}},"required":["messagesToday","messagesLast7Days","topOrganizations"]},"secretsWritable":{"type":"boolean"},"updatedAt":{"type":"string","nullable":true,"format":"date-time"},"updatedBy":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["assistant","provider","ocr","usage","secretsWritable","updatedAt","updatedBy"]}}}},"400":{"description":"Invalid settings","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Administrator access required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"LOCKBOX_ENCRYPTION_KEY is not set: secrets cannot be stored","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/admin/settings/ai/test":{"post":{"security":[{"BearerAuth":[]}],"description":"Проверка подключения к модели текущими настройками или переданными (не сохраняя) ключом, URL и моделью. Ответ провайдера не пересказывается.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string","minLength":8,"maxLength":500,"pattern":"^\\S+$"},"apiUrl":{"type":"string","maxLength":500,"format":"uri"},"model":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[\\w.:/-]+$"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Connection check result","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"latencyMs":{"type":"integer","minimum":0},"model":{"type":"string"},"error":{"type":"string"}},"required":["ok","latencyMs","model"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Administrator access required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/admin/dashboard":{"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Administrator dashboard metrics","content":{"application/json":{"schema":{"type":"object","properties":{"totalUsers":{"type":"integer","minimum":0},"totalAdmins":{"type":"integer","minimum":0},"newUsersLast7Days":{"type":"integer","minimum":0}},"required":["totalUsers","totalAdmins","newUsersLast7Days"],"additionalProperties":false}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Administrator access required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/admin/users":{"get":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","maxLength":100},"required":false,"name":"q","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"pageSize","in":"query"}],"responses":{"200":{"description":"Paginated users","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","nullable":true},"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","displayName","role","createdAt"],"additionalProperties":false}},"page":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100},"pageSize":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100},"total":{"type":"integer","minimum":0},"hasNext":{"type":"boolean"}},"required":["items","page","pageSize","total","hasNext"],"additionalProperties":false}}}},"400":{"description":"Invalid query","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Administrator access required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/admin/users/{userId}/role":{"patch":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"userId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]}},"required":["role"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated user role","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","maxLength":254,"format":"email"},"displayName":{"type":"string","nullable":true},"role":{"type":"string","enum":["organization","owner","staff","tenant","platform_admin"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","email","displayName","role","createdAt"],"additionalProperties":false}},"required":["user"],"additionalProperties":false}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Administrator access required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Role update conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/uploads/avatar":{"post":{"security":[{"BearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"contentType":{"type":"string","enum":["image/jpeg","image/png","image/heic","image/heif"]},"byteSize":{"type":"integer","minimum":64,"maximum":5242880}},"required":["contentType","byteSize"],"additionalProperties":false}}}},"responses":{"201":{"description":"Presigned upload ticket for a new avatar","content":{"application/json":{"schema":{"type":"object","properties":{"upload":{"type":"object","properties":{"uploadId":{"type":"string","format":"uuid"},"method":{"type":"string","enum":["PUT"]},"url":{"type":"string","minLength":1,"maxLength":2048},"headers":{"type":"object","additionalProperties":{"type":"string"}},"contentLength":{"type":"integer","minimum":0,"exclusiveMinimum":true},"expiresAt":{"type":"string","format":"date-time"}},"required":["uploadId","method","url","headers","contentLength","expiresAt"],"additionalProperties":false}},"required":["upload"],"additionalProperties":false}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"get":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"The current avatar, or null when there is none","content":{"application/json":{"schema":{"type":"object","properties":{"avatar":{"type":"object","nullable":true,"properties":{"contentType":{"type":"string","enum":["image/jpeg","image/png","image/heic","image/heif"]},"byteSize":{"type":"integer","minimum":0,"exclusiveMinimum":true},"updatedAt":{"type":"string","format":"date-time"},"downloadUrl":{"type":"string","minLength":1,"maxLength":2048},"downloadUrlExpiresAt":{"type":"string","format":"date-time"}},"required":["contentType","byteSize","updatedAt","downloadUrl","downloadUrlExpiresAt"],"additionalProperties":false}},"required":["avatar"],"additionalProperties":false}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Avatar removed; idempotent","content":{"application/json":{"schema":{"type":"object","properties":{"avatar":{"type":"object","nullable":true,"properties":{"contentType":{"type":"string","enum":["image/jpeg","image/png","image/heic","image/heif"]},"byteSize":{"type":"integer","minimum":0,"exclusiveMinimum":true},"updatedAt":{"type":"string","format":"date-time"},"downloadUrl":{"type":"string","minLength":1,"maxLength":2048},"downloadUrlExpiresAt":{"type":"string","format":"date-time"}},"required":["contentType","byteSize","updatedAt","downloadUrl","downloadUrlExpiresAt"],"additionalProperties":false}},"required":["avatar"],"additionalProperties":false}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/uploads/avatar/{uploadId}/finalize":{"post":{"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"uploadId","in":"path"}],"responses":{"200":{"description":"The stored avatar, now published","content":{"application/json":{"schema":{"type":"object","properties":{"avatar":{"type":"object","nullable":true,"properties":{"contentType":{"type":"string","enum":["image/jpeg","image/png","image/heic","image/heif"]},"byteSize":{"type":"integer","minimum":0,"exclusiveMinimum":true},"updatedAt":{"type":"string","format":"date-time"},"downloadUrl":{"type":"string","minLength":1,"maxLength":2048},"downloadUrlExpiresAt":{"type":"string","format":"date-time"}},"required":["contentType","byteSize","updatedAt","downloadUrl","downloadUrlExpiresAt"],"additionalProperties":false}},"required":["avatar"],"additionalProperties":false}}}},"400":{"description":"Invalid upload id","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Upload not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Upload incomplete or rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"410":{"description":"Upload window expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","PAYLOAD_TOO_LARGE","RATE_LIMITED","AUTH_PASSWORD_RESET_INVALID","AUTH_INVITE_INVALID","UPLOAD_NOT_COMPLETED","UPLOAD_REJECTED","UPLOAD_EXPIRED","SERVICE_UNAVAILABLE","ASSISTANT_UNAVAILABLE","INTERNAL_ERROR"]},"message":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"]}}}}}}}}}