{ "components": { "schemas": { "AcceptInvitationRequest": { "properties": { "token": { "title": "Token", "type": "string" } }, "required": [ "token" ], "title": "AcceptInvitationRequest", "type": "object" }, "AuthResponse": { "properties": { "user_id": { "format": "uuid", "title": "User Id", "type": "string" } }, "required": [ "user_id" ], "title": "AuthResponse", "type": "object" }, "ChangeMemberRoleRequest": { "properties": { "role": { "$ref": "#/components/schemas/Role" } }, "required": [ "role" ], "title": "ChangeMemberRoleRequest", "type": "object" }, "CreateOrganizationRequest": { "properties": { "name": { "title": "Name", "type": "string" }, "slug": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Slug" } }, "required": [ "name" ], "title": "CreateOrganizationRequest", "type": "object" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "title": "Detail", "type": "array" } }, "title": "HTTPValidationError", "type": "object" }, "InvitationResponse": { "properties": { "email": { "title": "Email", "type": "string" }, "expires_at": { "format": "date-time", "title": "Expires At", "type": "string" }, "id": { "format": "uuid", "title": "Id", "type": "string" }, "role": { "$ref": "#/components/schemas/Role" }, "token": { "title": "Token", "type": "string" } }, "required": [ "id", "email", "role", "token", "expires_at" ], "title": "InvitationResponse", "type": "object" }, "InviteMemberRequest": { "properties": { "email": { "format": "email", "title": "Email", "type": "string" }, "role": { "$ref": "#/components/schemas/Role" } }, "required": [ "email", "role" ], "title": "InviteMemberRequest", "type": "object" }, "LoginRequest": { "properties": { "email": { "format": "email", "title": "Email", "type": "string" }, "password": { "title": "Password", "type": "string" } }, "required": [ "email", "password" ], "title": "LoginRequest", "type": "object" }, "MembershipResponse": { "properties": { "created_at": { "format": "date-time", "title": "Created At", "type": "string" }, "id": { "format": "uuid", "title": "Id", "type": "string" }, "role": { "$ref": "#/components/schemas/Role" }, "user_id": { "format": "uuid", "title": "User Id", "type": "string" } }, "required": [ "id", "user_id", "role", "created_at" ], "title": "MembershipResponse", "type": "object" }, "MyOrganizationResponse": { "properties": { "name": { "title": "Name", "type": "string" }, "organization_id": { "format": "uuid", "title": "Organization Id", "type": "string" }, "role": { "$ref": "#/components/schemas/Role" }, "slug": { "title": "Slug", "type": "string" } }, "required": [ "organization_id", "name", "slug", "role" ], "title": "MyOrganizationResponse", "type": "object" }, "OrganizationResponse": { "properties": { "created_at": { "format": "date-time", "title": "Created At", "type": "string" }, "id": { "format": "uuid", "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "slug": { "title": "Slug", "type": "string" } }, "required": [ "id", "name", "slug", "created_at" ], "title": "OrganizationResponse", "type": "object" }, "RegisterRequest": { "properties": { "email": { "format": "email", "title": "Email", "type": "string" }, "password": { "minLength": 8, "title": "Password", "type": "string" } }, "required": [ "email", "password" ], "title": "RegisterRequest", "type": "object" }, "Role": { "enum": [ "owner", "admin", "member", "viewer" ], "title": "Role", "type": "string" }, "SummarizeRequest": { "properties": { "text": { "maxLength": 20000, "minLength": 1, "title": "Text", "type": "string" } }, "required": [ "text" ], "title": "SummarizeRequest", "type": "object" }, "UserProfileResponse": { "properties": { "created_at": { "format": "date-time", "title": "Created At", "type": "string" }, "email": { "title": "Email", "type": "string" }, "email_verified": { "title": "Email Verified", "type": "boolean" }, "id": { "format": "uuid", "title": "Id", "type": "string" } }, "required": [ "id", "email", "email_verified", "created_at" ], "title": "UserProfileResponse", "type": "object" }, "ValidationError": { "properties": { "ctx": { "title": "Context", "type": "object" }, "input": { "title": "Input" }, "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "title": "Location", "type": "array" }, "msg": { "title": "Message", "type": "string" }, "type": { "title": "Error Type", "type": "string" } }, "required": [ "loc", "msg", "type" ], "title": "ValidationError", "type": "object" } } }, "info": { "title": "Ai Native Saas Foundation API", "version": "0.1.0" }, "openapi": "3.1.0", "paths": { "/auth/login": { "post": { "description": "Authenticate a user and set access/refresh cookies.", "operationId": "login_auth_login_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthResponse" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Login", "tags": [ "auth" ] } }, "/auth/logout": { "post": { "description": "Revoke the current session and clear auth cookies.", "operationId": "logout_auth_logout_post", "parameters": [ { "in": "cookie", "name": "refresh_token", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Refresh Token" } } ], "responses": { "204": { "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Logout", "tags": [ "auth" ] } }, "/auth/me": { "get": { "description": "Return the authenticated caller's profile.", "operationId": "get_current_user_profile_auth_me_get", "parameters": [ { "in": "cookie", "name": "access_token", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Access Token" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserProfileResponse" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Get Current User Profile", "tags": [ "auth" ] } }, "/auth/refresh": { "post": { "description": "Rotate the refresh token and set new access/refresh cookies.\n\nRaises:\n UnauthorizedError: No refresh token cookie was sent.", "operationId": "refresh_auth_refresh_post", "parameters": [ { "in": "cookie", "name": "refresh_token", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Refresh Token" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthResponse" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Refresh", "tags": [ "auth" ] } }, "/auth/register": { "post": { "description": "Register a user and set access/refresh cookies.", "operationId": "register_auth_register_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisterRequest" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthResponse" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Register", "tags": [ "auth" ] } }, "/health/live": { "get": { "description": "Liveness probe: the process is up.", "operationId": "health_live_health_live_get", "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": { "type": "string" }, "title": "Response Health Live Health Live Get", "type": "object" } } }, "description": "Successful Response" } }, "summary": "Health Live", "tags": [ "health" ] } }, "/health/ready": { "get": { "description": "Readiness probe: database and Redis are both reachable.", "operationId": "health_ready_health_ready_get", "responses": { "200": { "content": { "application/json": { "schema": {} } }, "description": "Successful Response" } }, "summary": "Health Ready", "tags": [ "health" ] } }, "/invitations/accept": { "post": { "description": "Accept an invitation and become a member.", "operationId": "accept_invitation_invitations_accept_post", "parameters": [ { "in": "cookie", "name": "access_token", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Access Token" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AcceptInvitationRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MembershipResponse" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Accept Invitation", "tags": [ "organizations" ] } }, "/organizations": { "get": { "description": "List every organization the caller belongs to.", "operationId": "list_my_organizations_organizations_get", "parameters": [ { "in": "cookie", "name": "access_token", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Access Token" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/MyOrganizationResponse" }, "title": "Response List My Organizations Organizations Get", "type": "array" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "List My Organizations", "tags": [ "organizations" ] }, "post": { "description": "Create an organization and make the caller its Owner.", "operationId": "create_organization_organizations_post", "parameters": [ { "in": "cookie", "name": "access_token", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Access Token" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrganizationRequest" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganizationResponse" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Create Organization", "tags": [ "organizations" ] } }, "/organizations/{organization_id}/ai/summarize": { "post": { "description": "Stream a summary of `body.text` as Server-Sent Events.\n\nRaises:\n ForbiddenError: The caller's role lacks `Permission.RESOURCE_WRITE`.", "operationId": "summarize_organizations__organization_id__ai_summarize_post", "parameters": [ { "in": "path", "name": "organization_id", "required": true, "schema": { "format": "uuid", "title": "Organization Id", "type": "string" } }, { "in": "cookie", "name": "access_token", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Access Token" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SummarizeRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": {} } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Summarize", "tags": [ "ai" ] } }, "/organizations/{organization_id}/invitations": { "post": { "description": "Invite a new member by email.", "operationId": "invite_member_organizations__organization_id__invitations_post", "parameters": [ { "in": "path", "name": "organization_id", "required": true, "schema": { "format": "uuid", "title": "Organization Id", "type": "string" } }, { "in": "cookie", "name": "access_token", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Access Token" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InviteMemberRequest" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InvitationResponse" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Invite Member", "tags": [ "organizations" ] } }, "/organizations/{organization_id}/members": { "get": { "description": "List every member of an organization.", "operationId": "list_members_organizations__organization_id__members_get", "parameters": [ { "in": "path", "name": "organization_id", "required": true, "schema": { "format": "uuid", "title": "Organization Id", "type": "string" } }, { "in": "cookie", "name": "access_token", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Access Token" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/MembershipResponse" }, "title": "Response List Members Organizations Organization Id Members Get", "type": "array" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "List Members", "tags": [ "organizations" ] } }, "/organizations/{organization_id}/members/{membership_id}": { "delete": { "description": "Remove a member from the organization.", "operationId": "remove_member_organizations__organization_id__members__membership_id__delete", "parameters": [ { "in": "path", "name": "membership_id", "required": true, "schema": { "format": "uuid", "title": "Membership Id", "type": "string" } }, { "in": "path", "name": "organization_id", "required": true, "schema": { "format": "uuid", "title": "Organization Id", "type": "string" } }, { "in": "cookie", "name": "access_token", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Access Token" } } ], "responses": { "204": { "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Remove Member", "tags": [ "organizations" ] }, "patch": { "description": "Change a member's role.", "operationId": "change_member_role_organizations__organization_id__members__membership_id__patch", "parameters": [ { "in": "path", "name": "membership_id", "required": true, "schema": { "format": "uuid", "title": "Membership Id", "type": "string" } }, { "in": "path", "name": "organization_id", "required": true, "schema": { "format": "uuid", "title": "Organization Id", "type": "string" } }, { "in": "cookie", "name": "access_token", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Access Token" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChangeMemberRoleRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MembershipResponse" } } }, "description": "Successful Response" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }, "description": "Validation Error" } }, "summary": "Change Member Role", "tags": [ "organizations" ] } } } }