{"openapi":"3.0.3","info":{"title":"DofD Server","version":"0.0.1"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{}},"paths":{"/health/live":{"get":{"tags":["health"],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"],"additionalProperties":false}}}}}}},"/health/ready":{"get":{"tags":["health"],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ready"]}},"required":["status"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message","requestId"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/auth/login":{"post":{"operationId":"auth_magic_link_create","summary":"Request a single-use magic link","tags":["authentication"],"description":"Accept a sign-in request without revealing account eligibility. Eligible users receive an emailed single-use link with a 30-minute expiry. No credential is returned. The Origin header must exactly match a configured CORS_ORIGINS entry. return_url is reserved for future use.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"return_url":{"type":"string","maxLength":2048,"format":"uri"}},"required":["email"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":2048},"in":"header","name":"origin","required":true}],"security":[],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/auth/token":{"post":{"operationId":"auth_token_create","summary":"Issue access and refresh tokens","tags":["authentication"],"description":"Consume a stored single-use magic link and replace the user’s refresh token. Expired links return MAGIC_LINK_EXPIRED; invalid and already-used links return INVALID_CREDENTIAL. Access tokens expire in five minutes; refresh tokens expire in 30 days.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":512}},"required":["token"],"additionalProperties":false}}}},"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","minLength":1},"refresh_token":{"type":"string","minLength":1,"maxLength":512},"access_token_expires_at":{"type":"number"},"refresh_token_expires_at":{"type":"number"}},"required":["access_token","refresh_token","access_token_expires_at","refresh_token_expires_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/auth/refresh":{"post":{"operationId":"auth_session_refresh","summary":"Rotate a single-use refresh token","tags":["authentication"],"description":"Atomically consume the current refresh token and issue a replacement with a new 30-day expiry. Reuse is rejected without revoking its replacement. Clients must serialize refresh requests.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"refresh_token":{"type":"string","minLength":1,"maxLength":512}},"required":["refresh_token"],"additionalProperties":false}}}},"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","minLength":1},"refresh_token":{"type":"string","minLength":1,"maxLength":512},"access_token_expires_at":{"type":"number"},"refresh_token_expires_at":{"type":"number"}},"required":["access_token","refresh_token","access_token_expires_at","refresh_token_expires_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/user/":{"get":{"operationId":"user_list","summary":"LIST user","tags":["user"],"description":"Require a super administrator. Return all user summaries, including deactivated users, ordered by ID.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"email":{"nullable":true,"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"first":{"type":"string","minLength":1,"maxLength":200},"last":{"type":"string","minLength":1,"maxLength":200},"id":{"type":"string","minLength":32,"maxLength":32},"has_access":{"type":"boolean"},"avatar_url":{"nullable":true,"type":"string"},"deleted_at":{"nullable":true,"type":"number"}},"required":["email","first","last","id","has_access","deleted_at"],"additionalProperties":false}}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"user_create","summary":"CREATE user","tags":["user"],"description":"Require an administrator in the persisted active organisation or a super administrator. Create the user with the requested initial organisation role and application access. Profiles are created separately. Return the full user including user_profiles.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"nullable":true,"anyOf":[{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","enum":[""]}]},"first":{"type":"string","minLength":1,"maxLength":200},"last":{"type":"string","minLength":1,"maxLength":200},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"role":{"type":"string","enum":["admin","viewer","deal_manager"]}},"required":["first","last","organisation_id","role"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"header","name":"idempotency-key","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"nullable":true,"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"first":{"type":"string","minLength":1,"maxLength":200},"last":{"type":"string","minLength":1,"maxLength":200},"id":{"type":"string","minLength":32,"maxLength":32},"has_access":{"type":"boolean"},"avatar_url":{"nullable":true,"type":"string"},"deleted_at":{"nullable":true,"type":"number"},"roles":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"role":{"type":"string","enum":["admin","viewer","deal_manager"]},"id":{"type":"string","minLength":32,"maxLength":32},"granted_by_user_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"revoked_at":{"nullable":true,"type":"number"}},"required":["user_id","organisation_id","role","id","granted_by_user_id","created_at","created_by","updated_at","revoked_at"],"additionalProperties":false}},"is_super_admin":{"type":"boolean"},"can_deactivate":{"type":"boolean"},"user_profiles":{"type":"array","items":{"type":"object","properties":{"persona":{"type":"string","enum":["investor","founder"]},"bio":{"nullable":true,"type":"string"},"mantra":{"nullable":true,"type":"string"},"location_label":{"nullable":true,"type":"string"},"profile_visible":{"type":"boolean"},"full_name_visible":{"type":"boolean"},"mantra_visible":{"type":"boolean"},"bio_visible":{"type":"boolean"},"avatar_visible":{"type":"boolean"},"location_visible":{"type":"boolean"},"id":{"type":"string","minLength":32,"maxLength":32},"user_id":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["persona","bio","mantra","location_label","profile_visible","full_name_visible","mantra_visible","bio_visible","avatar_visible","location_visible","id","user_id","updated_at"],"additionalProperties":false}},"email_verified_at":{"nullable":true,"type":"number"},"last_login_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["email","first","last","id","has_access","deleted_at","roles","is_super_admin","can_deactivate","user_profiles","email_verified_at","last_login_at","created_at","created_by","updated_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/user/{id}":{"get":{"operationId":"user_read","summary":"GET user","tags":["user"],"description":"Require the bearer subject, a super administrator, or an administrator of an active organisation where the user has an active persisted role. Return the full user including user_profiles with persona, bio, mantra, location, visibility settings, and update timestamp. Organisation administrators receive only roles in organisations they administer.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"nullable":true,"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"first":{"type":"string","minLength":1,"maxLength":200},"last":{"type":"string","minLength":1,"maxLength":200},"id":{"type":"string","minLength":32,"maxLength":32},"has_access":{"type":"boolean"},"avatar_url":{"nullable":true,"type":"string"},"deleted_at":{"nullable":true,"type":"number"},"roles":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"role":{"type":"string","enum":["admin","viewer","deal_manager"]},"id":{"type":"string","minLength":32,"maxLength":32},"granted_by_user_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"revoked_at":{"nullable":true,"type":"number"}},"required":["user_id","organisation_id","role","id","granted_by_user_id","created_at","created_by","updated_at","revoked_at"],"additionalProperties":false}},"is_super_admin":{"type":"boolean"},"can_deactivate":{"type":"boolean"},"user_profiles":{"type":"array","items":{"type":"object","properties":{"persona":{"type":"string","enum":["investor","founder"]},"bio":{"nullable":true,"type":"string"},"mantra":{"nullable":true,"type":"string"},"location_label":{"nullable":true,"type":"string"},"profile_visible":{"type":"boolean"},"full_name_visible":{"type":"boolean"},"mantra_visible":{"type":"boolean"},"bio_visible":{"type":"boolean"},"avatar_visible":{"type":"boolean"},"location_visible":{"type":"boolean"},"id":{"type":"string","minLength":32,"maxLength":32},"user_id":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["persona","bio","mantra","location_label","profile_visible","full_name_visible","mantra_visible","bio_visible","avatar_visible","location_visible","id","user_id","updated_at"],"additionalProperties":false}},"email_verified_at":{"nullable":true,"type":"number"},"last_login_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["email","first","last","id","has_access","deleted_at","roles","is_super_admin","can_deactivate","user_profiles","email_verified_at","last_login_at","created_at","created_by","updated_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"user_update","summary":"UPDATE user","tags":["user"],"description":"Require the bearer subject to match the requested user or a super administrator. Access and administrator flags are server controlled. Return the full updated user including user_profiles.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"nullable":true,"anyOf":[{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","enum":[""]}]},"first":{"nullable":true,"type":"string","minLength":1,"maxLength":200},"last":{"nullable":true,"type":"string","minLength":1,"maxLength":200}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"nullable":true,"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"first":{"type":"string","minLength":1,"maxLength":200},"last":{"type":"string","minLength":1,"maxLength":200},"id":{"type":"string","minLength":32,"maxLength":32},"has_access":{"type":"boolean"},"avatar_url":{"nullable":true,"type":"string"},"deleted_at":{"nullable":true,"type":"number"},"roles":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"role":{"type":"string","enum":["admin","viewer","deal_manager"]},"id":{"type":"string","minLength":32,"maxLength":32},"granted_by_user_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"revoked_at":{"nullable":true,"type":"number"}},"required":["user_id","organisation_id","role","id","granted_by_user_id","created_at","created_by","updated_at","revoked_at"],"additionalProperties":false}},"is_super_admin":{"type":"boolean"},"can_deactivate":{"type":"boolean"},"user_profiles":{"type":"array","items":{"type":"object","properties":{"persona":{"type":"string","enum":["investor","founder"]},"bio":{"nullable":true,"type":"string"},"mantra":{"nullable":true,"type":"string"},"location_label":{"nullable":true,"type":"string"},"profile_visible":{"type":"boolean"},"full_name_visible":{"type":"boolean"},"mantra_visible":{"type":"boolean"},"bio_visible":{"type":"boolean"},"avatar_visible":{"type":"boolean"},"location_visible":{"type":"boolean"},"id":{"type":"string","minLength":32,"maxLength":32},"user_id":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["persona","bio","mantra","location_label","profile_visible","full_name_visible","mantra_visible","bio_visible","avatar_visible","location_visible","id","user_id","updated_at"],"additionalProperties":false}},"email_verified_at":{"nullable":true,"type":"number"},"last_login_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["email","first","last","id","has_access","deleted_at","roles","is_super_admin","can_deactivate","user_profiles","email_verified_at","last_login_at","created_at","created_by","updated_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"user_delete","summary":"DEACTIVATE user","tags":["user"],"description":"Require the user to be active, not be a super administrator or the caller, and require an administrator in every organisation where the user has an active role, or a super administrator. End active roles and deactivate the user atomically. Return the full user.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"nullable":true,"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"first":{"type":"string","minLength":1,"maxLength":200},"last":{"type":"string","minLength":1,"maxLength":200},"id":{"type":"string","minLength":32,"maxLength":32},"has_access":{"type":"boolean"},"avatar_url":{"nullable":true,"type":"string"},"deleted_at":{"nullable":true,"type":"number"},"roles":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"role":{"type":"string","enum":["admin","viewer","deal_manager"]},"id":{"type":"string","minLength":32,"maxLength":32},"granted_by_user_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"revoked_at":{"nullable":true,"type":"number"}},"required":["user_id","organisation_id","role","id","granted_by_user_id","created_at","created_by","updated_at","revoked_at"],"additionalProperties":false}},"is_super_admin":{"type":"boolean"},"can_deactivate":{"type":"boolean"},"user_profiles":{"type":"array","items":{"type":"object","properties":{"persona":{"type":"string","enum":["investor","founder"]},"bio":{"nullable":true,"type":"string"},"mantra":{"nullable":true,"type":"string"},"location_label":{"nullable":true,"type":"string"},"profile_visible":{"type":"boolean"},"full_name_visible":{"type":"boolean"},"mantra_visible":{"type":"boolean"},"bio_visible":{"type":"boolean"},"avatar_visible":{"type":"boolean"},"location_visible":{"type":"boolean"},"id":{"type":"string","minLength":32,"maxLength":32},"user_id":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["persona","bio","mantra","location_label","profile_visible","full_name_visible","mantra_visible","bio_visible","avatar_visible","location_visible","id","user_id","updated_at"],"additionalProperties":false}},"email_verified_at":{"nullable":true,"type":"number"},"last_login_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["email","first","last","id","has_access","deleted_at","roles","is_super_admin","can_deactivate","user_profiles","email_verified_at","last_login_at","created_at","created_by","updated_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/user/{user_id}/role/":{"post":{"operationId":"user_role_create","summary":"CREATE user role","tags":["user"],"description":"Require an administrator in the persisted active organisation or a super administrator. Add a role for the user. Distinct roles may coexist.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"role":{"type":"string","enum":["admin","viewer","deal_manager"]}},"required":["user_id","organisation_id","role"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"user_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"role":{"type":"string","enum":["admin","viewer","deal_manager"]},"id":{"type":"string","minLength":32,"maxLength":32},"granted_by_user_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"revoked_at":{"nullable":true,"type":"number"}},"required":["user_id","organisation_id","role","id","granted_by_user_id","created_at","created_by","updated_at","revoked_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/user/{user_id}/role/{id}":{"patch":{"operationId":"user_role_update","summary":"UPDATE user role","tags":["user"],"description":"Require an administrator in the grant’s persisted active organisation or a super administrator. Change an active grant, preserving the primary owner administrator role.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["admin","viewer","deal_manager"]}},"required":["role"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"user_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"role":{"type":"string","enum":["admin","viewer","deal_manager"]},"id":{"type":"string","minLength":32,"maxLength":32},"granted_by_user_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"revoked_at":{"nullable":true,"type":"number"}},"required":["user_id","organisation_id","role","id","granted_by_user_id","created_at","created_by","updated_at","revoked_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"user_role_delete","summary":"DEACTIVATE user role","tags":["user"],"description":"Require an administrator in the grant’s persisted active organisation or a super administrator. Revoke an active grant and return it.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"user_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"role":{"type":"string","enum":["admin","viewer","deal_manager"]},"id":{"type":"string","minLength":32,"maxLength":32},"granted_by_user_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"revoked_at":{"nullable":true,"type":"number"}},"required":["user_id","organisation_id","role","id","granted_by_user_id","created_at","created_by","updated_at","revoked_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/user/{user_id}/profile/":{"post":{"operationId":"user_profile_create","summary":"CREATE user profile","tags":["user"],"description":"Require the user or a super administrator. Add an investor or founder profile, with at most one profile per persona. Return the full profile.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"persona":{"type":"string","enum":["investor","founder"]},"bio":{"nullable":true,"type":"string","maxLength":20000},"mantra":{"nullable":true,"type":"string","maxLength":500},"location_label":{"nullable":true,"type":"string","maxLength":200},"profile_visible":{"type":"boolean"},"full_name_visible":{"type":"boolean"},"mantra_visible":{"type":"boolean"},"bio_visible":{"type":"boolean"},"avatar_visible":{"type":"boolean"},"location_visible":{"type":"boolean"}},"required":["persona","bio","mantra","location_label","profile_visible","full_name_visible","mantra_visible","bio_visible","avatar_visible","location_visible"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"user_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"persona":{"type":"string","enum":["investor","founder"]},"bio":{"nullable":true,"type":"string"},"mantra":{"nullable":true,"type":"string"},"location_label":{"nullable":true,"type":"string"},"profile_visible":{"type":"boolean"},"full_name_visible":{"type":"boolean"},"mantra_visible":{"type":"boolean"},"bio_visible":{"type":"boolean"},"avatar_visible":{"type":"boolean"},"location_visible":{"type":"boolean"},"id":{"type":"string","minLength":32,"maxLength":32},"user_id":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["persona","bio","mantra","location_label","profile_visible","full_name_visible","mantra_visible","bio_visible","avatar_visible","location_visible","id","user_id","updated_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/user/{user_id}/profile/{id}":{"patch":{"operationId":"user_profile_update","summary":"UPDATE user profile","tags":["user"],"description":"Require the user or a super administrator. Update text and visibility fields on a profile belonging to the parent user. Persona, ownership, IDs, and timestamps are server controlled. Return the full updated profile.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"persona":{"type":"string","enum":["investor","founder"]},"bio":{"nullable":true,"type":"string","maxLength":20000},"mantra":{"nullable":true,"type":"string","maxLength":500},"location_label":{"nullable":true,"type":"string","maxLength":200},"profile_visible":{"type":"boolean"},"full_name_visible":{"type":"boolean"},"mantra_visible":{"type":"boolean"},"bio_visible":{"type":"boolean"},"avatar_visible":{"type":"boolean"},"location_visible":{"type":"boolean"}},"required":["persona","bio","mantra","location_label","profile_visible","full_name_visible","mantra_visible","bio_visible","avatar_visible","location_visible"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"user_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"persona":{"type":"string","enum":["investor","founder"]},"bio":{"nullable":true,"type":"string"},"mantra":{"nullable":true,"type":"string"},"location_label":{"nullable":true,"type":"string"},"profile_visible":{"type":"boolean"},"full_name_visible":{"type":"boolean"},"mantra_visible":{"type":"boolean"},"bio_visible":{"type":"boolean"},"avatar_visible":{"type":"boolean"},"location_visible":{"type":"boolean"},"id":{"type":"string","minLength":32,"maxLength":32},"user_id":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["persona","bio","mantra","location_label","profile_visible","full_name_visible","mantra_visible","bio_visible","avatar_visible","location_visible","id","user_id","updated_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/user/{user_id}/avatar/":{"post":{"operationId":"user_avatar_create","summary":"CREATE user avatar","tags":["user"],"description":"Require the user or a super administrator. Upload a JPEG, PNG, or WebP image as base64 JSON, up to 2 MiB decoded. Store the original bytes in public blob storage, replace the current avatar, and return the full user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"filename":{"type":"string","minLength":1,"maxLength":256},"mime_type":{"type":"string"},"file_data":{"type":"string","maxLength":2796204,"format":"base64","pattern":"^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$","description":"Base64-encoded image contents, without a data URL prefix (maximum 2 MiB decoded)."},"source_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"deal_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["title","filename","mime_type","file_data"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"user_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"nullable":true,"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"first":{"type":"string","minLength":1,"maxLength":200},"last":{"type":"string","minLength":1,"maxLength":200},"id":{"type":"string","minLength":32,"maxLength":32},"has_access":{"type":"boolean"},"avatar_url":{"nullable":true,"type":"string"},"deleted_at":{"nullable":true,"type":"number"},"roles":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"role":{"type":"string","enum":["admin","viewer","deal_manager"]},"id":{"type":"string","minLength":32,"maxLength":32},"granted_by_user_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"revoked_at":{"nullable":true,"type":"number"}},"required":["user_id","organisation_id","role","id","granted_by_user_id","created_at","created_by","updated_at","revoked_at"],"additionalProperties":false}},"is_super_admin":{"type":"boolean"},"can_deactivate":{"type":"boolean"},"user_profiles":{"type":"array","items":{"type":"object","properties":{"persona":{"type":"string","enum":["investor","founder"]},"bio":{"nullable":true,"type":"string"},"mantra":{"nullable":true,"type":"string"},"location_label":{"nullable":true,"type":"string"},"profile_visible":{"type":"boolean"},"full_name_visible":{"type":"boolean"},"mantra_visible":{"type":"boolean"},"bio_visible":{"type":"boolean"},"avatar_visible":{"type":"boolean"},"location_visible":{"type":"boolean"},"id":{"type":"string","minLength":32,"maxLength":32},"user_id":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["persona","bio","mantra","location_label","profile_visible","full_name_visible","mantra_visible","bio_visible","avatar_visible","location_visible","id","user_id","updated_at"],"additionalProperties":false}},"email_verified_at":{"nullable":true,"type":"number"},"last_login_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["email","first","last","id","has_access","deleted_at","roles","is_super_admin","can_deactivate","user_profiles","email_verified_at","last_login_at","created_at","created_by","updated_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/":{"get":{"operationId":"organisation_list","summary":"LIST organisation","tags":["organisation"],"description":"Return an array of organisation summaries ordered by ID. The default mine pool uses existing organisation grants; super administrators see all organisations, including deactivated ones. The venture pool requires an investor persona, and the investor pool requires a founder persona; super administrators can browse both. Discovery pools return only active, visible organisations and published fields, with no owner ID.","parameters":[{"schema":{"default":"mine","type":"string","enum":["venture","investor","mine"]},"in":"query","name":"pool","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"type":{"type":"string","enum":["platform","investor","venture","lp_account"]},"slug":{"type":"string"},"trading_name":{"nullable":true,"type":"string"},"logo_url":{"nullable":true,"type":"string"},"visible":{"type":"boolean"},"primary_owner":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"deleted_at":{"nullable":true,"type":"number"},"website_url":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"mission_statement":{"nullable":true,"type":"string"},"vision_statement":{"nullable":true,"type":"string"},"summary":{"nullable":true,"type":"string"},"organisation_stage":{"nullable":true,"type":"string"},"legal_structure":{"nullable":true,"type":"string"},"incorporation_country_code":{"nullable":true,"type":"string"}},"required":["id","type","slug","trading_name","logo_url","visible","primary_owner","deleted_at","website_url","description","mission_statement","vision_statement","summary","organisation_stage","legal_structure","incorporation_country_code"],"additionalProperties":false}}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"organisation_create","summary":"CREATE organisation","tags":["organisation"],"description":"Require a platform administrator. Generate optional profile details through Azure AI Foundry, keeping the organisation private by default. If enrichment fails, create it with the submitted values. When a website URL is submitted, discover and sequentially capture up to three About, Product, or Services pages as sources, falling back to the supplied URL when discovery fails or finds no suitable pages. Enqueue discovered webpage requests and return after saving the enriched organisation; capture and extraction run in the background. Derive created_by and timestamps from the caller and server, and assign the primary owner an organisation_owner role.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trading_name":{"type":"string","minLength":1},"type":{"type":"string","enum":["platform","investor","venture","lp_account"]},"website_url":{"nullable":true,"anyOf":[{"type":"string","format":"uri"},{"type":"string","enum":[""]}]},"primary_owner":{"type":"string","minLength":32,"maxLength":32},"slug":{"type":"string","minLength":1}},"required":["trading_name","type","website_url","primary_owner","slug"],"additionalProperties":false}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"type":{"type":"string","enum":["platform","investor","venture","lp_account"]},"slug":{"type":"string"},"trading_name":{"nullable":true,"type":"string"},"logo_url":{"nullable":true,"type":"string"},"visible":{"type":"boolean"},"primary_owner":{"type":"string","minLength":32,"maxLength":32},"deleted_at":{"nullable":true,"type":"number"},"website_url":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"mission_statement":{"nullable":true,"type":"string"},"vision_statement":{"nullable":true,"type":"string"},"summary":{"nullable":true,"type":"string"},"organisation_stage":{"nullable":true,"type":"string"},"legal_structure":{"nullable":true,"type":"string"},"incorporation_country_code":{"nullable":true,"type":"string"},"legal_name":{"nullable":true,"type":"string"},"trading_name_visible":{"type":"boolean"},"website_url_visible":{"type":"boolean"},"logo_url_visible":{"type":"boolean"},"description_visible":{"type":"boolean"},"mission_statement_visible":{"type":"boolean"},"vision_statement_visible":{"type":"boolean"},"summary_visible":{"type":"boolean"},"organisation_stage_visible":{"type":"boolean"},"legal_structure_visible":{"type":"boolean"},"incorporation_country_code_visible":{"type":"boolean"},"impact_zones":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"impact_zone":{"type":"string","minLength":1,"maxLength":128},"sector":{"type":"string","minLength":1,"maxLength":128},"attribute":{"type":"string","minLength":1,"maxLength":128},"color":{"nullable":true,"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"sort_order":{"type":"integer","minimum":0,"maximum":1000000},"id":{"type":"string","minLength":32,"maxLength":32},"is_active":{"type":"boolean"},"created_at":{"type":"number"},"updated_at":{"type":"number"}},"required":["code","impact_zone","sector","attribute","color","sort_order","id","is_active","created_at","updated_at"],"additionalProperties":false}},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["id","type","slug","trading_name","logo_url","visible","primary_owner","deleted_at","website_url","description","mission_statement","vision_statement","summary","organisation_stage","legal_structure","incorporation_country_code","legal_name","trading_name_visible","website_url_visible","logo_url_visible","description_visible","mission_statement_visible","vision_statement_visible","summary_visible","organisation_stage_visible","legal_structure_visible","incorporation_country_code_visible","impact_zones","created_at","created_by","updated_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{id}":{"get":{"operationId":"organisation_read","summary":"GET organisation","tags":["organisation"],"description":"Require an active role in the owning organisation or platform administrator authority. Return the full organisation.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"type":{"type":"string","enum":["platform","investor","venture","lp_account"]},"slug":{"type":"string"},"trading_name":{"nullable":true,"type":"string"},"logo_url":{"nullable":true,"type":"string"},"visible":{"type":"boolean"},"primary_owner":{"type":"string","minLength":32,"maxLength":32},"deleted_at":{"nullable":true,"type":"number"},"website_url":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"mission_statement":{"nullable":true,"type":"string"},"vision_statement":{"nullable":true,"type":"string"},"summary":{"nullable":true,"type":"string"},"organisation_stage":{"nullable":true,"type":"string"},"legal_structure":{"nullable":true,"type":"string"},"incorporation_country_code":{"nullable":true,"type":"string"},"legal_name":{"nullable":true,"type":"string"},"trading_name_visible":{"type":"boolean"},"website_url_visible":{"type":"boolean"},"logo_url_visible":{"type":"boolean"},"description_visible":{"type":"boolean"},"mission_statement_visible":{"type":"boolean"},"vision_statement_visible":{"type":"boolean"},"summary_visible":{"type":"boolean"},"organisation_stage_visible":{"type":"boolean"},"legal_structure_visible":{"type":"boolean"},"incorporation_country_code_visible":{"type":"boolean"},"impact_zones":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"impact_zone":{"type":"string","minLength":1,"maxLength":128},"sector":{"type":"string","minLength":1,"maxLength":128},"attribute":{"type":"string","minLength":1,"maxLength":128},"color":{"nullable":true,"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"sort_order":{"type":"integer","minimum":0,"maximum":1000000},"id":{"type":"string","minLength":32,"maxLength":32},"is_active":{"type":"boolean"},"created_at":{"type":"number"},"updated_at":{"type":"number"}},"required":["code","impact_zone","sector","attribute","color","sort_order","id","is_active","created_at","updated_at"],"additionalProperties":false}},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["id","type","slug","trading_name","logo_url","visible","primary_owner","deleted_at","website_url","description","mission_statement","vision_statement","summary","organisation_stage","legal_structure","incorporation_country_code","legal_name","trading_name_visible","website_url_visible","logo_url_visible","description_visible","mission_statement_visible","vision_statement_visible","summary_visible","organisation_stage_visible","legal_structure_visible","incorporation_country_code_visible","impact_zones","created_at","created_by","updated_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"organisation_update","summary":"UPDATE organisation","tags":["organisation"],"description":"Require organisation administrator or platform administrator authority. Update organisation details and replace its complete Impact Zone selection with the supplied attribute IDs (existing inactive assignments may be retained). Return the full updated organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trading_name":{"type":"string","minLength":1},"type":{"type":"string","enum":["platform","investor","venture","lp_account"]},"website_url":{"nullable":true,"anyOf":[{"type":"string","format":"uri"},{"type":"string","enum":[""]}]},"primary_owner":{"type":"string","minLength":32,"maxLength":32},"slug":{"type":"string","minLength":1},"id":{"type":"string","minLength":32,"maxLength":32},"legal_name":{"nullable":true,"type":"string"},"logo_url":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"mission_statement":{"nullable":true,"type":"string"},"vision_statement":{"nullable":true,"type":"string"},"summary":{"nullable":true,"type":"string"},"organisation_stage":{"nullable":true,"type":"string"},"legal_structure":{"nullable":true,"type":"string"},"incorporation_country_code":{"nullable":true,"type":"string"},"trading_name_visible":{"type":"boolean"},"website_url_visible":{"type":"boolean"},"logo_url_visible":{"type":"boolean"},"description_visible":{"type":"boolean"},"mission_statement_visible":{"type":"boolean"},"vision_statement_visible":{"type":"boolean"},"summary_visible":{"type":"boolean"},"organisation_stage_visible":{"type":"boolean"},"legal_structure_visible":{"type":"boolean"},"incorporation_country_code_visible":{"type":"boolean"},"visible":{"type":"boolean"},"impact_zone_ids":{"type":"array","items":{"type":"string","minLength":32,"maxLength":32}}},"required":["trading_name","type","website_url","primary_owner","slug","id","legal_name","logo_url","description","mission_statement","vision_statement","summary","organisation_stage","legal_structure","incorporation_country_code","trading_name_visible","website_url_visible","logo_url_visible","description_visible","mission_statement_visible","vision_statement_visible","summary_visible","organisation_stage_visible","legal_structure_visible","incorporation_country_code_visible","visible","impact_zone_ids"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"type":{"type":"string","enum":["platform","investor","venture","lp_account"]},"slug":{"type":"string"},"trading_name":{"nullable":true,"type":"string"},"logo_url":{"nullable":true,"type":"string"},"visible":{"type":"boolean"},"primary_owner":{"type":"string","minLength":32,"maxLength":32},"deleted_at":{"nullable":true,"type":"number"},"website_url":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"mission_statement":{"nullable":true,"type":"string"},"vision_statement":{"nullable":true,"type":"string"},"summary":{"nullable":true,"type":"string"},"organisation_stage":{"nullable":true,"type":"string"},"legal_structure":{"nullable":true,"type":"string"},"incorporation_country_code":{"nullable":true,"type":"string"},"legal_name":{"nullable":true,"type":"string"},"trading_name_visible":{"type":"boolean"},"website_url_visible":{"type":"boolean"},"logo_url_visible":{"type":"boolean"},"description_visible":{"type":"boolean"},"mission_statement_visible":{"type":"boolean"},"vision_statement_visible":{"type":"boolean"},"summary_visible":{"type":"boolean"},"organisation_stage_visible":{"type":"boolean"},"legal_structure_visible":{"type":"boolean"},"incorporation_country_code_visible":{"type":"boolean"},"impact_zones":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"impact_zone":{"type":"string","minLength":1,"maxLength":128},"sector":{"type":"string","minLength":1,"maxLength":128},"attribute":{"type":"string","minLength":1,"maxLength":128},"color":{"nullable":true,"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"sort_order":{"type":"integer","minimum":0,"maximum":1000000},"id":{"type":"string","minLength":32,"maxLength":32},"is_active":{"type":"boolean"},"created_at":{"type":"number"},"updated_at":{"type":"number"}},"required":["code","impact_zone","sector","attribute","color","sort_order","id","is_active","created_at","updated_at"],"additionalProperties":false}},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["id","type","slug","trading_name","logo_url","visible","primary_owner","deleted_at","website_url","description","mission_statement","vision_statement","summary","organisation_stage","legal_structure","incorporation_country_code","legal_name","trading_name_visible","website_url_visible","logo_url_visible","description_visible","mission_statement_visible","vision_statement_visible","summary_visible","organisation_stage_visible","legal_structure_visible","incorporation_country_code_visible","impact_zones","created_at","created_by","updated_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"organisation_delete","summary":"DEACTIVATE organisation","tags":["organisation"],"description":"Require an active role in the owning organisation or platform administrator authority. Soft-deactivate the organisation and return the full updated organisation.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"type":{"type":"string","enum":["platform","investor","venture","lp_account"]},"slug":{"type":"string"},"trading_name":{"nullable":true,"type":"string"},"logo_url":{"nullable":true,"type":"string"},"visible":{"type":"boolean"},"primary_owner":{"type":"string","minLength":32,"maxLength":32},"deleted_at":{"nullable":true,"type":"number"},"website_url":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"mission_statement":{"nullable":true,"type":"string"},"vision_statement":{"nullable":true,"type":"string"},"summary":{"nullable":true,"type":"string"},"organisation_stage":{"nullable":true,"type":"string"},"legal_structure":{"nullable":true,"type":"string"},"incorporation_country_code":{"nullable":true,"type":"string"},"legal_name":{"nullable":true,"type":"string"},"trading_name_visible":{"type":"boolean"},"website_url_visible":{"type":"boolean"},"logo_url_visible":{"type":"boolean"},"description_visible":{"type":"boolean"},"mission_statement_visible":{"type":"boolean"},"vision_statement_visible":{"type":"boolean"},"summary_visible":{"type":"boolean"},"organisation_stage_visible":{"type":"boolean"},"legal_structure_visible":{"type":"boolean"},"incorporation_country_code_visible":{"type":"boolean"},"impact_zones":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"impact_zone":{"type":"string","minLength":1,"maxLength":128},"sector":{"type":"string","minLength":1,"maxLength":128},"attribute":{"type":"string","minLength":1,"maxLength":128},"color":{"nullable":true,"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"sort_order":{"type":"integer","minimum":0,"maximum":1000000},"id":{"type":"string","minLength":32,"maxLength":32},"is_active":{"type":"boolean"},"created_at":{"type":"number"},"updated_at":{"type":"number"}},"required":["code","impact_zone","sector","attribute","color","sort_order","id","is_active","created_at","updated_at"],"additionalProperties":false}},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"}},"required":["id","type","slug","trading_name","logo_url","visible","primary_owner","deleted_at","website_url","description","mission_statement","vision_statement","summary","organisation_stage","legal_structure","incorporation_country_code","legal_name","trading_name_visible","website_url_visible","logo_url_visible","description_visible","mission_statement_visible","vision_statement_visible","summary_visible","organisation_stage_visible","legal_structure_visible","incorporation_country_code_visible","impact_zones","created_at","created_by","updated_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/user/":{"get":{"operationId":"organisation_user_list","summary":"LIST organisation user","tags":["organisation"],"description":"Require an active organisation role. Return users with active grants in this organisation.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"email":{"nullable":true,"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"first":{"type":"string","minLength":1,"maxLength":200},"last":{"type":"string","minLength":1,"maxLength":200},"id":{"type":"string","minLength":32,"maxLength":32},"has_access":{"type":"boolean"},"avatar_url":{"nullable":true,"type":"string"},"deleted_at":{"nullable":true,"type":"number"},"roles":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"role":{"type":"string","enum":["admin","viewer","deal_manager"]},"id":{"type":"string","minLength":32,"maxLength":32},"granted_by_user_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"revoked_at":{"nullable":true,"type":"number"}},"required":["user_id","organisation_id","role","id","granted_by_user_id","created_at","created_by","updated_at","revoked_at"],"additionalProperties":false}}},"required":["email","first","last","id","has_access","deleted_at","roles"],"additionalProperties":false}}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/impact-zone/":{"get":{"operationId":"impact_zone_list","summary":"LIST Impact Zone","tags":["impact-zone"],"description":"Require an active organisation role or a super administrator. Return active attributes; super administrators can also see inactive attributes.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"impact_zone":{"type":"string","minLength":1,"maxLength":128},"sector":{"type":"string","minLength":1,"maxLength":128},"attribute":{"type":"string","minLength":1,"maxLength":128},"color":{"nullable":true,"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"sort_order":{"type":"integer","minimum":0,"maximum":1000000},"id":{"type":"string","minLength":32,"maxLength":32},"is_active":{"type":"boolean"},"created_at":{"type":"number"},"updated_at":{"type":"number"}},"required":["code","impact_zone","sector","attribute","color","sort_order","id","is_active","created_at","updated_at"],"additionalProperties":false}}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"impact_zone_create","summary":"CREATE Impact Zone","tags":["impact-zone"],"description":"Require a super administrator. Create a selectable attribute with impact zone and sector labels. Return the full Impact Zone.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"impact_zone":{"type":"string","minLength":1,"maxLength":128},"sector":{"type":"string","minLength":1,"maxLength":128},"attribute":{"type":"string","minLength":1,"maxLength":128},"color":{"nullable":true,"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"sort_order":{"type":"integer","minimum":0,"maximum":1000000}},"required":["code","impact_zone","sector","attribute","color","sort_order"],"additionalProperties":false}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"impact_zone":{"type":"string","minLength":1,"maxLength":128},"sector":{"type":"string","minLength":1,"maxLength":128},"attribute":{"type":"string","minLength":1,"maxLength":128},"color":{"nullable":true,"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"sort_order":{"type":"integer","minimum":0,"maximum":1000000},"id":{"type":"string","minLength":32,"maxLength":32},"is_active":{"type":"boolean"},"created_at":{"type":"number"},"updated_at":{"type":"number"}},"required":["code","impact_zone","sector","attribute","color","sort_order","id","is_active","created_at","updated_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/impact-zone/{id}":{"get":{"operationId":"impact_zone_read","summary":"GET Impact Zone","tags":["impact-zone"],"description":"Require an active organisation role or a super administrator. Return the full active Impact Zone. Super administrators can also read inactive attributes.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"impact_zone":{"type":"string","minLength":1,"maxLength":128},"sector":{"type":"string","minLength":1,"maxLength":128},"attribute":{"type":"string","minLength":1,"maxLength":128},"color":{"nullable":true,"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"sort_order":{"type":"integer","minimum":0,"maximum":1000000},"id":{"type":"string","minLength":32,"maxLength":32},"is_active":{"type":"boolean"},"created_at":{"type":"number"},"updated_at":{"type":"number"}},"required":["code","impact_zone","sector","attribute","color","sort_order","id","is_active","created_at","updated_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"impact_zone_update","summary":"UPDATE Impact Zone","tags":["impact-zone"],"description":"Require a super administrator. Update supplied Impact Zone fields. Zone names/colours and sector renames apply to their whole group. Return the full updated Impact Zone.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"impact_zone":{"type":"string","minLength":1,"maxLength":128},"sector":{"type":"string","minLength":1,"maxLength":128},"attribute":{"type":"string","minLength":1,"maxLength":128},"color":{"nullable":true,"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"sort_order":{"type":"integer","minimum":0,"maximum":1000000},"is_active":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"impact_zone":{"type":"string","minLength":1,"maxLength":128},"sector":{"type":"string","minLength":1,"maxLength":128},"attribute":{"type":"string","minLength":1,"maxLength":128},"color":{"nullable":true,"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"sort_order":{"type":"integer","minimum":0,"maximum":1000000},"id":{"type":"string","minLength":32,"maxLength":32},"is_active":{"type":"boolean"},"created_at":{"type":"number"},"updated_at":{"type":"number"}},"required":["code","impact_zone","sector","attribute","color","sort_order","id","is_active","created_at","updated_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/source/":{"get":{"operationId":"source_list","summary":"LIST source","tags":["source"],"description":"Require a viewer role in the organisation. Return all active source summaries as an array.","parameters":[{"schema":{"type":"string","enum":["document","webpage","note"]},"in":"query","name":"source_type","required":false},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_type":{"type":"string","enum":["document","webpage","note"]},"original_url":{"nullable":true,"type":"string"},"title":{"type":"string"},"description":{"type":"string","maxLength":512},"current_version":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"}},"required":["id","organisation_id","source_type","original_url","title","description","current_version","created_at","created_by","updated_at","deleted_at"],"additionalProperties":false}}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"source_create","summary":"CREATE source","tags":["source"],"description":"Require deal manager access. Upload a document, capture one webpage URL, or author a Markdown Note. Return an existing identical document or webpage URL (200), or create a source/version (201). Return the full source.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"source_type":{"type":"string","enum":["document"]},"title":{"type":"string"},"filename":{"type":"string","minLength":1,"maxLength":256},"mime_type":{"type":"string"},"file_data":{"type":"string","maxLength":34952536,"format":"base64","pattern":"^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$","description":"Base64-encoded file contents, without a data URL prefix (maximum 25 MiB decoded)."},"source_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"deal_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["source_type","title","filename","mime_type","file_data"],"additionalProperties":false},{"type":"object","properties":{"source_type":{"type":"string","enum":["webpage"]},"original_url":{"type":"string","minLength":1,"maxLength":2048}},"required":["source_type","original_url"],"additionalProperties":false},{"type":"object","properties":{"source_type":{"type":"string","enum":["note"]},"title":{"type":"string","minLength":1,"maxLength":256},"markdown":{"type":"string"}},"required":["source_type","title","markdown"],"additionalProperties":false}]}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_type":{"type":"string","enum":["document","webpage","note"]},"original_url":{"nullable":true,"type":"string"},"title":{"type":"string"},"description":{"type":"string","maxLength":512},"current_version":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"},"markdown":{"nullable":true,"type":"string"},"finding_versions":{"type":"array","items":{"type":"object","properties":{"previous_finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"id":{"type":"string","minLength":32,"maxLength":32},"finding_id":{"type":"string","minLength":32,"maxLength":32},"source_version_id":{"type":"string","minLength":32,"maxLength":32},"finding_text":{"nullable":true,"type":"string","minLength":1},"subjectivity_score":{"type":"number","minimum":0,"maximum":1},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Extraction pipeline version captured when the finding version was created."},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"source_text_verbatim":{"type":"string","minLength":1,"maxLength":6000},"source_start_line":{"type":"integer","minimum":1,"maximum":2147483647},"source_end_line":{"type":"integer","minimum":1,"maximum":2147483647},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"finding_name":{"type":"string","minLength":1}},"required":["previous_finding_version_id","id","finding_id","source_version_id","finding_text","subjectivity_score","ingestion_version","retired_at","created_at","source_text_verbatim","source_start_line","source_end_line","created_by","finding_name"],"additionalProperties":false}},"versions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false}}},"required":["id","organisation_id","source_type","original_url","title","description","current_version","created_at","created_by","updated_at","deleted_at","markdown","finding_versions","versions"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_type":{"type":"string","enum":["document","webpage","note"]},"original_url":{"nullable":true,"type":"string"},"title":{"type":"string"},"description":{"type":"string","maxLength":512},"current_version":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"},"markdown":{"nullable":true,"type":"string"},"finding_versions":{"type":"array","items":{"type":"object","properties":{"previous_finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"id":{"type":"string","minLength":32,"maxLength":32},"finding_id":{"type":"string","minLength":32,"maxLength":32},"source_version_id":{"type":"string","minLength":32,"maxLength":32},"finding_text":{"nullable":true,"type":"string","minLength":1},"subjectivity_score":{"type":"number","minimum":0,"maximum":1},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Extraction pipeline version captured when the finding version was created."},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"source_text_verbatim":{"type":"string","minLength":1,"maxLength":6000},"source_start_line":{"type":"integer","minimum":1,"maximum":2147483647},"source_end_line":{"type":"integer","minimum":1,"maximum":2147483647},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"finding_name":{"type":"string","minLength":1}},"required":["previous_finding_version_id","id","finding_id","source_version_id","finding_text","subjectivity_score","ingestion_version","retired_at","created_at","source_text_verbatim","source_start_line","source_end_line","created_by","finding_name"],"additionalProperties":false}},"versions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false}}},"required":["id","organisation_id","source_type","original_url","title","description","current_version","created_at","created_by","updated_at","deleted_at","markdown","finding_versions","versions"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/source/{id}":{"get":{"operationId":"source_read","summary":"GET source","tags":["source"],"description":"Require viewer access to the URL organisation and verify the source belongs to it. Return full source metadata, all file versions, and findings from only the current source version.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_type":{"type":"string","enum":["document","webpage","note"]},"original_url":{"nullable":true,"type":"string"},"title":{"type":"string"},"description":{"type":"string","maxLength":512},"current_version":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"},"markdown":{"nullable":true,"type":"string"},"finding_versions":{"type":"array","items":{"type":"object","properties":{"previous_finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"id":{"type":"string","minLength":32,"maxLength":32},"finding_id":{"type":"string","minLength":32,"maxLength":32},"source_version_id":{"type":"string","minLength":32,"maxLength":32},"finding_text":{"nullable":true,"type":"string","minLength":1},"subjectivity_score":{"type":"number","minimum":0,"maximum":1},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Extraction pipeline version captured when the finding version was created."},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"source_text_verbatim":{"type":"string","minLength":1,"maxLength":6000},"source_start_line":{"type":"integer","minimum":1,"maximum":2147483647},"source_end_line":{"type":"integer","minimum":1,"maximum":2147483647},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"finding_name":{"type":"string","minLength":1}},"required":["previous_finding_version_id","id","finding_id","source_version_id","finding_text","subjectivity_score","ingestion_version","retired_at","created_at","source_text_verbatim","source_start_line","source_end_line","created_by","finding_name"],"additionalProperties":false}},"versions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false}}},"required":["id","organisation_id","source_type","original_url","title","description","current_version","created_at","created_by","updated_at","deleted_at","markdown","finding_versions","versions"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"source_update","summary":"UPDATE source","tags":["source"],"description":"Require deal manager access to edit an organisation Note. Save a new source version using the supplied Note content and expected current version ID. Return the full source.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_type":{"type":"string","enum":["note"]},"title":{"type":"string","minLength":1,"maxLength":256},"markdown":{"type":"string"},"expected_current_version_id":{"type":"string","minLength":32,"maxLength":32}},"required":["source_type","title","markdown","expected_current_version_id"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_type":{"type":"string","enum":["document","webpage","note"]},"original_url":{"nullable":true,"type":"string"},"title":{"type":"string"},"description":{"type":"string","maxLength":512},"current_version":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"},"markdown":{"nullable":true,"type":"string"},"finding_versions":{"type":"array","items":{"type":"object","properties":{"previous_finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"id":{"type":"string","minLength":32,"maxLength":32},"finding_id":{"type":"string","minLength":32,"maxLength":32},"source_version_id":{"type":"string","minLength":32,"maxLength":32},"finding_text":{"nullable":true,"type":"string","minLength":1},"subjectivity_score":{"type":"number","minimum":0,"maximum":1},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Extraction pipeline version captured when the finding version was created."},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"source_text_verbatim":{"type":"string","minLength":1,"maxLength":6000},"source_start_line":{"type":"integer","minimum":1,"maximum":2147483647},"source_end_line":{"type":"integer","minimum":1,"maximum":2147483647},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"finding_name":{"type":"string","minLength":1}},"required":["previous_finding_version_id","id","finding_id","source_version_id","finding_text","subjectivity_score","ingestion_version","retired_at","created_at","source_text_verbatim","source_start_line","source_end_line","created_by","finding_name"],"additionalProperties":false}},"versions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false}}},"required":["id","organisation_id","source_type","original_url","title","description","current_version","created_at","created_by","updated_at","deleted_at","markdown","finding_versions","versions"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/source/{id}/regenerate":{"post":{"operationId":"source_regenerate","summary":"Regenerate source findings","tags":["source"],"description":"Require deal manager access to the persisted owning organisation. Resolve the current saved version on the server, retry failed extraction or regenerate existing findings, and reject extraction already in progress. Return the full source. No request body or version ID is required.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_type":{"type":"string","enum":["document","webpage","note"]},"original_url":{"nullable":true,"type":"string"},"title":{"type":"string"},"description":{"type":"string","maxLength":512},"current_version":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"},"markdown":{"nullable":true,"type":"string"},"finding_versions":{"type":"array","items":{"type":"object","properties":{"previous_finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"id":{"type":"string","minLength":32,"maxLength":32},"finding_id":{"type":"string","minLength":32,"maxLength":32},"source_version_id":{"type":"string","minLength":32,"maxLength":32},"finding_text":{"nullable":true,"type":"string","minLength":1},"subjectivity_score":{"type":"number","minimum":0,"maximum":1},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Extraction pipeline version captured when the finding version was created."},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"source_text_verbatim":{"type":"string","minLength":1,"maxLength":6000},"source_start_line":{"type":"integer","minimum":1,"maximum":2147483647},"source_end_line":{"type":"integer","minimum":1,"maximum":2147483647},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"finding_name":{"type":"string","minLength":1}},"required":["previous_finding_version_id","id","finding_id","source_version_id","finding_text","subjectivity_score","ingestion_version","retired_at","created_at","source_text_verbatim","source_start_line","source_end_line","created_by","finding_name"],"additionalProperties":false}},"versions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false}}},"required":["id","organisation_id","source_type","original_url","title","description","current_version","created_at","created_by","updated_at","deleted_at","markdown","finding_versions","versions"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/source/{id}/rescan":{"post":{"operationId":"source_rescan","summary":"Rescan source webpage","tags":["source"],"description":"Require deal manager access to the persisted owning organisation and a webpage source belonging to it. Capture the saved URL into a new version, retire previous evidence after saving final Markdown, and extract findings. Return the full source.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_type":{"type":"string","enum":["document","webpage","note"]},"original_url":{"nullable":true,"type":"string"},"title":{"type":"string"},"description":{"type":"string","maxLength":512},"current_version":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"},"markdown":{"nullable":true,"type":"string"},"finding_versions":{"type":"array","items":{"type":"object","properties":{"previous_finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"id":{"type":"string","minLength":32,"maxLength":32},"finding_id":{"type":"string","minLength":32,"maxLength":32},"source_version_id":{"type":"string","minLength":32,"maxLength":32},"finding_text":{"nullable":true,"type":"string","minLength":1},"subjectivity_score":{"type":"number","minimum":0,"maximum":1},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Extraction pipeline version captured when the finding version was created."},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"source_text_verbatim":{"type":"string","minLength":1,"maxLength":6000},"source_start_line":{"type":"integer","minimum":1,"maximum":2147483647},"source_end_line":{"type":"integer","minimum":1,"maximum":2147483647},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"finding_name":{"type":"string","minLength":1}},"required":["previous_finding_version_id","id","finding_id","source_version_id","finding_text","subjectivity_score","ingestion_version","retired_at","created_at","source_text_verbatim","source_start_line","source_end_line","created_by","finding_name"],"additionalProperties":false}},"versions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false}}},"required":["id","organisation_id","source_type","original_url","title","description","current_version","created_at","created_by","updated_at","deleted_at","markdown","finding_versions","versions"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/source/{source_id}/version/{id}/file":{"get":{"operationId":"source_version_file_read","summary":"GET source version file","tags":["source"],"description":"Require viewer access to the URL organisation and verify the source and version belong to it. Return the original file as JSON with filename, mime_type, and base64-encoded file_data.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"source_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string"},"mime_type":{"type":"string"},"file_data":{"type":"string","format":"base64","pattern":"^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$","description":"Base64-encoded file contents, without a data URL prefix."}},"required":["filename","mime_type","file_data"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/source/{source_id}/version/{id}/markdown":{"get":{"operationId":"source_version_markdown_read","summary":"GET source version Markdown","tags":["source"],"description":"Require viewer access to the URL organisation and verify the source and version belong to it. Return the extracted UTF-8 Markdown as JSON with filename, mime_type, and base64-encoded file_data.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"source_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string"},"mime_type":{"type":"string"},"file_data":{"type":"string","format":"base64","pattern":"^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$","description":"Base64-encoded file contents, without a data URL prefix."}},"required":["filename","mime_type","file_data"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/memo/":{"get":{"operationId":"memo_list","summary":"LIST memo","tags":["memo"],"description":"Return active memos owned by the requesting organisation whose target organisation the caller can view. Optional organisation_id filters by target organisation.","parameters":[{"schema":{"type":"string","enum":["stale","queued","processing","completed","no_usable_memo","failed"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"query","name":"organisation_id","required":false},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"target_organisation_id":{"type":"string","minLength":32,"maxLength":32},"requesting_organisation_id":{"type":"string","minLength":32,"maxLength":32},"status":{"type":"string","enum":["stale","queued","processing","completed","no_usable_memo","failed"]},"created_at":{"type":"number"},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"}},"required":["id","target_organisation_id","requesting_organisation_id","status","created_at","updated_at","deleted_at"],"additionalProperties":false}}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"memo_create","summary":"CREATE memo","tags":["memo"],"description":"Create a memo under the requesting organisation and queue body-section generation, followed by a separate summary task. Requires Deal Manager access to the requester and Viewer access to the target.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target_organisation_id":{"type":"string","minLength":32,"maxLength":32}},"required":["target_organisation_id"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"target_organisation_id":{"type":"string","minLength":32,"maxLength":32},"requesting_organisation_id":{"type":"string","minLength":32,"maxLength":32},"status":{"type":"string","enum":["stale","queued","processing","completed","no_usable_memo","failed"]},"created_at":{"type":"number"},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"},"extraction_inputs":{"description":"Per-source outcomes returned after the extraction phase.","type":"array","items":{"type":"object","properties":{"source_version_id":{"type":"string","minLength":32,"maxLength":32},"status":{"type":"string","enum":["completed","empty","omitted"]},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"failure_code":{"nullable":true,"type":"string","enum":["INVALID_AI_OUTPUT","AI_TIMEOUT","AI_RATE_LIMITED","AI_UNAVAILABLE"]}},"required":["source_version_id","status","finding_count","failure_code"],"additionalProperties":false}},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"readOnly":true,"description":"Server-defined AI processing version used by the most recently started memo phase. 0 means processing has not started. Reruns with the same AI pipeline retain the same version."},"started_at":{"nullable":true,"type":"number"},"completed_at":{"nullable":true,"type":"number"},"last_successful_refresh_at":{"nullable":true,"type":"number"},"next_refresh_at":{"nullable":true,"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"memo_id":{"type":"string","minLength":32,"maxLength":32},"section_key":{"type":"string"},"display_order":{"type":"number"},"title":{"type":"string"},"content":{"type":"string"},"questions":{"type":"array","items":{"type":"string"}},"finding_version_ids":{"type":"array","items":{"type":"string","minLength":32,"maxLength":32}},"claims":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"memo_section_id":{"type":"string","minLength":32,"maxLength":32},"finding_version_id":{"type":"string","minLength":32,"maxLength":32},"source_name":{"type":"string","description":"Title of the source containing the cited finding version."},"claim_order":{"type":"number"},"claim_text":{"type":"string"},"claim_location":{"type":"number","description":"Exact text offset in the narrative, or -1 if the claim is paraphrased."}},"required":["id","memo_section_id","finding_version_id","source_name","claim_order","claim_text","claim_location"],"additionalProperties":false}}},"required":["id","memo_id","section_key","display_order","title","content","questions","finding_version_ids","claims"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_type":{"type":"string","enum":["document","webpage","note"]},"original_url":{"nullable":true,"type":"string"},"title":{"type":"string"},"description":{"type":"string","maxLength":512},"current_version":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"}},"required":["id","organisation_id","source_type","original_url","title","description","current_version","created_at","created_by","updated_at","deleted_at"],"additionalProperties":false}}},"required":["id","target_organisation_id","requesting_organisation_id","status","created_at","updated_at","deleted_at","ingestion_version","started_at","completed_at","last_successful_refresh_at","next_refresh_at","created_by","sections","sources"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/memo/{id}":{"get":{"operationId":"memo_read","summary":"GET memo","tags":["memo"],"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"target_organisation_id":{"type":"string","minLength":32,"maxLength":32},"requesting_organisation_id":{"type":"string","minLength":32,"maxLength":32},"status":{"type":"string","enum":["stale","queued","processing","completed","no_usable_memo","failed"]},"created_at":{"type":"number"},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"},"extraction_inputs":{"description":"Per-source outcomes returned after the extraction phase.","type":"array","items":{"type":"object","properties":{"source_version_id":{"type":"string","minLength":32,"maxLength":32},"status":{"type":"string","enum":["completed","empty","omitted"]},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"failure_code":{"nullable":true,"type":"string","enum":["INVALID_AI_OUTPUT","AI_TIMEOUT","AI_RATE_LIMITED","AI_UNAVAILABLE"]}},"required":["source_version_id","status","finding_count","failure_code"],"additionalProperties":false}},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"readOnly":true,"description":"Server-defined AI processing version used by the most recently started memo phase. 0 means processing has not started. Reruns with the same AI pipeline retain the same version."},"started_at":{"nullable":true,"type":"number"},"completed_at":{"nullable":true,"type":"number"},"last_successful_refresh_at":{"nullable":true,"type":"number"},"next_refresh_at":{"nullable":true,"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"memo_id":{"type":"string","minLength":32,"maxLength":32},"section_key":{"type":"string"},"display_order":{"type":"number"},"title":{"type":"string"},"content":{"type":"string"},"questions":{"type":"array","items":{"type":"string"}},"finding_version_ids":{"type":"array","items":{"type":"string","minLength":32,"maxLength":32}},"claims":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"memo_section_id":{"type":"string","minLength":32,"maxLength":32},"finding_version_id":{"type":"string","minLength":32,"maxLength":32},"source_name":{"type":"string","description":"Title of the source containing the cited finding version."},"claim_order":{"type":"number"},"claim_text":{"type":"string"},"claim_location":{"type":"number","description":"Exact text offset in the narrative, or -1 if the claim is paraphrased."}},"required":["id","memo_section_id","finding_version_id","source_name","claim_order","claim_text","claim_location"],"additionalProperties":false}}},"required":["id","memo_id","section_key","display_order","title","content","questions","finding_version_ids","claims"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_type":{"type":"string","enum":["document","webpage","note"]},"original_url":{"nullable":true,"type":"string"},"title":{"type":"string"},"description":{"type":"string","maxLength":512},"current_version":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"}},"required":["id","organisation_id","source_type","original_url","title","description","current_version","created_at","created_by","updated_at","deleted_at"],"additionalProperties":false}}},"required":["id","target_organisation_id","requesting_organisation_id","status","created_at","updated_at","deleted_at","ingestion_version","started_at","completed_at","last_successful_refresh_at","next_refresh_at","created_by","sections","sources"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"memo_delete","summary":"DEACTIVATE memo","tags":["memo"],"description":"API route definitions: valid requests currently return 501 NOT_IMPLEMENTED. Bearer authentication is enforced by buildApp. Resource authorization and persistence are pending.\n\nSoft-deactivate the memo under its requesting tenant by setting deleted_at. Return the full memo including sections.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"target_organisation_id":{"type":"string","minLength":32,"maxLength":32},"requesting_organisation_id":{"type":"string","minLength":32,"maxLength":32},"status":{"type":"string","enum":["stale","queued","processing","completed","no_usable_memo","failed"]},"created_at":{"type":"number"},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"},"extraction_inputs":{"description":"Per-source outcomes returned after the extraction phase.","type":"array","items":{"type":"object","properties":{"source_version_id":{"type":"string","minLength":32,"maxLength":32},"status":{"type":"string","enum":["completed","empty","omitted"]},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"failure_code":{"nullable":true,"type":"string","enum":["INVALID_AI_OUTPUT","AI_TIMEOUT","AI_RATE_LIMITED","AI_UNAVAILABLE"]}},"required":["source_version_id","status","finding_count","failure_code"],"additionalProperties":false}},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"readOnly":true,"description":"Server-defined AI processing version used by the most recently started memo phase. 0 means processing has not started. Reruns with the same AI pipeline retain the same version."},"started_at":{"nullable":true,"type":"number"},"completed_at":{"nullable":true,"type":"number"},"last_successful_refresh_at":{"nullable":true,"type":"number"},"next_refresh_at":{"nullable":true,"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"memo_id":{"type":"string","minLength":32,"maxLength":32},"section_key":{"type":"string"},"display_order":{"type":"number"},"title":{"type":"string"},"content":{"type":"string"},"questions":{"type":"array","items":{"type":"string"}},"finding_version_ids":{"type":"array","items":{"type":"string","minLength":32,"maxLength":32}},"claims":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"memo_section_id":{"type":"string","minLength":32,"maxLength":32},"finding_version_id":{"type":"string","minLength":32,"maxLength":32},"source_name":{"type":"string","description":"Title of the source containing the cited finding version."},"claim_order":{"type":"number"},"claim_text":{"type":"string"},"claim_location":{"type":"number","description":"Exact text offset in the narrative, or -1 if the claim is paraphrased."}},"required":["id","memo_section_id","finding_version_id","source_name","claim_order","claim_text","claim_location"],"additionalProperties":false}}},"required":["id","memo_id","section_key","display_order","title","content","questions","finding_version_ids","claims"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_type":{"type":"string","enum":["document","webpage","note"]},"original_url":{"nullable":true,"type":"string"},"title":{"type":"string"},"description":{"type":"string","maxLength":512},"current_version":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"}},"required":["id","organisation_id","source_type","original_url","title","description","current_version","created_at","created_by","updated_at","deleted_at"],"additionalProperties":false}}},"required":["id","target_organisation_id","requesting_organisation_id","status","created_at","updated_at","deleted_at","ingestion_version","started_at","completed_at","last_successful_refresh_at","next_refresh_at","created_by","sections","sources"],"additionalProperties":false}}}},"501":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/memo/{memo_id}/generation/":{"post":{"operationId":"memo_generation_create","summary":"CREATE memo generation","tags":["memo"],"description":"Prepare evidence, generate a summary, or queue body sections followed by a separate summary task. Section and refresh generation replace body sections after success, then queue the summary from those saved sections.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["extraction","section","summary","refresh"]}},"required":["mode"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"memo_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"target_organisation_id":{"type":"string","minLength":32,"maxLength":32},"requesting_organisation_id":{"type":"string","minLength":32,"maxLength":32},"status":{"type":"string","enum":["stale","queued","processing","completed","no_usable_memo","failed"]},"created_at":{"type":"number"},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"},"extraction_inputs":{"description":"Per-source outcomes returned after the extraction phase.","type":"array","items":{"type":"object","properties":{"source_version_id":{"type":"string","minLength":32,"maxLength":32},"status":{"type":"string","enum":["completed","empty","omitted"]},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"failure_code":{"nullable":true,"type":"string","enum":["INVALID_AI_OUTPUT","AI_TIMEOUT","AI_RATE_LIMITED","AI_UNAVAILABLE"]}},"required":["source_version_id","status","finding_count","failure_code"],"additionalProperties":false}},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"readOnly":true,"description":"Server-defined AI processing version used by the most recently started memo phase. 0 means processing has not started. Reruns with the same AI pipeline retain the same version."},"started_at":{"nullable":true,"type":"number"},"completed_at":{"nullable":true,"type":"number"},"last_successful_refresh_at":{"nullable":true,"type":"number"},"next_refresh_at":{"nullable":true,"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"memo_id":{"type":"string","minLength":32,"maxLength":32},"section_key":{"type":"string"},"display_order":{"type":"number"},"title":{"type":"string"},"content":{"type":"string"},"questions":{"type":"array","items":{"type":"string"}},"finding_version_ids":{"type":"array","items":{"type":"string","minLength":32,"maxLength":32}},"claims":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"memo_section_id":{"type":"string","minLength":32,"maxLength":32},"finding_version_id":{"type":"string","minLength":32,"maxLength":32},"source_name":{"type":"string","description":"Title of the source containing the cited finding version."},"claim_order":{"type":"number"},"claim_text":{"type":"string"},"claim_location":{"type":"number","description":"Exact text offset in the narrative, or -1 if the claim is paraphrased."}},"required":["id","memo_section_id","finding_version_id","source_name","claim_order","claim_text","claim_location"],"additionalProperties":false}}},"required":["id","memo_id","section_key","display_order","title","content","questions","finding_version_ids","claims"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_type":{"type":"string","enum":["document","webpage","note"]},"original_url":{"nullable":true,"type":"string"},"title":{"type":"string"},"description":{"type":"string","maxLength":512},"current_version":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"}},"required":["id","organisation_id","source_type","original_url","title","description","current_version","created_at","created_by","updated_at","deleted_at"],"additionalProperties":false}}},"required":["id","target_organisation_id","requesting_organisation_id","status","created_at","updated_at","deleted_at","ingestion_version","started_at","completed_at","last_successful_refresh_at","next_refresh_at","created_by","sections","sources"],"additionalProperties":false}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"target_organisation_id":{"type":"string","minLength":32,"maxLength":32},"requesting_organisation_id":{"type":"string","minLength":32,"maxLength":32},"status":{"type":"string","enum":["stale","queued","processing","completed","no_usable_memo","failed"]},"created_at":{"type":"number"},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"},"extraction_inputs":{"description":"Per-source outcomes returned after the extraction phase.","type":"array","items":{"type":"object","properties":{"source_version_id":{"type":"string","minLength":32,"maxLength":32},"status":{"type":"string","enum":["completed","empty","omitted"]},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"failure_code":{"nullable":true,"type":"string","enum":["INVALID_AI_OUTPUT","AI_TIMEOUT","AI_RATE_LIMITED","AI_UNAVAILABLE"]}},"required":["source_version_id","status","finding_count","failure_code"],"additionalProperties":false}},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"readOnly":true,"description":"Server-defined AI processing version used by the most recently started memo phase. 0 means processing has not started. Reruns with the same AI pipeline retain the same version."},"started_at":{"nullable":true,"type":"number"},"completed_at":{"nullable":true,"type":"number"},"last_successful_refresh_at":{"nullable":true,"type":"number"},"next_refresh_at":{"nullable":true,"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"memo_id":{"type":"string","minLength":32,"maxLength":32},"section_key":{"type":"string"},"display_order":{"type":"number"},"title":{"type":"string"},"content":{"type":"string"},"questions":{"type":"array","items":{"type":"string"}},"finding_version_ids":{"type":"array","items":{"type":"string","minLength":32,"maxLength":32}},"claims":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"memo_section_id":{"type":"string","minLength":32,"maxLength":32},"finding_version_id":{"type":"string","minLength":32,"maxLength":32},"source_name":{"type":"string","description":"Title of the source containing the cited finding version."},"claim_order":{"type":"number"},"claim_text":{"type":"string"},"claim_location":{"type":"number","description":"Exact text offset in the narrative, or -1 if the claim is paraphrased."}},"required":["id","memo_section_id","finding_version_id","source_name","claim_order","claim_text","claim_location"],"additionalProperties":false}}},"required":["id","memo_id","section_key","display_order","title","content","questions","finding_version_ids","claims"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_type":{"type":"string","enum":["document","webpage","note"]},"original_url":{"nullable":true,"type":"string"},"title":{"type":"string"},"description":{"type":"string","maxLength":512},"current_version":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"source_id":{"type":"string","minLength":32,"maxLength":32},"version_no":{"type":"number"},"finding_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"filename":{"nullable":true,"type":"string"},"mime_type":{"nullable":true,"type":"string"},"byte_size":{"nullable":true,"type":"string","pattern":"^\\d+$"},"extraction_status":{"type":"string","enum":["not_started","pending","processing","completed","failed"]},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","source_id","version_no","finding_count","filename","mime_type","byte_size","extraction_status","retired_at","created_at","created_by"],"additionalProperties":false},"created_at":{"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"}},"required":["id","organisation_id","source_type","original_url","title","description","current_version","created_at","created_by","updated_at","deleted_at"],"additionalProperties":false}}},"required":["id","target_organisation_id","requesting_organisation_id","status","created_at","updated_at","deleted_at","ingestion_version","started_at","completed_at","last_successful_refresh_at","next_refresh_at","created_by","sections","sources"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/memo/{memo_id}/processing":{"get":{"operationId":"memo_processing_read","summary":"GET memo processing","tags":["memo"],"description":"API route definitions: valid requests currently return 501 NOT_IMPLEMENTED. Bearer authentication is enforced by buildApp. Resource authorization and persistence are pending.\n\nReturn memo status and safe task progress; suppress event payloads and raw error details.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"memo_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["memo_processing"]},"memo":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"target_organisation_id":{"type":"string","minLength":32,"maxLength":32},"requesting_organisation_id":{"type":"string","minLength":32,"maxLength":32},"status":{"type":"string","enum":["stale","queued","processing","completed","no_usable_memo","failed"]},"created_at":{"type":"number"},"updated_at":{"type":"number"},"deleted_at":{"nullable":true,"type":"number"}},"required":["id","target_organisation_id","requesting_organisation_id","status","created_at","updated_at","deleted_at"],"additionalProperties":false},"tasks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"parent_task_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"event_type":{"type":"string"},"subject":{"type":"string"},"data_version":{"type":"string"},"event_data":{"type":"string"},"status":{"type":"string","enum":["pending","processing","completed","failed","retry_pending"]},"attempt_count":{"type":"number"},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"last_error_timestamp":{"nullable":true,"type":"number"},"retry_requested_at":{"nullable":true,"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"started_at":{"nullable":true,"type":"number"},"completed_at":{"nullable":true,"type":"number"},"updated_at":{"type":"number"}},"required":["id","parent_task_id","event_type","subject","data_version","event_data","status","attempt_count","organisation_id","last_error_timestamp","retry_requested_at","created_by","created_at","started_at","completed_at","updated_at"],"additionalProperties":false}}},"required":["object","memo","tasks"],"additionalProperties":false}}}},"501":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/memo/{memo_id}/claim/{claim_id}/evidence":{"get":{"operationId":"memo_claim_evidence_read","summary":"GET memo claim evidence","tags":["memo"],"description":"API route definitions: valid requests currently return 501 NOT_IMPLEMENTED. Bearer authentication is enforced by buildApp. Resource authorization and persistence are pending.\n\nVerify that the claim belongs to this memo and that the caller may view its finding evidence.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"memo_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"claim_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"memo_section_id":{"type":"string","minLength":32,"maxLength":32},"finding_version_id":{"type":"string","minLength":32,"maxLength":32},"source_name":{"type":"string","description":"Title of the source containing the cited finding version."},"claim_order":{"type":"number"},"claim_text":{"type":"string"},"claim_location":{"type":"number","description":"Exact text offset in the narrative, or -1 if the claim is paraphrased."}},"required":["id","memo_section_id","finding_version_id","source_name","claim_order","claim_text","claim_location"],"additionalProperties":false}}}},"501":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/finding/":{"get":{"operationId":"finding_list","tags":["finding"],"parameters":[{"schema":{"default":"false","type":"string","enum":["true","false"]},"in":"query","name":"show_retired","required":false},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"finding_key":{"type":"string"},"name":{"type":"string","minLength":1},"retired_at":{"nullable":true,"type":"number"},"latest_version":{"nullable":true,"type":"object","properties":{"previous_finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"id":{"type":"string","minLength":32,"maxLength":32},"finding_id":{"type":"string","minLength":32,"maxLength":32},"source_version_id":{"type":"string","minLength":32,"maxLength":32},"finding_text":{"nullable":true,"type":"string","minLength":1},"subjectivity_score":{"type":"number","minimum":0,"maximum":1},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Extraction pipeline version captured when the finding version was created."},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"}},"required":["previous_finding_version_id","id","finding_id","source_version_id","finding_text","subjectivity_score","ingestion_version","retired_at","created_at"],"additionalProperties":false},"source":{"nullable":true,"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"title":{"type":"string"},"deleted_at":{"nullable":true,"type":"number"},"version_no":{"type":"number"},"filename":{"nullable":true,"type":"string"}},"required":["id","title","deleted_at","version_no","filename"],"additionalProperties":false},"version_count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","organisation_id","finding_key","name","retired_at","latest_version","source","version_count"],"additionalProperties":false}}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/finding/{id}":{"get":{"operationId":"organisation_finding_read","tags":["finding"],"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"finding_key":{"type":"string"},"name":{"type":"string","minLength":1},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"current_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"versions":{"type":"array","items":{"type":"object","properties":{"previous_finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"id":{"type":"string","minLength":32,"maxLength":32},"finding_id":{"type":"string","minLength":32,"maxLength":32},"source_version_id":{"type":"string","minLength":32,"maxLength":32},"finding_text":{"nullable":true,"type":"string","minLength":1},"subjectivity_score":{"type":"number","minimum":0,"maximum":1},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Extraction pipeline version captured when the finding version was created."},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"source_text_verbatim":{"type":"string","minLength":1,"maxLength":6000},"source_start_line":{"type":"integer","minimum":1,"maximum":2147483647},"source_end_line":{"type":"integer","minimum":1,"maximum":2147483647},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"title":{"type":"string"},"deleted_at":{"nullable":true,"type":"number"},"version_no":{"type":"number"},"filename":{"nullable":true,"type":"string"}},"required":["id","title","deleted_at","version_no","filename"],"additionalProperties":false}},"required":["previous_finding_version_id","id","finding_id","source_version_id","finding_text","subjectivity_score","ingestion_version","retired_at","created_at","source_text_verbatim","source_start_line","source_end_line","created_by","source"],"additionalProperties":false}}},"required":["id","organisation_id","finding_key","name","retired_at","created_at","current_version_id","versions"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/finding/{id}":{"get":{"operationId":"finding_read","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"finding_key":{"type":"string"},"name":{"type":"string","minLength":1},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"}},"required":["id","organisation_id","finding_key","name","retired_at","created_at"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/finding/{finding_id}/version/":{"get":{"operationId":"finding_version_list","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"finding_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"previous_finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"id":{"type":"string","minLength":32,"maxLength":32},"finding_id":{"type":"string","minLength":32,"maxLength":32},"source_version_id":{"type":"string","minLength":32,"maxLength":32},"finding_text":{"nullable":true,"type":"string","minLength":1},"subjectivity_score":{"type":"number","minimum":0,"maximum":1},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Extraction pipeline version captured when the finding version was created."},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"source_text_verbatim":{"type":"string","minLength":1,"maxLength":6000},"source_start_line":{"type":"integer","minimum":1,"maximum":2147483647},"source_end_line":{"type":"integer","minimum":1,"maximum":2147483647},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["previous_finding_version_id","id","finding_id","source_version_id","finding_text","subjectivity_score","ingestion_version","retired_at","created_at","source_text_verbatim","source_start_line","source_end_line","created_by"],"additionalProperties":false}}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/finding/{finding_id}/version/{id}":{"get":{"operationId":"finding_version_read","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"finding_id","required":true},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"previous_finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"id":{"type":"string","minLength":32,"maxLength":32},"finding_id":{"type":"string","minLength":32,"maxLength":32},"source_version_id":{"type":"string","minLength":32,"maxLength":32},"finding_text":{"nullable":true,"type":"string","minLength":1},"subjectivity_score":{"type":"number","minimum":0,"maximum":1},"ingestion_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Extraction pipeline version captured when the finding version was created."},"retired_at":{"nullable":true,"type":"number"},"created_at":{"type":"number"},"source_text_verbatim":{"type":"string","minLength":1,"maxLength":6000},"source_start_line":{"type":"integer","minimum":1,"maximum":2147483647},"source_end_line":{"type":"integer","minimum":1,"maximum":2147483647},"created_by":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["previous_finding_version_id","id","finding_id","source_version_id","finding_text","subjectivity_score","ingestion_version","retired_at","created_at","source_text_verbatim","source_start_line","source_end_line","created_by"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/organisation/{organisation_id}/conversation/":{"post":{"operationId":"organisation_conversation_create","tags":["conversation"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":8000}},"required":["message"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"organisation_id","required":true},{"schema":{"type":"string","minLength":1},"in":"header","name":"idempotency-key","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"context_organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"context_data_room_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"context_memo_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"initiated_by_user_id":{"type":"string","minLength":32,"maxLength":32},"created_by":{"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"updated_at":{"type":"number"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"conversation_id":{"type":"string","minLength":32,"maxLength":32},"role":{"type":"string","enum":["user","assistant","system"]},"message":{"type":"string"},"reasoning_summary":{"nullable":true,"type":"string"},"citations":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","pattern":"^[MF][1-9]\\d*$"},"kind":{"type":"string","enum":["memo","finding"]},"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"requesting_organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"title":{"type":"string"},"content":{"type":"string"},"finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_title":{"nullable":true,"type":"string"},"source_version_no":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source_start_line":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source_end_line":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"captured_at":{"type":"number"}},"required":["label","kind","id","organisation_id","requesting_organisation_id","title","content","finding_version_id","source_id","source_version_id","source_title","source_version_no","source_start_line","source_end_line","captured_at"],"additionalProperties":false}},"created_by":{"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"}},"required":["id","conversation_id","role","message","reasoning_summary","citations","created_by","created_at"],"additionalProperties":false}}},"required":["id","organisation_id","context_organisation_id","context_data_room_id","context_memo_id","initiated_by_user_id","created_by","created_at","updated_at","messages"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/conversation/{id}":{"get":{"operationId":"conversation_read","tags":["conversation"],"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"context_organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"context_data_room_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"context_memo_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"initiated_by_user_id":{"type":"string","minLength":32,"maxLength":32},"created_by":{"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"updated_at":{"type":"number"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"conversation_id":{"type":"string","minLength":32,"maxLength":32},"role":{"type":"string","enum":["user","assistant","system"]},"message":{"type":"string"},"reasoning_summary":{"nullable":true,"type":"string"},"citations":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","pattern":"^[MF][1-9]\\d*$"},"kind":{"type":"string","enum":["memo","finding"]},"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"requesting_organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"title":{"type":"string"},"content":{"type":"string"},"finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_title":{"nullable":true,"type":"string"},"source_version_no":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source_start_line":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source_end_line":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"captured_at":{"type":"number"}},"required":["label","kind","id","organisation_id","requesting_organisation_id","title","content","finding_version_id","source_id","source_version_id","source_title","source_version_no","source_start_line","source_end_line","captured_at"],"additionalProperties":false}},"created_by":{"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"}},"required":["id","conversation_id","role","message","reasoning_summary","citations","created_by","created_at"],"additionalProperties":false}}},"required":["id","organisation_id","context_organisation_id","context_data_room_id","context_memo_id","initiated_by_user_id","created_by","created_at","updated_at","messages"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/conversation/{conversation_id}/turn/":{"post":{"operationId":"conversation_turn_create","tags":["conversation"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":8000}},"required":["message"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"conversation_id","required":true},{"schema":{"type":"string","minLength":1},"in":"header","name":"idempotency-key","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"context_organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"context_data_room_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"context_memo_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"initiated_by_user_id":{"type":"string","minLength":32,"maxLength":32},"created_by":{"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"updated_at":{"type":"number"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"conversation_id":{"type":"string","minLength":32,"maxLength":32},"role":{"type":"string","enum":["user","assistant","system"]},"message":{"type":"string"},"reasoning_summary":{"nullable":true,"type":"string"},"citations":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","pattern":"^[MF][1-9]\\d*$"},"kind":{"type":"string","enum":["memo","finding"]},"id":{"type":"string","minLength":32,"maxLength":32},"organisation_id":{"type":"string","minLength":32,"maxLength":32},"requesting_organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"title":{"type":"string"},"content":{"type":"string"},"finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_title":{"nullable":true,"type":"string"},"source_version_no":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source_start_line":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source_end_line":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"captured_at":{"type":"number"}},"required":["label","kind","id","organisation_id","requesting_organisation_id","title","content","finding_version_id","source_id","source_version_id","source_title","source_version_no","source_start_line","source_end_line","captured_at"],"additionalProperties":false}},"created_by":{"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"}},"required":["id","conversation_id","role","message","reasoning_summary","citations","created_by","created_at"],"additionalProperties":false}}},"required":["id","organisation_id","context_organisation_id","context_data_room_id","context_memo_id","initiated_by_user_id","created_by","created_at","updated_at","messages"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/audit/audit-event/":{"get":{"operationId":"audit_event_list","summary":"LIST audit event","tags":["operations"],"description":"API route definitions: valid requests currently return 501 NOT_IMPLEMENTED. Bearer authentication is enforced by buildApp. Resource authorization and persistence are pending.\n\nPlatform administrator only. Audit records are read-only and may contain private input and output data.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"query","name":"organisation_id","required":false},{"schema":{"type":"string"},"in":"query","name":"type","required":false},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"success","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"type":{"type":"string"},"success":{"type":"boolean"},"severity":{"type":"string"},"created_by":{"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"resource_id":{"nullable":true,"type":"string"},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","type","success","severity","created_by","created_at","resource_id","organisation_id"],"additionalProperties":false}}}}},"501":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/audit/audit-event/{id}":{"get":{"operationId":"audit_event_read","summary":"GET audit event","tags":["operations"],"description":"API route definitions: valid requests currently return 501 NOT_IMPLEMENTED. Bearer authentication is enforced by buildApp. Resource authorization and persistence are pending.\n\nPlatform administrator only.","parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"type":{"type":"string"},"success":{"type":"boolean"},"severity":{"type":"string"},"created_by":{"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"resource_id":{"nullable":true,"type":"string"},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"deal_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"data_room_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"input_data":{"type":"string"},"output_data":{"type":"string"}},"required":["id","type","success","severity","created_by","created_at","resource_id","organisation_id","deal_id","data_room_id","input_data","output_data"],"additionalProperties":false}}}},"501":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/queue":{"get":{"operationId":"queue_task_list","summary":"List queue progress and tasks (super admin)","tags":["operations"],"parameters":[{"schema":{"type":"string","enum":["pending","processing","completed","failed","retry_pending"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"query","name":"organisation_id","required":false},{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"query","name":"memo_id","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"parent_task_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"event_type":{"type":"string"},"subject":{"type":"string"},"data_version":{"type":"string"},"event_data":{"type":"string"},"status":{"type":"string","enum":["pending","processing","completed","failed","retry_pending"]},"attempt_count":{"type":"number"},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"last_error_timestamp":{"nullable":true,"type":"number"},"retry_requested_at":{"nullable":true,"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"started_at":{"nullable":true,"type":"number"},"completed_at":{"nullable":true,"type":"number"},"updated_at":{"type":"number"}},"required":["id","parent_task_id","event_type","subject","data_version","event_data","status","attempt_count","organisation_id","last_error_timestamp","retry_requested_at","created_by","created_at","started_at","completed_at","updated_at"],"additionalProperties":false}}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/queue/{id}":{"get":{"operationId":"queue_task_read","summary":"Read queue task (super admin)","tags":["operations"],"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"parent_task_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"event_type":{"type":"string"},"subject":{"type":"string"},"data_version":{"type":"string"},"event_data":{"type":"string"},"status":{"type":"string","enum":["pending","processing","completed","failed","retry_pending"]},"attempt_count":{"type":"number"},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"last_error_timestamp":{"nullable":true,"type":"number"},"retry_requested_at":{"nullable":true,"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"started_at":{"nullable":true,"type":"number"},"completed_at":{"nullable":true,"type":"number"},"updated_at":{"type":"number"},"memo_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"memo_section_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"finding_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"last_error_message":{"nullable":true,"type":"string"},"retry_requested_by_user_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","parent_task_id","event_type","subject","data_version","event_data","status","attempt_count","organisation_id","last_error_timestamp","retry_requested_at","created_by","created_at","started_at","completed_at","updated_at","memo_id","memo_section_id","source_id","source_version_id","finding_id","finding_version_id","last_error_message","retry_requested_by_user_id"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"queue_task_update","summary":"Retry or recover queue task (super admin)","tags":["operations"],"description":"Only mark processing tasks failed after confirming their original worker has stopped.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["retry_pending"]}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"worker_stopped":{"type":"boolean","enum":[true]}},"required":["status","worker_stopped"],"additionalProperties":false}]}}}},"parameters":[{"schema":{"type":"string","minLength":32,"maxLength":32},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":32,"maxLength":32},"parent_task_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"event_type":{"type":"string"},"subject":{"type":"string"},"data_version":{"type":"string"},"event_data":{"type":"string"},"status":{"type":"string","enum":["pending","processing","completed","failed","retry_pending"]},"attempt_count":{"type":"number"},"organisation_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"last_error_timestamp":{"nullable":true,"type":"number"},"retry_requested_at":{"nullable":true,"type":"number"},"created_by":{"type":"string","minLength":32,"maxLength":32},"created_at":{"type":"number"},"started_at":{"nullable":true,"type":"number"},"completed_at":{"nullable":true,"type":"number"},"updated_at":{"type":"number"},"memo_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"memo_section_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"source_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"finding_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"finding_version_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32},"last_error_message":{"nullable":true,"type":"string"},"retry_requested_by_user_id":{"nullable":true,"type":"string","minLength":32,"maxLength":32}},"required":["id","parent_task_id","event_type","subject","data_version","event_data","status","attempt_count","organisation_id","last_error_timestamp","retry_requested_at","created_by","created_at","started_at","completed_at","updated_at","memo_id","memo_section_id","source_id","source_version_id","finding_id","finding_version_id","last_error_message","retry_requested_by_user_id"],"additionalProperties":false}}}},"4XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"5XX":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"field_errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["type","code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}}}}