{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/debug-version":{"get":{"summary":"Debug Version","operationId":"debug_version_debug_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/register":{"post":{"tags":["authentication"],"summary":"Register","description":"Register a new user with email and password\nReturns JWT token on success","operationId":"register_api_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSignup"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login":{"post":{"tags":["authentication"],"summary":"Login","description":"Login with email and password\nReturns JWT token on success","operationId":"login_api_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLogin"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/me":{"get":{"tags":["authentication"],"summary":"Get Me","description":"Get current user information\nRequires valid JWT token","operationId":"get_me_api_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/auth_routes__UserResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/auth/forgot-password":{"post":{"tags":["authentication"],"summary":"Forgot Password","description":"Request a password reset email","operationId":"forgot_password_api_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/reset-password":{"post":{"tags":["authentication"],"summary":"Reset Password","description":"Reset password using token from email","operationId":"reset_password_api_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/send-verification":{"post":{"tags":["authentication"],"summary":"Send Verification","description":"Send email verification code to current user","operationId":"send_verification_api_auth_send_verification_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/auth/verify-email":{"post":{"tags":["authentication"],"summary":"Verify Email","description":"Verify email with code","operationId":"verify_email_api_auth_verify_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/auth/invitation/{token}":{"get":{"tags":["authentication"],"summary":"Get Invitation Info","description":"Get invitation details by token","operationId":"get_invitation_info_api_auth_invitation__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/accept-invitation":{"post":{"tags":["authentication"],"summary":"Accept Invitation By Token","description":"Accept invitation by registering a new account","operationId":"accept_invitation_by_token_api_auth_accept_invitation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInvitationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/google/connect":{"get":{"tags":["google-oauth"],"summary":"Google Connect","description":"Start Google OAuth flow for invite onboarding.\n\nModes:\n- combined: sign in + calendar consent in one click (invite flow)\n- connect: calendar-only connection for an already signed-in user","operationId":"google_connect_api_auth_google_connect_get","parameters":[{"name":"mode","in":"query","required":false,"schema":{"type":"string","pattern":"^(combined|connect)$","default":"combined","title":"Mode"}},{"name":"invitation_token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitation Token"}},{"name":"auth_token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/google/callback":{"get":{"tags":["google-oauth"],"summary":"Google Callback","description":"Handle Google OAuth callback for both invite combined flow and connect-only flow.","operationId":"google_callback_api_auth_google_callback_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/google/connection-status":{"get":{"tags":["google-oauth"],"summary":"Google Connection Status","description":"Check whether the current user has an active Google Calendar connection.","operationId":"google_connection_status_api_auth_google_connection_status_get","parameters":[{"name":"auth_token","in":"query","required":true,"schema":{"type":"string","title":"Auth Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/google/verify":{"post":{"tags":["google-oauth"],"summary":"Verify Google Token","description":"Verify Google ID token from frontend and create/login user\nThis is called after the frontend completes Google OAuth flow","operationId":"verify_google_token_api_auth_google_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleTokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleAuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/register":{"post":{"tags":["users"],"summary":"Register User","description":"Register a new user","operationId":"register_user_api_users_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRegistration"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/user_management__UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/me":{"get":{"tags":["users"],"summary":"Get Current User Info","description":"Get current authenticated user's information","operationId":"get_current_user_info_api_users_me_get","parameters":[{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/user_management__UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/me/usage":{"get":{"tags":["users"],"summary":"Get User Usage","description":"Get current user's token usage and limits","operationId":"get_user_usage_api_users_me_usage_get","parameters":[{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/me/api-keys":{"post":{"tags":["users"],"summary":"Create User Api Key","description":"Create a new API key for the current user\nReturns the full key - this is the ONLY time it will be shown","operationId":"create_user_api_key_api_users_me_api_keys_post","parameters":[{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAPIKeyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyCreatedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["users"],"summary":"List User Api Keys","description":"List all API keys for the current user (without showing full keys)","operationId":"list_user_api_keys_api_users_me_api_keys_get","parameters":[{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/APIKeyResponse"},"title":"Response List User Api Keys Api Users Me Api Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/me/api-keys/{key_id}":{"delete":{"tags":["users"],"summary":"Delete User Api Key","description":"Deactivate an API key","operationId":"delete_user_api_key_api_users_me_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ocr/process":{"post":{"tags":["OCR Processing"],"summary":"Process Ocr","description":"Process document with OCR using DeepSeek-OCR service\n\nFlow:\n1. Authenticate user (JWT token)\n2. Check user's token balance\n3. Upload file to S3 storage\n4. Forward request to DeepSeek with company API key\n5. Store structured data (tables, JSON, etc.)\n6. Track token usage\n7. Return OCR results with structured data","operationId":"process_ocr_api_ocr_process_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_process_ocr_api_ocr_process_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OCRResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/ocr/process/batch":{"post":{"tags":["OCR Processing"],"summary":"Process Batch Ocr","description":"Process multiple documents with OCR using DeepSeek-OCR service\n\nReturns a list of results, one for each file processed.","operationId":"process_batch_ocr_api_ocr_process_batch_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_process_batch_ocr_api_ocr_process_batch_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/ocr/usage":{"get":{"tags":["OCR Processing"],"summary":"Get Ocr Usage","description":"Get current user's OCR usage statistics","operationId":"get_ocr_usage_api_ocr_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/ocr/documents":{"get":{"tags":["OCR Processing"],"summary":"List Ocr Documents","description":"List user's processed batch documents (same as DocumentParser shows)","operationId":"list_ocr_documents_api_ocr_documents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ocr/documents/{document_id}":{"get":{"tags":["OCR Processing"],"summary":"Get Ocr Document","description":"Get specific OCR document details","operationId":"get_ocr_document_api_ocr_documents__document_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ocr/health":{"get":{"tags":["OCR Processing"],"summary":"Ocr Health Check","description":"Check OCR service health","operationId":"ocr_health_check_api_ocr_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/batch/upload":{"post":{"tags":["Batch Processing"],"summary":"Upload Batch","description":"Upload multiple files as a batch for processing.\nSupports both authenticated users and guest mode (1 file, 46 pages max).\nFiles are uploaded to S3 and batch records created in database.\nProcessing starts automatically in background.\n\nArgs:\n    files: List of files to upload (images, PDFs)\n    batch_name: Optional name for the batch\n    guest_session_id: Guest session ID (required if not authenticated)\n    current_user: Authenticated user (optional for guest mode)\n    s3_storage: S3 storage instance\n\nReturns:\n    BatchUploadResponse with batch_id and document details","operationId":"upload_batch_api_batch_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_batch_api_batch_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/batch/{batch_id}/process":{"post":{"tags":["Batch Processing"],"summary":"Trigger Batch Processing","description":"Trigger processing on an already-uploaded batch.\nUsed when files were uploaded with skip_processing=true.","operationId":"trigger_batch_processing_api_batch__batch_id__process_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}},{"name":"processing_mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing Mode"}},{"name":"amet_session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amet Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/{batch_id}/retry":{"post":{"tags":["Batch Processing"],"summary":"Retry Batch","description":"Retry failed, stuck, or partially-completed documents in a batch.\nNever deletes anything — resets status and reprocesses.","operationId":"retry_batch_api_batch__batch_id__retry_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/batch_routes__RetryRequest","default":{"processing_mode":"normal"}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/{batch_id}":{"delete":{"tags":["Batch Processing"],"summary":"Delete Batch","description":"Delete a batch and all its documents, pages, and S3 objects.","operationId":"delete_batch_api_batch__batch_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/{batch_id}/document/{document_id}":{"delete":{"tags":["Batch Processing"],"summary":"Delete Batch Document","description":"Delete a single document from a batch (pages, batch_document row, S3 objects).\nRemoves the batch row if this was the last document in the batch.","operationId":"delete_batch_document_api_batch__batch_id__document__document_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Batch Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Batch Processing"],"summary":"Update Document Pages","description":"Update all pages of a document at once.\nUseful for bulk updates after editing multiple pages.\n\nArgs:\n    batch_id: Batch UUID\n    document_id: Document UUID\n    pages: List of page objects with page_number and data to update\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    Update summary","operationId":"update_document_pages_api_batch__batch_id__document__document_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object"},"title":"Pages"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/status/{batch_id}":{"get":{"tags":["Batch Processing"],"summary":"Get Batch Status","description":"Get status of a batch and all its documents.\nUses Redis caching with 2-second TTL to reduce database load.\nSupports both authenticated users and guest mode.\n\nArgs:\n    batch_id: UUID of the batch\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    BatchStatusResponse with batch status and document details","operationId":"get_batch_status_api_batch_status__batch_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/results/{batch_id}":{"get":{"tags":["Batch Processing"],"summary":"Get Batch Results","description":"Get complete results for all documents in a batch.\nIncludes all pages with bounding boxes and structured data.\nSupports both authenticated users and guest mode.\nGuest users MUST provide guest_session_id for security.\n\nPagination params (optional, for large documents):\n  page_offset: start page index (default 0)\n  page_limit: max pages to return per document (default all)\nWhen paginated, response includes total_pages per document.","operationId":"get_batch_results_api_batch_results__batch_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/image/{s3_key}":{"get":{"tags":["Batch Processing"],"summary":"Get Batch Image","description":"Serve batch document images from S3 with authentication.\nAccepts token via query parameter for img src compatibility.\n\nArgs:\n    s3_key: S3 key for the image (path format: batches/{batch_id}/...)\n    token: Optional auth token from query param\n    s3_storage: S3 storage instance\n\nReturns:\n    Streaming response with image data","operationId":"get_batch_image_api_batch_image__s3_key__get","parameters":[{"name":"s3_key","in":"path","required":true,"schema":{"type":"string","title":"S3 Key"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/guest-session":{"get":{"tags":["Batch Processing"],"summary":"Create Guest Session","description":"Generate a new guest session ID for unauthenticated users.\nFrontend should store this in localStorage/cookie and send with uploads.\nAlso tracks IP address to prevent abuse (max 3 sessions per IP per day).\n\nReturns:\n    {\n        \"session_id\": \"guest_xxxxx\",\n        \"max_files\": 1,\n        \"max_pages\": 46,\n        \"message\": \"Guest session created. You can upload 1 file with up to 46 pages.\"\n    }","operationId":"create_guest_session_api_batch_guest_session_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/batch/guest-limits/{session_id}":{"get":{"tags":["Batch Processing"],"summary":"Get Guest Limits","description":"Check current usage and limits for a guest session.\n\nArgs:\n    session_id: Guest session ID\n\nReturns:\n    {\n        \"session_id\": \"guest_xxxxx\",\n        \"current_files\": 0,\n        \"current_pages\": 0,\n        \"max_files\": 1,\n        \"max_pages\": 46,\n        \"can_upload\": true,\n        \"message\": \"You have 1 file and 46 pages remaining.\"\n    }","operationId":"get_guest_limits_api_batch_guest_limits__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/history":{"get":{"tags":["Batch Processing"],"summary":"Get Batch History","description":"Get user's batch processing history.\nReturns list of batches with document counts and status.\nSupports both authenticated users and guest mode.\nGuest users MUST provide guest_session_id for session isolation.","operationId":"get_batch_history_api_batch_history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/{batch_id}/document/{document_id}/page/{page_number}":{"put":{"tags":["Batch Processing"],"summary":"Update Page Data","description":"Update extracted data for a specific page.\nAllows editing OCR results, bounding boxes, and structured data.\n\nArgs:\n    batch_id: Batch UUID\n    document_id: Document UUID\n    page_number: Page number (1-indexed)\n    update_data: Updated page data (extracted_text, bounding_boxes, structured_data)\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    Updated page data","operationId":"update_page_data_api_batch__batch_id__document__document_id__page__page_number__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"page_number","in":"path","required":true,"schema":{"type":"integer","title":"Page Number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/{batch_id}/document/{document_id}/automap":{"post":{"tags":["Batch Processing"],"summary":"Automap Document","description":"Aggregate data from multiple pages and map to Excel template fields.\n\nThis endpoint:\n1. Retrieves selected pages from the document\n2. Aggregates structured data across pages\n3. Uses OpenAI to intelligently map aggregated data to Excel fields\n4. Returns mapping suggestions with confidence scores","operationId":"automap_document_api_batch__batch_id__document__document_id__automap_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomapRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/{batch_id}/document/{document_id}/chat":{"post":{"tags":["Batch Processing"],"summary":"Mapping Chat","description":"AI chat assistant for finding and searching values in mapped documents.\n\nProcesses natural language queries like:\n- \"Find all total amounts\"\n- \"Show me invoice dates\"\n- \"Find the grand total\"\n- \"Search for company names\"\n\nReturns matching values with context and similarity scores.","operationId":"mapping_chat_api_batch__batch_id__document__document_id__chat_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/document-chat":{"post":{"tags":["Batch Processing"],"summary":"Document Ai Chat","description":"Agent-powered AI chat for document analysis with tools.\nUses Claude Sonnet via Bedrock with execute_python, generate_chart,\ngenerate_file, search_knowledge_base, and fetch_documents tools.\nStreams events via SSE.","operationId":"document_ai_chat_api_batch_document_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/batch/save-generated-file":{"post":{"tags":["Batch Processing"],"summary":"Save Generated File","description":"Save an AI-generated file to the library or send it to the parsing pipeline.\n\nActions:\n- save_to_library: Saves as an Excel template (for excel/csv) or stores the document\n- send_to_parsing: Creates a batch and triggers OCR processing","operationId":"save_generated_file_api_batch_save_generated_file_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveGeneratedFileRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/batch/{batch_id}/export/pdf":{"post":{"tags":["Batch Processing"],"summary":"Export To Pdf","description":"Generate a professional PDF export of structured data.\n\nArgs:\n    batch_id: Batch UUID\n    request: Export request containing document data\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    StreamingResponse with PDF file","operationId":"export_to_pdf_api_batch__batch_id__export_pdf_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/{batch_id}/export/docx":{"post":{"tags":["Batch Processing"],"summary":"Export To Docx","description":"Generate a professional DOCX export of structured data.\n\nArgs:\n    batch_id: Batch UUID\n    request: Export request containing document data\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    StreamingResponse with DOCX file","operationId":"export_to_docx_api_batch__batch_id__export_docx_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/match-schema":{"post":{"tags":["Batch Processing"],"summary":"Match Schema To Extracted","description":"Re-structure already-extracted document text using a schema.\nUses the same GPT-4o-mini flow as initial schema-based extraction,\nbut runs on the stored OCR text instead of re-running OCR.","operationId":"match_schema_to_extracted_api_batch_match_schema_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchSchemaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/document-chat/sessions":{"post":{"tags":["Batch Processing"],"summary":"Save Document Chat Session","operationId":"save_document_chat_session_api_batch_document_chat_sessions_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentChatSessionSave"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Batch Processing"],"summary":"List Document Chat Sessions","operationId":"list_document_chat_sessions_api_batch_document_chat_sessions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"}},{"name":"document_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"}},{"name":"document_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/document-chat/sessions/{session_id}":{"get":{"tags":["Batch Processing"],"summary":"Get Document Chat Session","operationId":"get_document_chat_session_api_batch_document_chat_sessions__session_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Batch Processing"],"summary":"Delete Document Chat Session","operationId":"delete_document_chat_session_api_batch_document_chat_sessions__session_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/url":{"post":{"tags":["Batch Processing"],"summary":"Upload Url","description":"Extract structured data from a web page URL.\nRenders the page with Playwright, takes screenshots (for the viewer),\nextracts text, and processes through the structuring pipeline.","operationId":"upload_url_api_batch_url_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_upload_url_api_batch_url_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/batch/web-update":{"post":{"tags":["Batch Processing"],"summary":"Web Update Field","description":"Quick fill: fill specific fields and return screenshot. No Claude mapping.","operationId":"web_update_field_api_batch_web_update_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/web-submit":{"post":{"tags":["Batch Processing"],"summary":"Web Submit Form","description":"Click the submit button on a web form and return the post-submit screenshot.","operationId":"web_submit_form_api_batch_web_submit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebSubmitRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/web-preview":{"post":{"tags":["Batch Processing"],"summary":"Web Preview","description":"Quick screenshot: open URL with Playwright, return first-viewport screenshot as base64.","operationId":"web_preview_api_batch_web_preview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebPreviewRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/web-scan":{"post":{"tags":["Batch Processing"],"summary":"Web Scan Form","description":"Quick scan: open URL with Playwright, extract form fields, return JSON.","operationId":"web_scan_form_api_batch_web_scan_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebScanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/web-fill":{"post":{"tags":["Batch Processing"],"summary":"Web Fill Form","description":"SSE endpoint: AI agent fills a web form using extracted document data.\nStreams screenshots + actions in real time.","operationId":"web_fill_form_api_batch_web_fill_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebFillRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/batch/documents/{doc_id}/convert/{format_type}":{"post":{"tags":["Batch Processing"],"summary":"Convert Document Format","description":"Generate a specific format (xml, csv, yaml, markdown, text) from a document's extracted data.\nSaves the result to the document's metadata and returns the content.","operationId":"convert_document_format_api_batch_documents__doc_id__convert__format_type__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}},{"name":"format_type","in":"path","required":true,"schema":{"type":"string","title":"Format Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/documents/{doc_id}/convert-all":{"post":{"tags":["Batch Processing"],"summary":"Convert All Formats","description":"Generate all formats (json, xml, csv, yaml, markdown, text) from a document's extracted data.\nSaves all results to the document's metadata and returns them.","operationId":"convert_all_formats_api_batch_documents__doc_id__convert_all_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cloud/google-drive/connect":{"post":{"tags":["cloud-storage"],"summary":"Connect Google Drive","description":"Complete Google Drive OAuth flow and save connection\n\nThis endpoint receives the authorization code from the frontend after user\nauthorizes the app, exchanges it for tokens, and saves the connection.","operationId":"connect_google_drive_api_cloud_google_drive_connect_post","parameters":[{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDriveAuthRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cloud/connections":{"get":{"tags":["cloud-storage"],"summary":"List Cloud Connections","description":"List all cloud storage connections for the current user","operationId":"list_cloud_connections_api_cloud_connections_get","parameters":[{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CloudConnectionResponse"},"title":"Response List Cloud Connections Api Cloud Connections Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cloud/connections/{connection_id}":{"delete":{"tags":["cloud-storage"],"summary":"Disconnect Cloud Connection","description":"Disconnect a cloud storage connection","operationId":"disconnect_cloud_connection_api_cloud_connections__connection_id__delete","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cloud/google-drive/{connection_id}/files":{"get":{"tags":["cloud-storage"],"summary":"List Google Drive Files","description":"List files from a Google Drive connection","operationId":"list_google_drive_files_api_cloud_google_drive__connection_id__files_get","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Page Size"}},{"name":"page_token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Token"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cloud/google-drive/{connection_id}/import":{"post":{"tags":["cloud-storage"],"summary":"Import Google Drive Files","description":"Import files from Google Drive and process them with OCR\n\nThis downloads files from Google Drive, uploads them to S3,\nand creates Document records that can be processed with OCR.","operationId":"import_google_drive_files_api_cloud_google_drive__connection_id__import_post","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportFilesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/excel/extract-schema":{"post":{"tags":["Excel Processing"],"summary":"Extract Schema","description":"Extract field schema from Excel file using AI-powered analysis.\nUses Claude Haiku to detect headers in any row, handles sparse sheets,\nformulas, and complex layouts.","operationId":"extract_schema_api_excel_extract_schema_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_schema_api_excel_extract_schema_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/excel/detect-mappings":{"post":{"tags":["Excel Processing"],"summary":"Detect Mappings","description":"Intelligently detect the best cell mappings for fields in an Excel template.\n\nUses OpenAI to analyze the Excel structure and suggest optimal cell placements\nfor each field based on existing labels and template structure.\n\nArgs:\n    request: Contains base64-encoded workbook and list of fields to map\n\nReturns:\n    DetectMappingsResponse with suggested field-to-cell mappings","operationId":"detect_mappings_api_excel_detect_mappings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/excel_routes__DetectMappingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/excel_routes__DetectMappingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/excel/detect-mappings-stream":{"post":{"tags":["Excel Processing"],"summary":"Detect Mappings Stream","description":"Stream Excel column mappings in real-time using Server-Sent Events.\n\nSupports two modes:\n1. template_id mode: Columns are fetched from KB (scalable for large templates)\n2. workbook mode: Columns are parsed from base64-encoded workbook (fallback)\n\nAs each column is filled by the parallel agents, events are sent to the client.","operationId":"detect_mappings_stream_api_excel_detect_mappings_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectMappingsStreamRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/excel/generate":{"post":{"tags":["Excel Processing"],"summary":"Generate Excel","description":"Generate Excel file from JSON data using MCP server.\n\nThis is the ONLY way to handle JSON to Excel conversions. The workflow is:\n1. User's document data is provided as JSON\n2. MCP service converts JSON to CSV\n3. If template provided, map fields to Excel template\n4. Return base64-encoded Excel file for download\n\nArgs:\n    request: Contains json_data, optional mappings, and optional template_workbook or template_id\n\nReturns:\n    GenerateExcelResponse with base64-encoded Excel file","operationId":"generate_excel_api_excel_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateExcelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateExcelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/excel/validations":{"post":{"tags":["Excel Processing"],"summary":"Extract Validations","description":"Lightweight endpoint: extract data validations (dropdowns) from an Excel file.\nReturns immediately without saving to S3 — used for instant dropdown display.","operationId":"extract_validations_api_excel_validations_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_validations_api_excel_validations_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/excel/templates/upload":{"post":{"tags":["Excel Processing"],"summary":"Upload Excel Template","description":"Upload and save an Excel template for future use.\nExtracts schema and stores file in S3.\nSupports both authenticated users and guest mode.\n\nArgs:\n    file: Excel file (.xlsx or .xls)\n    description: Optional description of the template\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    {\n        \"template_id\": \"uuid\",\n        \"name\": \"filename.xlsx\",\n        \"detected_fields\": [...],\n        \"s3_key\": \"excel_templates/...\"\n    }","operationId":"upload_excel_template_api_excel_templates_upload_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_excel_template_api_excel_templates_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/excel/templates":{"get":{"tags":["Excel Processing"],"summary":"List Excel Templates","description":"List user's saved Excel templates.\nSupports both authenticated users and guest mode.\n\nArgs:\n    current_user: Authenticated user (optional for guest mode)\n    limit: Maximum number of templates to return\n    excel_type: Filter by type ('template' or 'filled')\n\nReturns:\n    {\n        \"templates\": [\n            {\n                \"template_id\": \"uuid\",\n                \"name\": \"filename.xlsx\",\n                \"detected_fields\": [...],\n                \"excel_type\": \"template\" | \"filled\",\n                \"created_at\": \"2025-01-13T...\",\n                \"last_used_at\": \"2025-01-13T...\"\n            }\n        ]\n    }","operationId":"list_excel_templates_api_excel_templates_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"excel_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Excel Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/excel/templates/{template_id}/download":{"get":{"tags":["Excel Processing"],"summary":"Download Excel Template","description":"Download a saved Excel template file.\n\nArgs:\n    template_id: UUID of the template\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    StreamingResponse with Excel file","operationId":"download_excel_template_api_excel_templates__template_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/excel/templates/{template_id}":{"delete":{"tags":["Excel Processing"],"summary":"Delete Excel Template","description":"Soft delete a saved Excel template.","operationId":"delete_excel_template_api_excel_templates__template_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/excel/templates/{template_id}/preview":{"get":{"tags":["Excel Processing"],"summary":"Get Excel Preview","description":"Return a styled preview (with cell formatting) for an Excel template.\nUsed by the detail view to render the file with colors, fonts, etc.","operationId":"get_excel_preview_api_excel_templates__template_id__preview_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/excel/templates/save-filled":{"post":{"tags":["Excel Processing"],"summary":"Save Filled Excel","description":"Save a filled Excel file to the user's library.\n\nArgs:\n    request: Contains base64-encoded Excel content and metadata\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    {\n        \"success\": true,\n        \"template_id\": \"uuid\",\n        \"name\": \"filename.xlsx\",\n        \"message\": \"Filled Excel saved successfully\"\n    }","operationId":"save_filled_excel_api_excel_templates_save_filled_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveFilledExcelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/excel/ai-tool":{"post":{"tags":["Excel Processing"],"summary":"Excel Ai Tool","description":"SSE streaming endpoint for AI-powered Excel tools.\nThe agent uses openpyxl to create native charts, formulas, and data transforms.","operationId":"excel_ai_tool_api_excel_ai_tool_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExcelAIToolRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/excel/restore-snapshot":{"post":{"tags":["Excel Processing"],"summary":"Restore Snapshot","description":"Restore a workbook from a previously saved snapshot.\nCopies the snapshot bytes to the main S3 key and returns a fresh preview.","operationId":"restore_snapshot_api_excel_restore_snapshot_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreSnapshotRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/excel/templates/{template_id}/agent-rules":{"put":{"tags":["Excel Processing"],"summary":"Save Excel Agent Rules","description":"Save agent rules for an Excel template.","operationId":"save_excel_agent_rules_api_excel_templates__template_id__agent_rules_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Excel Processing"],"summary":"Get Excel Agent Rules","description":"Get agent rules for an Excel template.","operationId":"get_excel_agent_rules_api_excel_templates__template_id__agent_rules_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/upload":{"post":{"tags":["PDF Form Processing"],"summary":"Upload Pdf","description":"Upload a PDF file and extract its form fields.\n\nArgs:\n    file: PDF file to upload\n\nReturns:\n    {\n        \"success\": bool,\n        \"pdf\": str (base64),\n        \"fields\": List[PDFFormField],\n        \"page_count\": int,\n        \"is_fillable\": bool\n    }","operationId":"upload_pdf_api_pdf_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_pdf_api_pdf_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/pdf/extract-fields":{"post":{"tags":["PDF Form Processing"],"summary":"Extract Fields","description":"Extract form field schema from a PDF file.\n\nArgs:\n    file: PDF file\n\nReturns:\n    ExtractFieldsResponse with detected form fields","operationId":"extract_fields_api_pdf_extract_fields_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_fields_api_pdf_extract_fields_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractFieldsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/extract-schema":{"post":{"tags":["PDF Form Processing"],"summary":"Extract Schema From Pdf","description":"Extract an extraction schema from a fillable PDF form's AcroForm fields.\nConverts PDF form fields directly to schema format, then optionally\nenriches with AI for better descriptions.\n\nReturns the same format as /api/excel/extract-schema:\n{ success: bool, fields: [{ name, type, required, description }] }","operationId":"extract_schema_from_pdf_api_pdf_extract_schema_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_schema_from_pdf_api_pdf_extract_schema_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/detect-mappings-stream":{"post":{"tags":["PDF Form Processing"],"summary":"Detect Mappings Stream","description":"Stream field mappings in real-time using Server-Sent Events.\n\nAs each field is filled by the parallel agents, events are sent to the client.\nThis provides real-time UI updates during the form filling process.","operationId":"detect_mappings_stream_api_pdf_detect_mappings_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pdf_routes__DetectMappingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/retry-fields-stream":{"post":{"tags":["PDF Form Processing"],"summary":"Retry Fields Stream","description":"Retry specific fields with enhanced context about what went wrong.\nStreams results via SSE as each field is re-evaluated.","operationId":"retry_fields_stream_api_pdf_retry_fields_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryFieldsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/detect-mappings-debug":{"post":{"tags":["PDF Form Processing"],"summary":"Detect Mappings Debug","description":"Debug endpoint to inspect what's being received before Pydantic validation.","operationId":"detect_mappings_debug_api_pdf_detect_mappings_debug_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/pdf/detect-mappings":{"post":{"tags":["PDF Form Processing"],"summary":"Detect Mappings","description":"Use AI to intelligently map document data to PDF form fields.\n\nSupports two modes:\n1. Legacy: Single document via document_data field\n2. New: Multiple documents via documents array with schema descriptions\n\nThe new mode searches across all documents and returns alternatives.\n\nArgs:\n    request: Contains base64-encoded PDF and document data\n\nReturns:\n    DetectMappingsResponse with suggested field mappings and alternatives","operationId":"detect_mappings_api_pdf_detect_mappings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pdf_routes__DetectMappingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/pdf_routes__DetectMappingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/fill":{"post":{"tags":["PDF Form Processing"],"summary":"Fill Pdf","description":"Fill a PDF form with provided values.\n\nArgs:\n    request: Contains base64-encoded PDF and field values\n\nReturns:\n    FillPDFResponse with base64-encoded filled PDF","operationId":"fill_pdf_api_pdf_fill_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FillPDFRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FillPDFResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/preview":{"post":{"tags":["PDF Form Processing"],"summary":"Get Preview","description":"Generate a preview image of a PDF page.\n\nArgs:\n    request: Contains base64-encoded PDF and page number\n\nReturns:\n    PreviewResponse with base64-encoded PNG image","operationId":"get_preview_api_pdf_preview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/field-positions":{"post":{"tags":["PDF Form Processing"],"summary":"Get Field Positions","description":"Get the positions of form fields in the PDF for UI overlay.\n\nArgs:\n    file: PDF file (optional if pdf_content provided)\n    pdf_content: Base64-encoded PDF (optional if file provided)\n\nReturns:\n    Dict with field positions by page","operationId":"get_field_positions_api_pdf_field_positions_post","parameters":[{"name":"pdf_content","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Content"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_get_field_positions_api_pdf_field_positions_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/templates/upload":{"post":{"tags":["PDF Form Processing"],"summary":"Upload Pdf Template","description":"Upload and save a PDF form template for future use.\nExtracts form fields and stores file in S3.\n\nArgs:\n    file: PDF file\n    description: Optional description\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    {\n        \"template_id\": \"uuid\",\n        \"name\": \"filename.pdf\",\n        \"detected_fields\": [...],\n        \"page_count\": int,\n        \"s3_key\": \"pdf_templates/...\"\n    }","operationId":"upload_pdf_template_api_pdf_templates_upload_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_pdf_template_api_pdf_templates_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/templates/save-filled":{"post":{"tags":["PDF Form Processing"],"summary":"Save Filled Pdf","description":"Save a filled PDF to the user's library.\n\nThis saves the generated/filled PDF so users can access it later.\nIt's marked as pdf_type='filled' to distinguish from blank templates.\n\nArgs:\n    request: SaveFilledPDFRequest containing the filled PDF\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    {\n        \"success\": bool,\n        \"template_id\": \"uuid\",\n        \"name\": \"filename.pdf\",\n        \"pdf_type\": \"filled\"\n    }","operationId":"save_filled_pdf_api_pdf_templates_save_filled_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveFilledPDFRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/pdf/templates":{"get":{"tags":["PDF Form Processing"],"summary":"List Pdf Templates","description":"List user's saved PDF form templates.\n\nArgs:\n    current_user: Authenticated user (optional for guest mode)\n    limit: Maximum number of templates to return\n    pdf_type: Optional filter - 'template' for blank forms, 'filled' for generated forms\n\nReturns:\n    {\n        \"templates\": [\n            {\n                \"template_id\": \"uuid\",\n                \"name\": \"filename.pdf\",\n                \"pdf_type\": \"template\" or \"filled\",\n                \"detected_fields\": [...],\n                \"page_count\": int,\n                \"created_at\": \"2025-01-13T...\",\n                \"last_used_at\": \"2025-01-13T...\"\n            }\n        ]\n    }","operationId":"list_pdf_templates_api_pdf_templates_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"pdf_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/templates/{template_id}":{"get":{"tags":["PDF Form Processing"],"summary":"Get Pdf Template","description":"Get a specific PDF template's details and content.\n\nArgs:\n    template_id: UUID of the template\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    Template details including base64-encoded PDF content","operationId":"get_pdf_template_api_pdf_templates__template_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["PDF Form Processing"],"summary":"Delete Pdf Template","description":"Soft delete a PDF template.\n\nArgs:\n    template_id: UUID of the template\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    {\"success\": True}","operationId":"delete_pdf_template_api_pdf_templates__template_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/templates/{template_id}/download":{"get":{"tags":["PDF Form Processing"],"summary":"Download Pdf Template","description":"Download a saved PDF template file.\n\nArgs:\n    template_id: UUID of the template\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    StreamingResponse with PDF file","operationId":"download_pdf_template_api_pdf_templates__template_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/templates/{template_id}/thumbnail":{"get":{"tags":["PDF Form Processing"],"summary":"Get Pdf Thumbnail","description":"Get the thumbnail image for a PDF template.\nAccepts token via query parameter for <img src> compatibility.\n\nArgs:\n    template_id: UUID of the template\n    token: Optional auth token from query param (for img src usage)\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    StreamingResponse with PNG image","operationId":"get_pdf_thumbnail_api_pdf_templates__template_id__thumbnail_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/templates/{template_id}/custom-fields":{"put":{"tags":["PDF Form Processing"],"summary":"Save Custom Fields","description":"Save custom fields (positions + descriptions) for a non-fillable PDF template.","operationId":"save_custom_fields_api_pdf_templates__template_id__custom_fields_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveCustomFieldsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["PDF Form Processing"],"summary":"Get Custom Fields","description":"Load custom fields for a template.","operationId":"get_custom_fields_api_pdf_templates__template_id__custom_fields_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/templates/{template_id}/field-descriptions":{"put":{"tags":["PDF Form Processing"],"summary":"Save Field Descriptions","description":"Save/update field descriptions for a fillable PDF template.","operationId":"save_field_descriptions_api_pdf_templates__template_id__field_descriptions_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveFieldDescriptionsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["PDF Form Processing"],"summary":"Get Field Descriptions","description":"Load persisted field descriptions for a template.","operationId":"get_field_descriptions_api_pdf_templates__template_id__field_descriptions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/templates/{template_id}/agent-rules":{"put":{"tags":["PDF Form Processing"],"summary":"Save Agent Rules","description":"Save agent rules for a PDF template.","operationId":"save_agent_rules_api_pdf_templates__template_id__agent_rules_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["PDF Form Processing"],"summary":"Get Agent Rules","description":"Get agent rules for a PDF template.","operationId":"get_agent_rules_api_pdf_templates__template_id__agent_rules_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/templates/{template_id}/ocr-region":{"post":{"tags":["PDF Form Processing"],"summary":"Ocr Pdf Region","description":"OCR a specific region of a PDF page to auto-suggest field description.","operationId":"ocr_pdf_region_api_pdf_templates__template_id__ocr_region_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OCRRegionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pdf/fill-overlay":{"post":{"tags":["PDF Form Processing"],"summary":"Fill Pdf Overlay","description":"Fill a non-fillable PDF by stamping text at specified coordinates.","operationId":"fill_pdf_overlay_api_pdf_fill_overlay_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FillOverlayRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/templates/":{"post":{"tags":["Extraction Templates"],"summary":"Create Extraction Template","description":"Create a new extraction template.\nSupports both authenticated users and guest mode.\n\nArgs:\n    request: Template data (name, description, fields)\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    Created template with ID","operationId":"create_extraction_template_api_templates__post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTemplateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Extraction Templates"],"summary":"List Extraction Templates","description":"List user's extraction templates.\nSupports both authenticated users and guest mode.\n\nArgs:\n    current_user: Authenticated user (optional for guest mode)\n    limit: Maximum number of templates to return\n\nReturns:\n    List of templates","operationId":"list_extraction_templates_api_templates__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/import":{"post":{"tags":["Extraction Templates"],"summary":"Import Extraction Template","description":"Import an extraction template from a JSON file.","operationId":"import_extraction_template_api_templates_import_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_extraction_template_api_templates_import_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/templates/{template_id}/export":{"get":{"tags":["Extraction Templates"],"summary":"Export Extraction Template","description":"Export an extraction template as a downloadable JSON schema file.","operationId":"export_extraction_template_api_templates__template_id__export_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/{template_id}":{"get":{"tags":["Extraction Templates"],"summary":"Get Extraction Template","description":"Get a specific extraction template by ID.\n\nArgs:\n    template_id: Template UUID\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    Template details","operationId":"get_extraction_template_api_templates__template_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Extraction Templates"],"summary":"Update Extraction Template","description":"Update an existing extraction template.\n\nArgs:\n    template_id: Template UUID\n    request: Updated template data\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    Updated template","operationId":"update_extraction_template_api_templates__template_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTemplateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Extraction Templates"],"summary":"Delete Extraction Template","description":"Soft delete an extraction template.\n\nArgs:\n    template_id: Template UUID\n    current_user: Authenticated user (optional for guest mode)\n\nReturns:\n    Success message","operationId":"delete_extraction_template_api_templates__template_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/generate-schema":{"post":{"tags":["Extraction Templates"],"summary":"Generate Schema","description":"Conversational schema generator using AI agent.\nStreams events via SSE: token, schema_update, done.","operationId":"generate_schema_api_templates_generate_schema_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaGeneratorRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/templates/save-generated-schema":{"post":{"tags":["Extraction Templates"],"summary":"Save Generated Schema","description":"Save a generated schema as an ExtractionTemplate.","operationId":"save_generated_schema_api_templates_save_generated_schema_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Request"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/document/edit-visual":{"post":{"tags":["Gemini Document Editor"],"summary":"Edit Document Visual","description":"Visually edit a document using Gemini 2.5 Flash Image API\n\nThis endpoint:\n1. Receives a document image + list of field changes\n2. Builds an intelligent prompt with strict formatting preservation\n3. Calls Gemini 2.5 Flash Image to generate edited version\n4. Saves edited document to S3 with 'edited' metadata\n5. Returns document metadata with S3 URL for download\n\nExample request:\n```\nPOST /api/document/edit-visual\nContent-Type: multipart/form-data\n\nfile: [document.jpg]\nchanges: [\n    {\"fieldName\": \"Name\", \"oldValue\": \"Andres\", \"newValue\": \"Fernando\"},\n    {\"fieldName\": \"Total\", \"oldValue\": \"100.00\", \"newValue\": \"150.00\"}\n]\nuser_id: \"user_123\"\noriginal_document_id: \"doc_456\" (optional)\n```\n\nArgs:\n    file: Document image file to edit\n    changes: JSON string of field changes [{fieldName, oldValue, newValue}]\n    user_id: User ID for S3 file organization\n    original_document_id: Optional original document ID for tracking\n    s3_storage: S3Storage instance (injected)\n\nReturns:\n    JSON with edited document metadata:\n    - document_id: Unique ID for edited document\n    - s3_url: Download URL for edited document\n    - s3_key: S3 storage key\n    - is_edited: True (tagged as edited)\n    - changes_applied: Number of field changes\n    - changes: List of changes applied\n\nRaises:\n    HTTPException: If Gemini API call fails or invalid input","operationId":"edit_document_visual_api_document_edit_visual_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_edit_document_visual_api_document_edit_visual_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/document/test-gemini":{"get":{"tags":["Gemini Document Editor"],"summary":"Test Gemini Connection","description":"Test endpoint to verify Gemini API is configured correctly\n\nReturns:\n    JSON with Gemini availability status","operationId":"test_gemini_connection_api_document_test_gemini_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/precision/retry":{"post":{"tags":["Precision Retry"],"summary":"Retry With Precision","description":"Retry document processing with enhanced Gemini vision\n\nThis endpoint:\n1. Accepts a list of document IDs to retry\n2. Fetches original images from S3\n3. Processes with Gemini 2.5 Flash for best accuracy\n4. Updates database with improved structured data\n5. Returns updated results\n\nExample request:\n```\nPOST /api/precision/retry\n{\n    \"document_ids\": [\"doc-id-1\", \"doc-id-2\"],\n    \"batch_id\": \"batch-id-123\",\n    \"apply_to_all_pages\": false\n}\n```\n\nReturns:\n    List of results for each document processed","operationId":"retry_with_precision_api_precision_retry_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/precision_retry_routes__RetryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/databases/supported-types":{"get":{"tags":["Database Connections"],"summary":"Get Supported Database Types","description":"Get list of supported database types from Turbular MCP\n\nReturns:\n    List of supported database types (PostgreSQL, MySQL, BigQuery, etc.)","operationId":"get_supported_database_types_api_databases_supported_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/databases/":{"get":{"tags":["Database Connections"],"summary":"List Database Connections","description":"List all database connections for the current user\n\nReturns:\n    List of database connections (without sensitive connection details)","operationId":"list_database_connections_api_databases__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DatabaseConnectionResponse"},"type":"array","title":"Response List Database Connections Api Databases  Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Database Connections"],"summary":"Create Database Connection","description":"Create a new database connection\n\nNOTE: Connection credentials are stored in connection_config.\nTODO: Implement encryption for sensitive fields (password, etc.)","operationId":"create_database_connection_api_databases__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatabaseConnectionCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatabaseConnectionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/databases/{connection_id}":{"get":{"tags":["Database Connections"],"summary":"Get Database Connection","description":"Get a specific database connection by ID","operationId":"get_database_connection_api_databases__connection_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatabaseConnectionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Database Connections"],"summary":"Update Database Connection","description":"Update a database connection","operationId":"update_database_connection_api_databases__connection_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatabaseConnectionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatabaseConnectionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Database Connections"],"summary":"Delete Database Connection","description":"Delete a database connection","operationId":"delete_database_connection_api_databases__connection_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/databases/{connection_id}/details":{"get":{"tags":["Database Connections"],"summary":"Get Database Connection Details","description":"Get database connection details including config (password masked)","operationId":"get_database_connection_details_api_databases__connection_id__details_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatabaseConnectionDetailsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/databases/{connection_id}/test":{"post":{"tags":["Database Connections"],"summary":"Test Database Connection","description":"Test database connection by attempting to connect via Turbular MCP\n\nThis validates that the connection credentials are correct and the database is accessible","operationId":"test_database_connection_api_databases__connection_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/databases/{connection_id}/connect":{"post":{"tags":["Database Connections"],"summary":"Connect Database","description":"Mark database connection as connected (activate it)\n\nThis tests the connection and if successful, marks it as connected.","operationId":"connect_database_api_databases__connection_id__connect_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/databases/{connection_id}/disconnect":{"post":{"tags":["Database Connections"],"summary":"Disconnect Database","description":"Mark database connection as disconnected (deactivate it)","operationId":"disconnect_database_api_databases__connection_id__disconnect_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/databases/{connection_id}/schema":{"post":{"tags":["Database Connections"],"summary":"Get Database Schema","description":"Get database schema via Turbular MCP\n\nArgs:\n    connection_id: Database connection ID\n    return_normalized: Return LLM-friendly normalized schema\n\nReturns:\n    Database schema (tables, columns, types)","operationId":"get_database_schema_api_databases__connection_id__schema_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}},{"name":"return_normalized","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Return Normalized"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/databases/{connection_id}/schema/async":{"post":{"tags":["Database Connections"],"summary":"Start Async Schema Load","description":"Start asynchronous schema loading for large databases.\n\nReturns a task_id that can be used to check the loading status.\nThis is useful for very large databases where schema loading may take several minutes.","operationId":"start_async_schema_load_api_databases__connection_id__schema_async_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}},{"name":"return_normalized","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Return Normalized"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/databases/{connection_id}/schema/status/{task_id}":{"get":{"tags":["Database Connections"],"summary":"Get Schema Load Status","description":"Check the status of an async schema loading task.\n\nReturns the current status, and the result if completed.","operationId":"get_schema_load_status_api_databases__connection_id__schema_status__task_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/databases/{connection_id}/schema/cache":{"delete":{"tags":["Database Connections"],"summary":"Clear Schema Cache","description":"Clear the cached schema for a database connection.\n\nUse this to force a fresh schema reload.","operationId":"clear_schema_cache_api_databases__connection_id__schema_cache_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/databases/{connection_id}/tables":{"get":{"tags":["Database Connections"],"summary":"Get Table List","description":"Get list of tables in the database (fast query, no full schema).\n\nThis is much faster than loading the full schema for large databases.\nReturns just table names which can then be expanded on demand.","operationId":"get_table_list_api_databases__connection_id__tables_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}},{"name":"schema_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/databases/{connection_id}/tables/{table_name}/columns":{"get":{"tags":["Database Connections"],"summary":"Get Table Columns","description":"Get columns for a specific table (fast query).\n\nUse this to load table details on demand instead of loading entire schema.","operationId":"get_table_columns_api_databases__connection_id__tables__table_name__columns_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}},{"name":"table_name","in":"path","required":true,"schema":{"type":"string","title":"Table Name"}},{"name":"schema_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/databases/{connection_id}/query":{"post":{"tags":["Database Connections"],"summary":"Execute Database Query","description":"Execute SQL query on database via Turbular MCP\n\nArgs:\n    connection_id: Database connection ID\n    query_request: Query string and max rows\n\nReturns:\n    Query results","operationId":"execute_database_query_api_databases__connection_id__query_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/databases/{connection_id}/extract":{"post":{"tags":["Database Connections"],"summary":"Extract Structured Data","description":"Extract data from database and optionally structure it with AI\n\nSimilar to document extraction, but from database queries\n\nArgs:\n    connection_id: Database connection ID\n    extract_request: Query, max rows, and AI structuring option\n\nReturns:\n    Raw query results + AI-structured data (if requested)","operationId":"extract_structured_data_api_databases__connection_id__extract_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/databases/fill":{"post":{"tags":["Database Connections"],"summary":"Fill Database","description":"Fill/insert data into database with optional auto-mapping\n\nSimilar to Excel filling, but for databases\n\nArgs:\n    fill_request: Connection ID, table name, data, and auto-mapping option\n\nReturns:\n    Insert results","operationId":"fill_database_api_databases_fill_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FillRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/workflows/node-definitions":{"get":{"tags":["Workflows"],"summary":"Get Available Nodes","description":"Get all available node type definitions for the workflow builder.\n\nReturns the ComfyUI-style node definitions with:\n- inputs: Named typed input slots\n- outputs: Named typed output slots\n- widgets: Configuration widgets with values\n- category: Node category for grouping","operationId":"get_available_nodes_api_workflows_node_definitions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/workflows/mini-agent/configure":{"post":{"tags":["Workflows"],"summary":"Configure Mini Agent","description":"Infer Mini Agent node metadata from a natural-language prompt.","operationId":"configure_mini_agent_api_workflows_mini_agent_configure_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MiniAgentConfigureRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/workflows":{"get":{"tags":["Workflows"],"summary":"List Workflows","description":"List all workflows for the current user.\n\nQuery Parameters:\n    - workflow_type: Filter by workflow type (extract, fill, split, etc.)\n    - is_template: Filter by template status\n    - is_active: Filter by active status (default: True)\n\nReturns:\n    List of workflows ordered by last updated","operationId":"list_workflows_api_workflows_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Type"}},{"name":"is_template","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Template"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":true,"title":"Is Active"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowResponse"},"title":"Response List Workflows Api Workflows Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Workflows"],"summary":"Create Workflow","description":"Create a new workflow.\n\nRequest Body:\n    - name: Workflow name\n    - description: Optional description\n    - workflow_type: Type of workflow (extract, fill, split, etc.)\n    - nodes: List of workflow nodes\n    - edges: List of workflow edges\n    - is_template: Whether this is a reusable template\n    - metadata_json: Additional metadata\n\nReturns:\n    Created workflow","operationId":"create_workflow_api_workflows_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/{workflow_id}":{"get":{"tags":["Workflows"],"summary":"Get Workflow","description":"Get a specific workflow by ID.\n\nPath Parameters:\n    - workflow_id: UUID of the workflow\n\nReturns:\n    Workflow details","operationId":"get_workflow_api_workflows__workflow_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Workflows"],"summary":"Update Workflow","description":"Update an existing workflow.\n\nPath Parameters:\n    - workflow_id: UUID of the workflow\n\nRequest Body:\n    - name: Optional new name\n    - description: Optional new description\n    - nodes: Optional new nodes\n    - edges: Optional new edges\n    - is_active: Optional active status\n    - is_template: Optional template status\n    - metadata_json: Optional metadata\n\nReturns:\n    Updated workflow","operationId":"update_workflow_api_workflows__workflow_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Workflows"],"summary":"Delete Workflow","description":"Delete a workflow.\n\nPath Parameters:\n    - workflow_id: UUID of the workflow\n\nReturns:\n    Success message","operationId":"delete_workflow_api_workflows__workflow_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/{workflow_id}/save-and-execute":{"post":{"tags":["Workflows"],"summary":"Save And Execute Workflow","description":"Update a workflow snapshot and immediately execute it in one request.","operationId":"save_and_execute_workflow_api_workflows__workflow_id__save_and_execute_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/{workflow_id}/execute":{"post":{"tags":["Workflows"],"summary":"Execute Workflow","description":"Execute a workflow.\n\nPath Parameters:\n    - workflow_id: UUID of the workflow to execute\n\nRequest Body:\n    - parameters: Optional execution parameters\n\nReturns:\n    Execution details (will be in 'running' status initially)\n\nNote: This starts the execution and returns immediately.\n      Use GET /workflows/{id}/executions/{execution_id} to check progress.","operationId":"execute_workflow_api_workflows__workflow_id__execute_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/{workflow_id}/executions":{"get":{"tags":["Workflows"],"summary":"List Executions","description":"Get execution history for a workflow.\n\nPath Parameters:\n    - workflow_id: UUID of the workflow\n\nQuery Parameters:\n    - limit: Maximum number of executions to return (default: 50)\n\nReturns:\n    List of workflow executions ordered by most recent","operationId":"list_executions_api_workflows__workflow_id__executions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExecutionResponse"},"title":"Response List Executions Api Workflows  Workflow Id  Executions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/{workflow_id}/executions/{execution_id}":{"get":{"tags":["Workflows"],"summary":"Get Execution","description":"Get details of a specific workflow execution.\n\nPath Parameters:\n    - workflow_id: UUID of the workflow\n    - execution_id: UUID of the execution\n\nReturns:\n    Execution details including logs and results","operationId":"get_execution_api_workflows__workflow_id__executions__execution_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"execution_id","in":"path","required":true,"schema":{"type":"string","title":"Execution Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/{workflow_id}/executions/{execution_id}/cancel":{"post":{"tags":["Workflows"],"summary":"Cancel Execution","description":"Cancel a running workflow execution.\n\nPath Parameters:\n    - workflow_id: UUID of the workflow\n    - execution_id: UUID of the execution to cancel\n\nReturns:\n    Success message","operationId":"cancel_execution_api_workflows__workflow_id__executions__execution_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"execution_id","in":"path","required":true,"schema":{"type":"string","title":"Execution Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/chat":{"post":{"tags":["Workflows"],"summary":"Workflow Ai Chat","description":"AI chat endpoint for workflow generation and modification.\nUses Claude Sonnet via Bedrock with generate_workflow and modify_workflow tools.\nStreams events via SSE.","operationId":"workflow_ai_chat_api_workflows_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/workflows/chat/sessions":{"get":{"tags":["Workflows"],"summary":"List Chat Sessions","description":"List all chat sessions for the current user.","operationId":"list_chat_sessions_api_workflows_chat_sessions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Workflows"],"summary":"Save Chat Session","description":"Save or update a workflow AI chat session.","operationId":"save_chat_session_api_workflows_chat_sessions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionSave"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/workflows/chat/sessions/{session_id}":{"get":{"tags":["Workflows"],"summary":"Get Chat Session","description":"Get a specific chat session with full messages.","operationId":"get_chat_session_api_workflows_chat_sessions__session_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Workflows"],"summary":"Delete Chat Session","description":"Delete a chat session.","operationId":"delete_chat_session_api_workflows_chat_sessions__session_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/email-inbox/my-address":{"get":{"tags":["email-inbox"],"summary":"Get My Upload Address","description":"Get the user's unique upload email address.\nCreates one if it doesn't exist.","operationId":"get_my_upload_address_api_email_inbox_my_address_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadEmailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/email-inbox/emails":{"get":{"tags":["email-inbox"],"summary":"List Received Emails","description":"List received emails for the current user.\nSupports filtering by sender, subject, and read status.","operationId":"list_received_emails_api_email_inbox_emails_get","parameters":[{"name":"sender_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Filter"}},{"name":"subject_contains","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Contains"}},{"name":"unread_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unread Only"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReceivedEmailSummary"},"title":"Response List Received Emails Api Email Inbox Emails Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/email-inbox/emails/{email_id}":{"get":{"tags":["email-inbox"],"summary":"Get Email Detail","description":"Get detailed email with attachments","operationId":"get_email_detail_api_email_inbox_emails__email_id__get","parameters":[{"name":"email_id","in":"path","required":true,"schema":{"type":"string","title":"Email Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceivedEmailDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/email-inbox/emails/{email_id}/mark-read":{"post":{"tags":["email-inbox"],"summary":"Mark Email Read","description":"Mark an email as read","operationId":"mark_email_read_api_email_inbox_emails__email_id__mark_read_post","parameters":[{"name":"email_id","in":"path","required":true,"schema":{"type":"string","title":"Email Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/email-inbox/allowed-senders":{"get":{"tags":["email-inbox"],"summary":"List Allowed Senders","description":"List all allowed senders for this user","operationId":"list_allowed_senders_api_email_inbox_allowed_senders_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AllowedSenderResponse"},"title":"Response List Allowed Senders Api Email Inbox Allowed Senders Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["email-inbox"],"summary":"Add Allowed Sender","description":"Add a new allowed sender","operationId":"add_allowed_sender_api_email_inbox_allowed_senders_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedSenderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedSenderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/email-inbox/allowed-senders/{sender_id}":{"delete":{"tags":["email-inbox"],"summary":"Remove Allowed Sender","description":"Remove an allowed sender","operationId":"remove_allowed_sender_api_email_inbox_allowed_senders__sender_id__delete","parameters":[{"name":"sender_id","in":"path","required":true,"schema":{"type":"string","title":"Sender Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/email-inbox/webhook/ses":{"post":{"tags":["email-inbox"],"summary":"Ses Webhook","description":"Webhook endpoint for AWS SES to deliver incoming emails.\n\nSES can be configured to:\n1. Store email in S3, then trigger SNS -> this endpoint\n2. Or directly call this endpoint with email data (smaller emails only)\n\nPRODUCTION SETUP:\n- Configure SES receipt rule to call this endpoint via SNS\n- Or use Lambda to process S3 stored emails and call this endpoint","operationId":"ses_webhook_api_email_inbox_webhook_ses_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/organizations":{"post":{"tags":["Admin"],"summary":"Create Organization","description":"Create a new organization (user becomes owner)","operationId":"create_organization_api_admin_organizations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganizationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/organizations/me":{"get":{"tags":["Admin"],"summary":"Get My Organization","description":"Get current user's organization","operationId":"get_my_organization_api_admin_organizations_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationResponse"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["Admin"],"summary":"Update My Organization","description":"Update organization (owner only)","operationId":"update_my_organization_api_admin_organizations_me_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrganizationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/teams":{"get":{"tags":["Admin"],"summary":"List Teams","description":"List all teams in user's organization","operationId":"list_teams_api_admin_teams_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TeamResponse"},"type":"array","title":"Response List Teams Api Admin Teams Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Admin"],"summary":"Create Team","description":"Create a new team (org owner only)","operationId":"create_team_api_admin_teams_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/developer_routes__CreateTeamRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/teams/{team_id}":{"get":{"tags":["Admin"],"summary":"Get Team","description":"Get team details","operationId":"get_team_api_admin_teams__team_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Admin"],"summary":"Update Team","description":"Update team details (admin/owner only)","operationId":"update_team_api_admin_teams__team_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTeamRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Admin"],"summary":"Delete Team","description":"Delete a team (org owner only)","operationId":"delete_team_api_admin_teams__team_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/teams/{team_id}/members":{"get":{"tags":["Admin"],"summary":"List Team Members","description":"List all members in a team","operationId":"list_team_members_api_admin_teams__team_id__members_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MemberResponse"},"title":"Response List Team Members Api Admin Teams  Team Id  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/teams/{team_id}/invite":{"post":{"tags":["Admin"],"summary":"Invite Member","description":"Invite a user to join a team","operationId":"invite_member_api_admin_teams__team_id__invite_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/organization_routes__InviteMemberRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/invitations/{membership_id}/accept":{"post":{"tags":["Admin"],"summary":"Accept Invitation","description":"Accept a team invitation","operationId":"accept_invitation_api_admin_invitations__membership_id__accept_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"membership_id","in":"path","required":true,"schema":{"type":"string","title":"Membership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/invitations/{membership_id}/decline":{"post":{"tags":["Admin"],"summary":"Decline Invitation","description":"Decline a team invitation","operationId":"decline_invitation_api_admin_invitations__membership_id__decline_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"membership_id","in":"path","required":true,"schema":{"type":"string","title":"Membership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/invitations/pending":{"get":{"tags":["Admin"],"summary":"Get Pending Invitations","description":"Get all pending invitations for current user","operationId":"get_pending_invitations_api_admin_invitations_pending_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"object"},"type":"array","title":"Response Get Pending Invitations Api Admin Invitations Pending Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/teams/{team_id}/members/{membership_id}/role":{"put":{"tags":["Admin"],"summary":"Update Member Role","description":"Update a team member's role","operationId":"update_member_role_api_admin_teams__team_id__members__membership_id__role_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"membership_id","in":"path","required":true,"schema":{"type":"string","title":"Membership Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberRoleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/teams/{team_id}/members/{membership_id}":{"delete":{"tags":["Admin"],"summary":"Remove Member","description":"Remove a member from a team","operationId":"remove_member_api_admin_teams__team_id__members__membership_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"membership_id","in":"path","required":true,"schema":{"type":"string","title":"Membership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/me/team":{"get":{"tags":["Admin"],"summary":"Get My Team","description":"Get current user's team membership info","operationId":"get_my_team_api_admin_me_team_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/TeamMembershipResponse"},{"type":"null"}],"title":"Response Get My Team Api Admin Me Team Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/sharing/documents":{"post":{"tags":["Sharing"],"summary":"Share Document","description":"Share a document/batch with a team or user","operationId":"share_document_api_sharing_documents_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareDocumentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentShareResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/sharing/documents/{share_id}":{"delete":{"tags":["Sharing"],"summary":"Revoke Document Share","description":"Revoke a document share","operationId":"revoke_document_share_api_sharing_documents__share_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"share_id","in":"path","required":true,"schema":{"type":"string","title":"Share Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sharing/documents/shared-by-me":{"get":{"tags":["Sharing"],"summary":"List Documents Shared By Me","description":"List all documents shared by current user","operationId":"list_documents_shared_by_me_api_sharing_documents_shared_by_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DocumentShareResponse"},"type":"array","title":"Response List Documents Shared By Me Api Sharing Documents Shared By Me Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/sharing/documents/shared-with-me":{"get":{"tags":["Sharing"],"summary":"List Documents Shared With Me","description":"List all documents shared with current user (directly or via team)","operationId":"list_documents_shared_with_me_api_sharing_documents_shared_with_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SharedDocumentResponse"},"type":"array","title":"Response List Documents Shared With Me Api Sharing Documents Shared With Me Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/sharing/workflows":{"post":{"tags":["Sharing"],"summary":"Share Workflow","description":"Share a workflow with a team or user","operationId":"share_workflow_api_sharing_workflows_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareWorkflowRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowShareResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/sharing/workflows/{share_id}":{"delete":{"tags":["Sharing"],"summary":"Revoke Workflow Share","description":"Revoke a workflow share","operationId":"revoke_workflow_share_api_sharing_workflows__share_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"share_id","in":"path","required":true,"schema":{"type":"string","title":"Share Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sharing/workflows/shared-with-me":{"get":{"tags":["Sharing"],"summary":"List Workflows Shared With Me","description":"List all workflows shared with current user (directly or via team)","operationId":"list_workflows_shared_with_me_api_sharing_workflows_shared_with_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SharedWorkflowResponse"},"type":"array","title":"Response List Workflows Shared With Me Api Sharing Workflows Shared With Me Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/dashboard/stats":{"get":{"tags":["Admin Dashboard"],"summary":"Get Team Stats","description":"Get team usage statistics (admin/owner only)","operationId":"get_team_stats_api_admin_dashboard_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamUsageStats"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/dashboard/user/{user_id}/stats":{"get":{"tags":["Admin Dashboard"],"summary":"Get User Stats","description":"Get stats for a specific team member (admin/owner only)","operationId":"get_user_stats_api_admin_dashboard_user__user_id__stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUsageStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/members":{"get":{"tags":["Admin Dashboard"],"summary":"Get Team Members Summary","description":"Get summary of all team members with their activity stats","operationId":"get_team_members_summary_api_admin_dashboard_members_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TeamMemberSummary"},"type":"array","title":"Response Get Team Members Summary Api Admin Dashboard Members Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/dashboard/documents":{"get":{"tags":["Admin Dashboard"],"summary":"Get Team Documents","description":"Get all documents from team members (admin/owner only)","operationId":"get_team_documents_api_admin_dashboard_documents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TeamDocumentResponse"},"title":"Response Get Team Documents Api Admin Dashboard Documents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/workflows":{"get":{"tags":["Admin Dashboard"],"summary":"Get Team Workflows","description":"Get all workflows from team members (admin/owner only)","operationId":"get_team_workflows_api_admin_dashboard_workflows_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TeamWorkflowResponse"},"title":"Response Get Team Workflows Api Admin Dashboard Workflows Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/executions":{"get":{"tags":["Admin Dashboard"],"summary":"Get Team Workflow Executions","description":"Get workflow execution history for team (admin/owner only)","operationId":"get_team_workflow_executions_api_admin_dashboard_executions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"workflow_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowExecutionResponse"},"title":"Response Get Team Workflow Executions Api Admin Dashboard Executions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/activity":{"get":{"tags":["Admin Dashboard"],"summary":"Get Team Activity","description":"Get recent activity feed for team (admin/owner only)","operationId":"get_team_activity_api_admin_dashboard_activity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TeamActivityResponse"},"title":"Response Get Team Activity Api Admin Dashboard Activity Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/workflows/{workflow_id}/execute":{"post":{"tags":["Admin Dashboard"],"summary":"Execute Workflow As Admin","description":"Execute a team member's workflow as admin.\nThe execution is recorded under the admin's user ID.","operationId":"execute_workflow_as_admin_api_admin_dashboard_workflows__workflow_id__execute_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/platform/stats":{"get":{"tags":["Admin Dashboard"],"summary":"Get Platform Stats","description":"Platform-wide statistics — total users, orgs, documents, etc.\nProtected by X-Platform-Secret header (not regular auth).","operationId":"get_platform_stats_api_admin_dashboard_platform_stats_get","parameters":[{"name":"x-platform-secret","in":"header","required":false,"schema":{"type":"string","title":"X-Platform-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/platform/users":{"get":{"tags":["Admin Dashboard"],"summary":"Get Platform Users","description":"List ALL registered users with full details + document/file counts.\nSort options: docs_desc (most files first), docs_asc (least first), newest, oldest.\nProtected by X-Platform-Secret header.","operationId":"get_platform_users_api_admin_dashboard_platform_users_get","parameters":[{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"docs_desc","title":"Sort"}},{"name":"x-platform-secret","in":"header","required":false,"schema":{"type":"string","title":"X-Platform-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/schedules/":{"get":{"tags":["schedules"],"summary":"List Schedules","description":"List all scheduled workflows for the current user","operationId":"list_schedules_api_schedules__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["schedules"],"summary":"Create Schedule","description":"Create a new schedule for a workflow","operationId":"create_schedule_api_schedules__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/schedules/{schedule_id}":{"get":{"tags":["schedules"],"summary":"Get Schedule","description":"Get a specific schedule","operationId":"get_schedule_api_schedules__schedule_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["schedules"],"summary":"Update Schedule","description":"Update a schedule","operationId":"update_schedule_api_schedules__schedule_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["schedules"],"summary":"Delete Schedule","description":"Delete a schedule","operationId":"delete_schedule_api_schedules__schedule_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/schedules/{schedule_id}/toggle":{"post":{"tags":["schedules"],"summary":"Toggle Schedule","description":"Toggle schedule enabled/disabled","operationId":"toggle_schedule_api_schedules__schedule_id__toggle_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/schedules/{schedule_id}/run-now":{"post":{"tags":["schedules"],"summary":"Run Schedule Now","description":"Manually trigger a scheduled workflow","operationId":"run_schedule_now_api_schedules__schedule_id__run_now_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/schedules/webhooks/":{"get":{"tags":["schedules"],"summary":"List Webhooks","description":"List all webhook triggers for the current user","operationId":"list_webhooks_api_schedules_webhooks__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["schedules"],"summary":"Create Webhook","description":"Create a webhook trigger for a workflow","operationId":"create_webhook_api_schedules_webhooks__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/schedules/webhooks/{webhook_id}":{"delete":{"tags":["schedules"],"summary":"Delete Webhook","description":"Delete a webhook trigger","operationId":"delete_webhook_api_schedules_webhooks__webhook_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/schedules/trigger/{webhook_token}":{"post":{"tags":["schedules"],"summary":"Trigger Webhook","description":"Public endpoint to trigger a workflow via webhook.\nRuns the workflow synchronously and returns actual results.\n\nAccepts:\n- JSON body: {\"fields\": {...}, \"rows\": [...], \"metadata\": {...}}\n- Multipart form-data: \"payload\" (JSON string) + \"file\" (file upload)\n- No body: Just triggers the workflow without data\n\nReturns:\n- status: \"success\" or \"error\"\n- execution_id: UUID of the execution record\n- results: Output from each node in the workflow\n- execution_time_ms: How long the workflow took to run","operationId":"trigger_webhook_api_schedules_trigger__webhook_token__post","parameters":[{"name":"webhook_token","in":"path","required":true,"schema":{"type":"string","title":"Webhook Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/schedules/webhooks/{webhook_id}/field-defaults":{"put":{"tags":["schedules"],"summary":"Update Webhook Field Defaults","description":"Update field defaults for a webhook.\n\nField defaults allow you to:\n- Enable/disable specific payload fields\n- Set default values for disabled fields\n\nWhen a field is disabled (enabled=False), the workflow will use the\ndefault value instead of expecting it in the webhook payload.","operationId":"update_webhook_field_defaults_api_schedules_webhooks__webhook_id__field_defaults_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookFieldDefaults"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["schedules"],"summary":"Get Webhook Field Defaults","description":"Get field defaults configuration for a webhook","operationId":"get_webhook_field_defaults_api_schedules_webhooks__webhook_id__field_defaults_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/schedules/webhooks/{webhook_id}/details":{"get":{"tags":["schedules"],"summary":"Get Webhook Details","description":"Get detailed webhook info including payload format, example curl, and headers.\nExtracts expected payload fields from the workflow by scanning for {{payload.X}} patterns.","operationId":"get_webhook_details_api_schedules_webhooks__webhook_id__details_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/schedules/webhooks/fix-urls":{"post":{"tags":["schedules"],"summary":"Fix Webhook Urls","description":"Fix any webhooks with old/wrong URLs.","operationId":"fix_webhook_urls_api_schedules_webhooks_fix_urls_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/schedules/quick-actions/":{"get":{"tags":["schedules"],"summary":"List Quick Actions","description":"List all quick actions for the current user","operationId":"list_quick_actions_api_schedules_quick_actions__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["schedules"],"summary":"Create Quick Action","description":"Mark a webhook as a quick action for the document toolbar","operationId":"create_quick_action_api_schedules_quick_actions__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickActionCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/schedules/quick-actions/{webhook_id}":{"put":{"tags":["schedules"],"summary":"Update Quick Action","description":"Update a quick action's configuration","operationId":"update_quick_action_api_schedules_quick_actions__webhook_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickActionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["schedules"],"summary":"Delete Quick Action","description":"Remove a webhook from quick actions (doesn't delete the webhook itself)","operationId":"delete_quick_action_api_schedules_quick_actions__webhook_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/schedules/quick-actions/from-workflow":{"post":{"tags":["schedules"],"summary":"Create Quick Action From Workflow","description":"Create a quick action directly from a workflow.\nIf the workflow doesn't have a webhook yet, one is automatically created.\nThis is the streamlined flow for the DocumentParser filling step.","operationId":"create_quick_action_from_workflow_api_schedules_quick_actions_from_workflow_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickActionFromWorkflow"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/calendar/ingest/{ingest_token}":{"post":{"tags":["calendar"],"summary":"Ingest Calendar Event","description":"Public endpoint: accept a booking and persist it as a calendar event.\n\nAccepts the flat aivoice payload:\n    {title, start_datetime, duration_minutes, description, timezone}\nAlso tolerates a wrapped {\"fields\": {...}} or {\"rows\": [{...}]} shape for\nparity with the workflow webhook trigger.\nReturns 2xx so aivoice treats the booking as confirmed.","operationId":"ingest_calendar_event_api_calendar_ingest__ingest_token__post","parameters":[{"name":"ingest_token","in":"path","required":true,"schema":{"type":"string","title":"Ingest Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/calendar/events":{"get":{"tags":["calendar"],"summary":"List Calendar Events","description":"List the current user's calendar events, optionally within [start, end].","operationId":"list_calendar_events_api_calendar_events_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["calendar"],"summary":"Create Calendar Event","description":"Create an event manually (used by the calendar page 'add' action).","operationId":"create_calendar_event_api_calendar_events_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualEventCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/calendar/ingest-token":{"get":{"tags":["calendar"],"summary":"Get Ingest Token","description":"Return (creating if needed) the public ingest URL for the current user.","operationId":"get_ingest_token_api_calendar_ingest_token_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/calendar/ingest-token/regenerate":{"post":{"tags":["calendar"],"summary":"Regenerate Ingest Token","description":"Rotate the current user's ingest token.","operationId":"regenerate_ingest_token_api_calendar_ingest_token_regenerate_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kb/status":{"get":{"tags":["Knowledge Base"],"summary":"Get Kb Status","description":"Get the status of the Bedrock Knowledge Base service.\n\nReturns configuration status and environment info.","operationId":"get_kb_status_api_kb_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/kb/index":{"post":{"tags":["Knowledge Base"],"summary":"Index Document","description":"Index a document's extracted data into the Knowledge Base.\n\nThis is typically called automatically after document processing,\nbut can be called manually to re-index a document.\n\nArgs:\n    request: Document data to index\n\nReturns:\n    Index result with count of indexed fields","operationId":"index_document_api_kb_index_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndexDocumentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kb/search":{"post":{"tags":["Knowledge Base"],"summary":"Search","description":"Perform semantic search across indexed documents.\n\nResults are filtered to only include the user's documents.\nOptionally filter by batch_id for batch-specific search.\n\nArgs:\n    request: Search query and filters\n\nReturns:\n    List of matching results with source tracking","operationId":"search_api_kb_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kb/fill-fields":{"post":{"tags":["Knowledge Base"],"summary":"Fill Fields","description":"Find values to fill PDF/Excel fields using semantic search.\n\nFor each field in the request, searches for the best matching\nvalue from the user's indexed documents. Returns alternatives\nso user can choose if the first match isn't correct.\n\nArgs:\n    request: Fields to fill with optional batch filter\n\nReturns:\n    List of field matches with best match and alternatives","operationId":"fill_fields_api_kb_fill_fields_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FillFieldsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kb/reindex-batch/{batch_id}":{"post":{"tags":["Knowledge Base"],"summary":"Reindex Batch","description":"Re-index all documents in a batch.\n\nFetches all documents from the batch and indexes their extracted data.\nUseful after schema changes or when KB was not available during processing.","operationId":"reindex_batch_api_kb_reindex_batch__batch_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/plans":{"get":{"tags":["Billing"],"summary":"Get Plans","description":"Return available plans and pricing (public).","operationId":"get_plans_api_billing_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/billing/status":{"get":{"tags":["Billing"],"summary":"Get Billing Status","description":"Get billing status for the current user's organization.","operationId":"get_billing_status_api_billing_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/checkout/subscription":{"post":{"tags":["Billing"],"summary":"Create Subscription Checkout","description":"Create a Stripe Checkout session for a subscription.","operationId":"create_subscription_checkout_api_billing_checkout_subscription_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSubscriptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/checkout/topup":{"post":{"tags":["Billing"],"summary":"Create Topup Checkout","description":"Create a Stripe Checkout session for a token top-up.","operationId":"create_topup_checkout_api_billing_checkout_topup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutTopupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/portal":{"post":{"tags":["Billing"],"summary":"Create Portal Session","description":"Create a Stripe Customer Portal session.","operationId":"create_portal_session_api_billing_portal_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/webhook":{"post":{"tags":["Billing"],"summary":"Stripe Webhook","description":"Handle Stripe webhook events.","operationId":"stripe_webhook_api_billing_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/kiwi-connections/from-kiwi":{"get":{"tags":["Kiwi Connections"],"summary":"Get Kiwi Connection Config","description":"Return pre-filled Kiwi connection config from the org's Kiwi agent.\nFrontend uses this to offer a one-click \"Connect to Kiwi\" button.","operationId":"get_kiwi_connection_config_api_kiwi_connections_from_kiwi_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi-connections":{"get":{"tags":["Kiwi Connections"],"summary":"List Connections","description":"List all Kiwi connections for the current user","operationId":"list_connections_api_kiwi_connections_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Kiwi Connections"],"summary":"Create Connection","description":"Create a new Kiwi connection","operationId":"create_connection_api_kiwi_connections_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KiwiConnectionCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi-connections/{connection_id}":{"get":{"tags":["Kiwi Connections"],"summary":"Get Connection","description":"Get a specific Kiwi connection","operationId":"get_connection_api_kiwi_connections__connection_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Kiwi Connections"],"summary":"Update Connection","description":"Update a Kiwi connection","operationId":"update_connection_api_kiwi_connections__connection_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KiwiConnectionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Kiwi Connections"],"summary":"Delete Connection","description":"Delete a Kiwi connection","operationId":"delete_connection_api_kiwi_connections__connection_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi-connections/{connection_id}/test":{"post":{"tags":["Kiwi Connections"],"summary":"Test Connection","description":"Test connectivity to a Kiwi instance","operationId":"test_connection_api_kiwi_connections__connection_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi-connections/channel-webhook/{token}":{"post":{"tags":["Kiwi Connections"],"summary":"Receive Channel Message","description":"PUBLIC endpoint: Receive forwarded channel messages from Kiwi.\n\nKiwi should be configured to forward incoming channel messages\n(WhatsApp, Telegram, etc.) to this endpoint.\n\nExpected body:\n{\n    \"message\": \"text content\",\n    \"from\": \"+15551234567\" or \"@username\",\n    \"channel\": \"whatsapp\",\n    \"timestamp\": \"2026-02-25T10:00:00Z\",\n    \"media\": [{\"filename\": \"doc.pdf\", \"content\": \"base64...\", \"mime_type\": \"application/pdf\"}]\n}","operationId":"receive_channel_message_api_kiwi_connections_channel_webhook__token__post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi":{"get":{"tags":["Kiwi Agent"],"summary":"Get Agent","description":"Get the organization's Kiwi agent (returns agent or null)","operationId":"get_agent_api_kiwi_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["Kiwi Agent"],"summary":"Update Agent","description":"Update agent config (name, guardrails)","operationId":"update_agent_api_kiwi_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KiwiAgentUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Kiwi Agent"],"summary":"Create Agent","description":"Create a Kiwi agent for the organization","operationId":"create_agent_api_kiwi_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KiwiAgentCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"delete":{"tags":["Kiwi Agent"],"summary":"Delete Agent","description":"Delete agent entirely","operationId":"delete_agent_api_kiwi_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/pool/status":{"get":{"tags":["Kiwi Agent"],"summary":"Get Pool Status","description":"Inspect current Kiwi pool slot inventory (allocator scaffolding visibility).","operationId":"get_pool_status_api_kiwi_pool_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/start":{"post":{"tags":["Kiwi Agent"],"summary":"Start Agent","description":"Start/activate the agent (ECS provisioning stubbed for now)","operationId":"start_agent_api_kiwi_start_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/stop":{"post":{"tags":["Kiwi Agent"],"summary":"Stop Agent","description":"Stop/deactivate the agent","operationId":"stop_agent_api_kiwi_stop_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/update-runtime":{"post":{"tags":["Kiwi Agent"],"summary":"Update Agent Runtime","description":"Restart/reclaim the org Kiwi agent when its OpenClaw runtime is behind the expected task definition.","operationId":"update_agent_runtime_api_kiwi_update_runtime_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/health":{"get":{"tags":["Kiwi Agent"],"summary":"Agent Health","description":"Check the health of the org's Kiwi agent Kiwi process","operationId":"agent_health_api_kiwi_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/channels":{"post":{"tags":["Kiwi Agent"],"summary":"Connect Channel","description":"Connect a channel (telegram bot token, slack oauth, etc.)","operationId":"connect_channel_api_kiwi_channels_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelConnect"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/channels/{channel_type}":{"delete":{"tags":["Kiwi Agent"],"summary":"Disconnect Channel","description":"Disconnect a channel","operationId":"disconnect_channel_api_kiwi_channels__channel_type__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"channel_type","in":"path","required":true,"schema":{"type":"string","title":"Channel Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/conversations":{"get":{"tags":["Kiwi Agent"],"summary":"List Conversations","description":"List recent conversations for the current user only.","operationId":"list_conversations_api_kiwi_conversations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_hidden","in":"query","required":false,"schema":{"type":"boolean","description":"Include archived/hidden conversations","default":false,"title":"Include Hidden"},"description":"Include archived/hidden conversations"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/conversations/{conversation_id}/seen":{"post":{"tags":["Kiwi Agent"],"summary":"Mark Conversation Seen","description":"Persist per-user read state so unread badges survive reload/session changes.","operationId":"mark_conversation_seen_api_kiwi_conversations__conversation_id__seen_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/projects":{"get":{"tags":["Kiwi Agent"],"summary":"List Chat Projects","description":"List chat projects/folders for the current user.","operationId":"list_chat_projects_api_kiwi_projects_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Kiwi Agent"],"summary":"Create Chat Project","description":"Create a project/folder for Kiwi conversations.","operationId":"create_chat_project_api_kiwi_projects_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/projects/{project_id}/documents":{"get":{"tags":["Kiwi Agent"],"summary":"List Project Documents","description":"List documents referenced by conversations inside a project.","operationId":"list_project_documents_api_kiwi_projects__project_id__documents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/projects/{project_id}":{"put":{"tags":["Kiwi Agent"],"summary":"Update Chat Project","description":"Update project name/description/memory prompt.","operationId":"update_chat_project_api_kiwi_projects__project_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/projects/{project_id}/conversations/{conversation_id}":{"post":{"tags":["Kiwi Agent"],"summary":"Assign Conversation To Project","description":"Move a conversation into a project/folder.","operationId":"assign_conversation_to_project_api_kiwi_projects__project_id__conversations__conversation_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/conversations/{conversation_id}/archive":{"post":{"tags":["Kiwi Agent"],"summary":"Archive Conversation","description":"Archive a conversation (archived=true).","operationId":"archive_conversation_api_kiwi_conversations__conversation_id__archive_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/conversations/{conversation_id}/unarchive":{"post":{"tags":["Kiwi Agent"],"summary":"Unarchive Conversation","description":"Unarchive a conversation (archived=false).","operationId":"unarchive_conversation_api_kiwi_conversations__conversation_id__unarchive_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/conversations/{conversation_id}":{"get":{"tags":["Kiwi Agent"],"summary":"Get Conversation","description":"Get conversation messages only if owned by the current user.","operationId":"get_conversation_api_kiwi_conversations__conversation_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/conversations/{conversation_id}/handoff-summary":{"get":{"tags":["Kiwi Agent"],"summary":"Get Conversation Handoff Summary","description":"Get continuity payload (summary + last 5 messages) for cross-surface handoff.","operationId":"get_conversation_handoff_summary_api_kiwi_conversations__conversation_id__handoff_summary_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/conversations/{conversation_id}/share":{"post":{"tags":["Kiwi Agent"],"summary":"Toggle Share Conversation","description":"Conversation sharing is disabled.","operationId":"toggle_share_conversation_api_kiwi_conversations__conversation_id__share_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/tool-execute":{"post":{"tags":["Kiwi Agent"],"summary":"Tool Execute","description":"Execute a Kiwi tool on behalf of the agent.\n\nCalled by the bridge when Claude makes a tool call during chat.\nAuth: X-Bridge-Service-Token (shared secret) + X-Bridge-User-Id (user context).\nThis avoids passing user JWTs between services (SOC2 compliant).","operationId":"tool_execute_api_kiwi_tool_execute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolExecuteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/chat/stream":{"post":{"tags":["Kiwi Agent"],"summary":"Send Chat Stream","description":"SSE streaming chat via Kiwi.\n\nTesting can run Kiwi through the AgentCore-native OpenClaw runtime by setting\nKIWI_RUNTIME_BACKEND=agentcore. That path intentionally has no ECS bridge\nfallback: if AgentCore fails, the request fails visibly.","operationId":"send_chat_stream_api_kiwi_chat_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessage"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/upload-large-file":{"post":{"tags":["Kiwi Agent"],"summary":"Upload Large File","description":"Upload a large file for Kiwi chat context.\nAccepts multipart/form-data with a single 'file' field.\nSaves to S3 + creates ExcelTemplate record.\nReturns template_id + file metadata for the chat context.","operationId":"upload_large_file_api_kiwi_upload_large_file_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_large_file_api_kiwi_upload_large_file_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/chat/stream-with-file":{"post":{"tags":["Kiwi Agent"],"summary":"Send Chat Stream With File","description":"SSE streaming chat with optional file context. Saves Excel/CSV to S3 + ExcelTemplate, then streams.","operationId":"send_chat_stream_with_file_api_kiwi_chat_stream_with_file_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatWithFileMessage"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/chat/history":{"get":{"tags":["Kiwi Agent"],"summary":"Get Chat History","description":"Get web chat history for the current user.","operationId":"get_chat_history_api_kiwi_chat_history_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/chat/usage":{"get":{"tags":["Kiwi Agent"],"summary":"Get Chat Usage","description":"Get daily Kiwi chat message usage and limits for the org.","operationId":"get_chat_usage_api_kiwi_chat_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/execution-plan/{plan_id}":{"get":{"tags":["Kiwi Agent"],"summary":"Get Execution Plan","description":"Get execution plan state for rendering in conversation history.","operationId":"get_execution_plan_api_kiwi_execution_plan__plan_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"plan_id","in":"path","required":true,"schema":{"type":"string","title":"Plan Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/usage":{"get":{"tags":["Kiwi Agent"],"summary":"Get Usage","description":"Get token usage stats","operationId":"get_usage_api_kiwi_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/activity":{"get":{"tags":["Kiwi Agent"],"summary":"Get Recent Activity","description":"Get recent agent activity from the last 24 hours","operationId":"get_recent_activity_api_kiwi_activity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/files":{"get":{"tags":["Kiwi Agent"],"summary":"Get Managed Files","description":"Get files the agent has processed (detected from chat messages + uploaded files)","operationId":"get_managed_files_api_kiwi_files_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/memory":{"get":{"tags":["Kiwi Agent"],"summary":"List Memories","description":"List only the current user's memories for the org's Kiwi agent.","operationId":"list_memories_api_kiwi_memory_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"scope","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Kiwi Agent"],"summary":"Create Memory","description":"Create a new current-user memory entry. Org/shared memories are disabled.","operationId":"create_memory_api_kiwi_memory_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/memory/org":{"get":{"tags":["Kiwi Agent"],"summary":"Get Org Memory","description":"Organization-shared memories are disabled; return no shared memory.","operationId":"get_org_memory_api_kiwi_memory_org_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/memory/users":{"get":{"tags":["Kiwi Agent"],"summary":"List User Memories","description":"List only the current user's memories; never expose other org users' memories.","operationId":"list_user_memories_api_kiwi_memory_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/kiwi/memory/{memory_id}":{"put":{"tags":["Kiwi Agent"],"summary":"Update Memory","description":"Update a current-user memory entry.","operationId":"update_memory_api_kiwi_memory__memory_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"memory_id","in":"path","required":true,"schema":{"type":"string","title":"Memory Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Kiwi Agent"],"summary":"Delete Memory","description":"Delete a current-user memory entry.","operationId":"delete_memory_api_kiwi_memory__memory_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"memory_id","in":"path","required":true,"schema":{"type":"string","title":"Memory Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/documents":{"get":{"tags":["Kiwi Agent"],"summary":"List Kiwi Documents","description":"List recent org documents for UI-side working-file resolution.","operationId":"list_kiwi_documents_api_kiwi_documents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/documents/{document_id}/thumbnail":{"get":{"tags":["Kiwi Agent"],"summary":"Get Document Thumbnail","description":"Get a presigned URL for a document page thumbnail.","operationId":"get_document_thumbnail_api_kiwi_documents__document_id__thumbnail_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/documents/{document_id}/download-url":{"get":{"tags":["Kiwi Agent"],"summary":"Get Document Download Url","description":"Get a presigned URL to download the original document file.","operationId":"get_document_download_url_api_kiwi_documents__document_id__download_url_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/messages/{message_id}/star":{"post":{"tags":["Kiwi Agent"],"summary":"Star Message","description":"Star a message. Validates message belongs to user's org.","operationId":"star_message_api_kiwi_messages__message_id__star_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Kiwi Agent"],"summary":"Unstar Message","description":"Unstar a message.","operationId":"unstar_message_api_kiwi_messages__message_id__star_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/messages/starred":{"get":{"tags":["Kiwi Agent"],"summary":"List Starred Messages","description":"List starred messages for the org. Optional text search with ?q=.","operationId":"list_starred_messages_api_kiwi_messages_starred_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiwi/debug/gateway-logs":{"get":{"tags":["Kiwi Agent"],"summary":"Get Gateway Logs","description":"Debug endpoint: read gateway logs for the org's Kiwi process.\nRestricted to org owners only (M2 security fix).","operationId":"get_gateway_logs_api_kiwi_debug_gateway_logs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/whatsapp/webhook":{"post":{"tags":["WhatsApp AI"],"summary":"Whatsapp Webhook","description":"PUBLIC endpoint: Receive incoming WhatsApp messages from Twilio.\n\nTwilio posts form data with From, To, Body, MessageSid, etc.\nWe return immediately (Twilio 15s timeout) and process in background.","operationId":"whatsapp_webhook_api_whatsapp_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/whatsapp/sessions":{"get":{"tags":["WhatsApp AI"],"summary":"List Sessions","description":"List user's WhatsApp AI sessions","operationId":"list_sessions_api_whatsapp_sessions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["WhatsApp AI"],"summary":"Create Session","description":"Create a WhatsApp AI session config","operationId":"create_session_api_whatsapp_sessions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/whatsapp/sessions/{session_id}":{"put":{"tags":["WhatsApp AI"],"summary":"Update Session","description":"Update session config","operationId":"update_session_api_whatsapp_sessions__session_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["WhatsApp AI"],"summary":"Delete Session","description":"Delete a session","operationId":"delete_session_api_whatsapp_sessions__session_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/organization":{"get":{"tags":["developer"],"summary":"Get Organization","description":"Get current user's organization.","operationId":"get_organization_api_developer_organization_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["developer"],"summary":"Update Organization","description":"Update organization (owner only).","operationId":"update_organization_api_developer_organization_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrgRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["developer"],"summary":"Create Organization","description":"Create an organization and set current user as owner.","operationId":"create_organization_api_developer_organization_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrgRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/developer/teams":{"get":{"tags":["developer"],"summary":"List Teams","description":"List teams in user's organization.","operationId":"list_teams_api_developer_teams_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["developer"],"summary":"Create Team","description":"Create a team (org owner only).","operationId":"create_team_api_developer_teams_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/developer_routes__CreateTeamRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/developer/teams/{team_id}/members":{"get":{"tags":["developer"],"summary":"List Team Members","description":"List members of a team.","operationId":"list_team_members_api_developer_teams__team_id__members_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/teams/{team_id}/invite":{"post":{"tags":["developer"],"summary":"Invite Member","description":"Invite a member to a team.","operationId":"invite_member_api_developer_teams__team_id__invite_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/developer_routes__InviteMemberRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/invitations/pending":{"get":{"tags":["developer"],"summary":"Get Pending Invitations","description":"Get pending invitations for current user.","operationId":"get_pending_invitations_api_developer_invitations_pending_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/developer/invitations/{membership_id}/accept":{"post":{"tags":["developer"],"summary":"Accept Invitation","description":"Accept a team invitation.","operationId":"accept_invitation_api_developer_invitations__membership_id__accept_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"membership_id","in":"path","required":true,"schema":{"type":"string","title":"Membership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/invitations/{membership_id}/decline":{"post":{"tags":["developer"],"summary":"Decline Invitation","description":"Decline a team invitation.","operationId":"decline_invitation_api_developer_invitations__membership_id__decline_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"membership_id","in":"path","required":true,"schema":{"type":"string","title":"Membership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/teams/{team_id}/members/{membership_id}/role":{"put":{"tags":["developer"],"summary":"Update Member Role","description":"Update a team member's role (owner only).","operationId":"update_member_role_api_developer_teams__team_id__members__membership_id__role_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"membership_id","in":"path","required":true,"schema":{"type":"string","title":"Membership Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/teams/{team_id}/members/{membership_id}":{"delete":{"tags":["developer"],"summary":"Remove Member","description":"Remove a member from a team (owner only).","operationId":"remove_member_api_developer_teams__team_id__members__membership_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"membership_id","in":"path","required":true,"schema":{"type":"string","title":"Membership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/projects":{"get":{"tags":["developer"],"summary":"List Projects","description":"List projects in user's organization.","operationId":"list_projects_api_developer_projects_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["developer"],"summary":"Create Project","description":"Create a project in user's organization.","operationId":"create_project_api_developer_projects_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/developer/projects/{project_id}":{"get":{"tags":["developer"],"summary":"Get Project","description":"Get a project with stats.","operationId":"get_project_api_developer_projects__project_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["developer"],"summary":"Update Project","description":"Update a project.","operationId":"update_project_api_developer_projects__project_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProjectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["developer"],"summary":"Delete Project","description":"Soft-delete a project.","operationId":"delete_project_api_developer_projects__project_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/keys":{"get":{"tags":["developer"],"summary":"List Api Keys","description":"List all sd_ API keys owned by the current user.","operationId":"list_api_keys_api_developer_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["developer"],"summary":"Create Api Key","description":"Create a new sd_ API key, optionally inside a project.","operationId":"create_api_key_api_developer_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/developer/projects/{project_id}/keys":{"get":{"tags":["developer"],"summary":"List Project Keys","description":"List API keys in a specific project.","operationId":"list_project_keys_api_developer_projects__project_id__keys_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["developer"],"summary":"Create Project Key","description":"Create an API key inside a specific project.","operationId":"create_project_key_api_developer_projects__project_id__keys_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/keys/{key_id}":{"delete":{"tags":["developer"],"summary":"Revoke Api Key","description":"Revoke an API key (must be owned by current user).","operationId":"revoke_api_key_api_developer_keys__key_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/webhooks":{"get":{"tags":["developer"],"summary":"List All Webhooks","description":"List all webhooks across all user's projects.","operationId":"list_all_webhooks_api_developer_webhooks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/developer/projects/{project_id}/webhooks":{"get":{"tags":["developer"],"summary":"List Project Webhooks","description":"List webhooks for a specific project.","operationId":"list_project_webhooks_api_developer_projects__project_id__webhooks_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["developer"],"summary":"Create Webhook","description":"Create a webhook for a project.","operationId":"create_webhook_api_developer_projects__project_id__webhooks_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/webhooks/{webhook_id}":{"put":{"tags":["developer"],"summary":"Update Webhook","description":"Update a webhook.","operationId":"update_webhook_api_developer_webhooks__webhook_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["developer"],"summary":"Delete Webhook","description":"Delete a webhook.","operationId":"delete_webhook_api_developer_webhooks__webhook_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/webhooks/{webhook_id}/test":{"post":{"tags":["developer"],"summary":"Test Webhook","description":"Send a test delivery to a webhook.","operationId":"test_webhook_api_developer_webhooks__webhook_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/webhooks/{webhook_id}/deliveries":{"get":{"tags":["developer"],"summary":"List Webhook Deliveries","description":"List delivery attempts for a webhook.","operationId":"list_webhook_deliveries_api_developer_webhooks__webhook_id__deliveries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/usage":{"get":{"tags":["developer"],"summary":"Get Usage","description":"Get aggregated usage with daily breakdown by model type.","operationId":"get_usage_api_developer_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","description":"current or last","default":"current","title":"Period"},"description":"current or last"},{"name":"month","in":"query","required":false,"schema":{"type":"string","description":"Explicit month as YYYY-MM from client timezone","title":"Month"},"description":"Explicit month as YYYY-MM from client timezone"},{"name":"project_id","in":"query","required":false,"schema":{"type":"string","description":"Filter by project ID","title":"Project Id"},"description":"Filter by project ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/jobs/recent":{"get":{"tags":["developer"],"summary":"Get Recent Jobs","description":"Get recent API jobs for the current user.","operationId":"get_recent_jobs_api_developer_jobs_recent_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}},{"name":"month","in":"query","required":false,"schema":{"type":"string","description":"Filter by month YYYY-MM","title":"Month"},"description":"Filter by month YYYY-MM"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/billing/status":{"get":{"tags":["developer"],"summary":"Get Billing Status","description":"Get token balance, usage, and subscription info.","operationId":"get_billing_status_api_developer_billing_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/developer/billing/history":{"get":{"tags":["developer"],"summary":"Get Billing History","description":"Get billing/payment history from Stripe.","operationId":"get_billing_history_api_developer_billing_history_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/developer/billing/checkout/credits":{"post":{"tags":["developer"],"summary":"Checkout Credits","description":"Create a Stripe checkout session for purchasing API token credits.","operationId":"checkout_credits_api_developer_billing_checkout_credits_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseCreditsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/developer/billing/checkout/subscribe":{"post":{"tags":["developer"],"summary":"Checkout Subscribe","description":"Create a Stripe checkout session for subscribing to a plan.","operationId":"checkout_subscribe_api_developer_billing_checkout_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribePlanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/developer/billing/portal":{"post":{"tags":["developer"],"summary":"Billing Portal","description":"Create a Stripe billing portal session for managing payment methods and subscriptions.","operationId":"billing_portal_api_developer_billing_portal_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/filling-agent/filter-results/{result_id}":{"get":{"tags":["filling-agent"],"summary":"Get Filter Results","description":"Fetch stored filter results by ID. Frontend calls this after receiving filter_ready SSE event.","operationId":"get_filter_results_api_filling_agent_filter_results__result_id__get","parameters":[{"name":"result_id","in":"path","required":true,"schema":{"type":"string","title":"Result Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/filling-agent/upload-source":{"post":{"tags":["filling-agent"],"summary":"Upload Source Document","description":"Extract text from non-PDF/Excel source documents (docx, pptx, txt, csv, etc.).","operationId":"upload_source_document_api_filling_agent_upload_source_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_source_document_api_filling_agent_upload_source_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/filling-agent/chat":{"post":{"tags":["filling-agent"],"summary":"Filling Agent Chat","description":"SSE streaming chat endpoint for the filling agent","operationId":"filling_agent_chat_api_filling_agent_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/filling-agent/apply":{"post":{"tags":["filling-agent"],"summary":"Apply Fills","description":"Execute a fill plan — streams progress events as cells are filled","operationId":"apply_fills_api_filling_agent_apply_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/filling-agent/history/{conversation_id}":{"get":{"tags":["filling-agent"],"summary":"Get History","description":"Get conversation history — from memory or DB, scoped by org","operationId":"get_history_api_filling_agent_history__conversation_id__get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"template_id","in":"query","required":false,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/filling-agent/conversations/{template_id}":{"get":{"tags":["filling-agent"],"summary":"List Conversations","description":"List conversations for a template — scoped to user's organization.","operationId":"list_conversations_api_filling_agent_conversations__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/filling-agent/conversations/migrate":{"post":{"tags":["filling-agent"],"summary":"Migrate Conversations","description":"Migrate conversations from old template_id to new template_id (org-scoped).","operationId":"migrate_conversations_api_filling_agent_conversations_migrate_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Request Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/filling-agent/history-by-template/{template_id}":{"get":{"tags":["filling-agent"],"summary":"Get History By Template","description":"Get latest conversation for a template — scoped by org","operationId":"get_history_by_template_api_filling_agent_history_by_template__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/filling-agent/field-suggest":{"post":{"tags":["filling-agent"],"summary":"Field Suggest","description":"BERT-based per-field autocomplete. Returns top suggestions for a single field\nmatched against source document fields. No LLM calls — just embeddings + patterns.\nDesigned to be instant (<100ms).","operationId":"field_suggest_api_filling_agent_field_suggest_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldSuggestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agentcore/browser/health":{"get":{"tags":["agentcore-browser"],"summary":"Health","operationId":"health_api_agentcore_browser_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/agentcore/browser/session/start":{"post":{"tags":["agentcore-browser"],"summary":"Start Browser Session","operationId":"start_browser_session_api_agentcore_browser_session_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agentcore/browser/agent/start":{"post":{"tags":["agentcore-browser"],"summary":"Start Browser Agent","operationId":"start_browser_agent_api_agentcore_browser_agent_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agentcore/browser/agent/run":{"post":{"tags":["agentcore-browser"],"summary":"Run Browser Agent Prompt","operationId":"run_browser_agent_prompt_api_agentcore_browser_agent_run_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunAgentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agentcore/browser/agent/status":{"get":{"tags":["agentcore-browser"],"summary":"Browser Agent Status","operationId":"browser_agent_status_api_agentcore_browser_agent_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/agentcore/browser/agent/stop":{"post":{"tags":["agentcore-browser"],"summary":"Stop Browser Agent","operationId":"stop_browser_agent_api_agentcore_browser_agent_stop_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/agentcore/browser/session/status":{"post":{"tags":["agentcore-browser"],"summary":"Get Browser Session Status","operationId":"get_browser_session_status_api_agentcore_browser_session_status_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agentcore/browser/session/stop":{"post":{"tags":["agentcore-browser"],"summary":"Stop Browser Session","operationId":"stop_browser_session_api_agentcore_browser_session_stop_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/web-session":{"post":{"tags":["web-form-v2"],"summary":"Create Web Session","description":"Create a persistent browser session and return session_id + initial screenshot.","operationId":"create_web_session_api_batch_web_session_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/web-session/{session_id}":{"delete":{"tags":["web-form-v2"],"summary":"Close Web Session","description":"Close a browser session.","operationId":"close_web_session_api_batch_web_session__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/web-generate-steps":{"post":{"tags":["web-form-v2"],"summary":"Generate Steps","description":"Scan form fields and auto-generate workflow steps.","operationId":"generate_steps_api_batch_web_generate_steps_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateStepsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/web-execute":{"post":{"tags":["web-form-v2"],"summary":"Execute Steps","description":"Execute workflow steps via CUA. Returns SSE stream.","operationId":"execute_steps_api_batch_web_execute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteStepsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/web-execute-step":{"post":{"tags":["web-form-v2"],"summary":"Execute Single Step","description":"Execute a single step. Returns SSE stream.","operationId":"execute_single_step_api_batch_web_execute_step_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteSingleStepRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/web-submit-v2":{"post":{"tags":["web-form-v2"],"summary":"Submit Form","description":"Submit form using existing session. Returns SSE stream.","operationId":"submit_form_api_batch_web_submit_v2_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch/web-fill-v3":{"post":{"tags":["web-form-v3"],"summary":"Web Fill V3","description":"Fill web form using browser-use agent (v3). Returns SSE stream.","operationId":"web_fill_v3_api_batch_web_fill_v3_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebFillV3Request"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/signatures/request":{"post":{"tags":["signatures"],"summary":"Create Signature Request","description":"Create a new signature request with signers.","operationId":"create_signature_request_api_signatures_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignatureRequestCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/signatures/requests":{"get":{"tags":["signatures"],"summary":"List Signature Requests","description":"List all signature requests created by the current user.","operationId":"list_signature_requests_api_signatures_requests_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/signatures/request/{request_id}":{"get":{"tags":["signatures"],"summary":"Get Signature Request","description":"Get a specific signature request with signer details.","operationId":"get_signature_request_api_signatures_request__request_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/signatures/sign/{token}":{"get":{"tags":["signatures"],"summary":"Get Signing Page","description":"Public endpoint — get signing page data by signer token.","operationId":"get_signing_page_api_signatures_sign__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["signatures"],"summary":"Submit Signature","description":"Public endpoint — submit a signature for a signer token.","operationId":"submit_signature_api_signatures_sign__token__post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignatureSubmit"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/signatures/request/{request_id}/remind":{"post":{"tags":["signatures"],"summary":"Send Reminder","description":"Resend reminder to pending signers.","operationId":"send_reminder_api_signatures_request__request_id__remind_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/gallery":{"get":{"tags":["template-gallery"],"summary":"List Templates","description":"List all available document templates, optionally filtered by category.","operationId":"list_templates_api_templates_gallery_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by category","title":"Category"},"description":"Filter by category"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/gallery/{template_id}":{"get":{"tags":["template-gallery"],"summary":"Get Template","description":"Get template detail with full schema.","operationId":"get_template_api_templates_gallery__template_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/gallery/detect-type":{"post":{"tags":["template-gallery"],"summary":"Detect Document Type","description":"Use AI to detect document type from text content.","operationId":"detect_document_type_api_templates_gallery_detect_type_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectTypeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/templates/generate":{"post":{"tags":["template-gallery"],"summary":"Generate Document","description":"Generate a PDF document from a template and field values.","operationId":"generate_document_api_templates_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/templates/convert":{"post":{"tags":["template-gallery"],"summary":"Convert Document","description":"Convert between document formats (PDF ↔ DOCX) via LibreOffice.","operationId":"convert_document_api_templates_convert_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/templates/ai-contract":{"post":{"tags":["template-gallery"],"summary":"Generate Ai Contract","description":"Generate a professional contract using AI (GPT-4o).","operationId":"generate_ai_contract_api_templates_ai_contract_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIContractRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/templates/generated":{"get":{"tags":["template-gallery"],"summary":"List Generated Documents","description":"List user's generated documents.","operationId":"list_generated_documents_api_templates_generated_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/templates/generated/{doc_id}/download":{"get":{"tags":["template-gallery"],"summary":"Download Generated Document","description":"Download a previously generated document.","operationId":"download_generated_document_api_templates_generated__doc_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/jobs":{"get":{"tags":["training"],"summary":"List Training Jobs","description":"List all training jobs for the user's organization.","operationId":"list_training_jobs_api_training_jobs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["training"],"summary":"Create Training Job","description":"Create a new training job with target schema.","operationId":"create_training_job_api_training_jobs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/training/jobs/{job_id}":{"get":{"tags":["training"],"summary":"Get Training Job","description":"Get training job details.","operationId":"get_training_job_api_training_jobs__job_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/jobs/{job_id}/status":{"get":{"tags":["training"],"summary":"Get Training Status","description":"Get job status with variation progress.","operationId":"get_training_status_api_training_jobs__job_id__status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/jobs/{job_id}/documents":{"post":{"tags":["training"],"summary":"Upload Training Documents","description":"Upload documents for training (multipart, max 50).","operationId":"upload_training_documents_api_training_jobs__job_id__documents_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_training_documents_api_training_jobs__job_id__documents_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/jobs/{job_id}/run":{"post":{"tags":["training"],"summary":"Start Training","description":"Generate variations and start async processing.","operationId":"start_training_api_training_jobs__job_id__run_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/jobs/{job_id}/variations":{"get":{"tags":["training"],"summary":"List Variations","description":"List variations with scores, sorted by score descending.","operationId":"list_variations_api_training_jobs__job_id__variations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/jobs/{job_id}/variations/{variation_id}/results":{"get":{"tags":["training"],"summary":"Get Variation Results","description":"Get extraction results for a specific variation.","operationId":"get_variation_results_api_training_jobs__job_id__variations__variation_id__results_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"variation_id","in":"path","required":true,"schema":{"type":"string","title":"Variation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/jobs/{job_id}/validate":{"post":{"tags":["training"],"summary":"Validate Results","description":"Submit user ratings for variation results.","operationId":"validate_results_api_training_jobs__job_id__validate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/jobs/{job_id}/select/{variation_id}":{"post":{"tags":["training"],"summary":"Select Variation","description":"Select winning variation and create a custom model.","operationId":"select_variation_api_training_jobs__job_id__select__variation_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"variation_id","in":"path","required":true,"schema":{"type":"string","title":"Variation Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelectVariationRequest","default":{}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/models":{"get":{"tags":["training"],"summary":"List Custom Models","description":"List user's custom models.","operationId":"list_custom_models_api_training_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/training/models/{model_id}":{"delete":{"tags":["training"],"summary":"Deactivate Custom Model","description":"Deactivate a custom model.","operationId":"deactivate_custom_model_api_training_models__model_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/extract/{model_id}":{"post":{"tags":["training"],"summary":"Extract With Custom Model","description":"Extract data from a document using a custom model's locked config.\nThis is the main endpoint users call after training.","operationId":"extract_with_custom_model_api_training_extract__model_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_with_custom_model_api_training_extract__model_id__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/comparison/extract-structured":{"post":{"tags":["Comparison & Reconciliation"],"summary":"Extract Structured","description":"Extract structured key-value pairs from raw text.\nUsed as a fallback when upload-source structuring failed.","operationId":"extract_structured_api_comparison_extract_structured_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractStructuredRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/comparison/start":{"post":{"tags":["Comparison & Reconciliation"],"summary":"Start Comparison","description":"Start a comparison session.","operationId":"start_comparison_api_comparison_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComparisonStartRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/comparison/match":{"post":{"tags":["Comparison & Reconciliation"],"summary":"Run Match","description":"Run BERT-powered matching between target and source datasets.\nField names are aligned semantically, then row values are compared.","operationId":"run_match_api_comparison_match_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/comparison/results/{comparison_id}":{"get":{"tags":["Comparison & Reconciliation"],"summary":"Get Comparison Results","description":"Get comparison results by comparison_id.","operationId":"get_comparison_results_api_comparison_results__comparison_id__get","parameters":[{"name":"comparison_id","in":"path","required":true,"schema":{"type":"string","title":"Comparison Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ui2/books":{"get":{"tags":["UI2 Books"],"summary":"List Ui2 Books","operationId":"list_ui2_books_api_ui2_books_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["UI2 Books"],"summary":"Create Ui2 Book","operationId":"create_ui2_book_api_ui2_books_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ui2BookCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/ui2/books/{book_id}":{"patch":{"tags":["UI2 Books"],"summary":"Update Ui2 Book","operationId":"update_ui2_book_api_ui2_books__book_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"book_id","in":"path","required":true,"schema":{"type":"string","title":"Book Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ui2BookUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["UI2 Books"],"summary":"Delete Ui2 Book","operationId":"delete_ui2_book_api_ui2_books__book_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"book_id","in":"path","required":true,"schema":{"type":"string","title":"Book Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks":{"get":{"tags":["tasks"],"summary":"List Tasks","description":"Unified long-running task view for authenticated users.\n\nNormalized status values:\n- queued, running, succeeded, failed, cancelled, timed_out\n\nCurrent mapped sources:\n- document_batch  -> batches table\n- training_job    -> sd_training_jobs table\n- agent_provisioning -> kiwi_agents table (when provisioning)","operationId":"list_tasks_api_tasks_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"task_type","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by task type. Supported: document_batch, training_job, agent_provisioning","title":"Task Type"},"description":"Filter by task type. Supported: document_batch, training_job, agent_provisioning"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by normalized status","title":"Status"},"description":"Filter by normalized status"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-connectors/catalog":{"get":{"tags":["Agent Connectors"],"summary":"Get Catalog","operationId":"get_catalog_api_agent_connectors_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/agent-connectors/connections":{"get":{"tags":["Agent Connectors"],"summary":"List Connections","operationId":"list_connections_api_agent_connectors_connections_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/agent-connectors/connections/{provider}/connect":{"post":{"tags":["Agent Connectors"],"summary":"Connect Provider","operationId":"connect_provider_api_agent_connectors_connections__provider__connect_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-connectors/connections/callback":{"get":{"tags":["Agent Connectors"],"summary":"Agent Connector Callback","operationId":"agent_connector_callback_api_agent_connectors_connections_callback_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"connectedAccountId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connectedaccountid"}},{"name":"connected_account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connected Account Id"}},{"name":"appName","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appname"}},{"name":"pending","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pending"}},{"name":"return_url","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Return Url"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-connectors/connections/{provider}/mark-connected":{"post":{"tags":["Agent Connectors"],"summary":"Mark Connected","description":"Finalize a connection after OAuth callback/client redirect.\n\nThis route stores only Composio's connected account id; raw OAuth tokens remain in Composio.","operationId":"mark_connected_api_agent_connectors_connections__provider__mark_connected_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-connectors/connections/{provider}/test":{"post":{"tags":["Agent Connectors"],"summary":"Test Provider","operationId":"test_provider_api_agent_connectors_connections__provider__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-connectors/connections/{provider}":{"delete":{"tags":["Agent Connectors"],"summary":"Disconnect Provider","operationId":"disconnect_provider_api_agent_connectors_connections__provider__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/errors":{"get":{"tags":["Error Tracking"],"summary":"List Errors","description":"List application errors with filters.","operationId":"list_errors_api_admin_errors_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by category","title":"Category"},"description":"Filter by category"},{"name":"severity","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by severity","title":"Severity"},"description":"Filter by severity"},{"name":"resolved","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by resolved status","title":"Resolved"},"description":"Filter by resolved status"},{"name":"hours","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Only errors from last N hours","title":"Hours"},"description":"Only errors from last N hours"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search error message/type","title":"Search"},"description":"Search error message/type"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/errors/summary":{"get":{"tags":["Error Tracking"],"summary":"Error Summary","description":"Get error summary with counts by category and top errors.","operationId":"error_summary_api_admin_errors_summary_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":720,"minimum":1,"description":"Summary period in hours","default":24,"title":"Hours"},"description":"Summary period in hours"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/errors/{error_id}":{"patch":{"tags":["Error Tracking"],"summary":"Resolve Error","description":"Mark an error as resolved (or unresolved) with optional notes.","operationId":"resolve_error_api_admin_errors__error_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"error_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Error Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/errors/report":{"get":{"tags":["Error Tracking"],"summary":"Daily Report","description":"Generate a daily error report suitable for email delivery.\nIncludes 24h summary, 7d summary, critical errors, and recommendations.","operationId":"daily_report_api_admin_errors_report_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyReportResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/qomplement/runtime/capabilities":{"get":{"tags":["Qomplement Runtime"],"summary":"Runtime Capabilities","operationId":"runtime_capabilities_api_qomplement_runtime_capabilities_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"}},{"name":"engine","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engine"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/qomplement/runtime/chat":{"post":{"tags":["Qomplement Runtime"],"summary":"Runtime Chat","description":"Forward unified runtime chat requests to Kiwi streaming backend.","operationId":"runtime_chat_api_qomplement_runtime_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuntimeChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/process":{"post":{"summary":"Process Document","description":"Process a document using ONLY Outlines capabilities that work with OpenAI","operationId":"process_document_api_process_post","parameters":[{"name":"templateId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Templateid"}},{"name":"templateFields","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Templatefields"}},{"name":"outputFormat","in":"query","required":false,"schema":{"enum":["json","text","structured","xml","csv","yaml","markdown"],"type":"string","default":"structured","title":"Outputformat"}},{"name":"amet_session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amet Session Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_process_document_api_process_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates":{"get":{"summary":"Get Templates","description":"Get all templates","operationId":"get_templates_api_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Template-Output"},"type":"array","title":"Response Get Templates Api Templates Get"}}}}}},"post":{"summary":"Create Template","description":"Create a new template","operationId":"create_template_api_templates_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template-Input"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template-Output"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/batch-process":{"post":{"summary":"Batch Process","description":"Process multiple documents in batch","operationId":"batch_process_api_batch_process_post","parameters":[{"name":"templateId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Templateid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_batch_process_api_batch_process_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/create-extraction-api":{"post":{"summary":"Create Extraction Api","description":"Create a dynamic API endpoint based on extracted fields","operationId":"create_extraction_api_api_create_extraction_api_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAPIRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/extract/{api_id}":{"post":{"summary":"Extract With Api","description":"Extract data using a dynamically created API","operationId":"extract_with_api_api_extract__api_id__post","parameters":[{"name":"api_id","in":"path","required":true,"schema":{"type":"string","title":"Api Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_with_api_api_extract__api_id__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/list-apis":{"get":{"summary":"List Apis","description":"List all dynamically created APIs","operationId":"list_apis_api_list_apis_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/delete-api/{api_id}":{"delete":{"summary":"Delete Api Endpoint","description":"Delete a dynamic API endpoint","operationId":"delete_api_endpoint_api_delete_api__api_id__delete","parameters":[{"name":"api_id","in":"path","required":true,"schema":{"type":"string","title":"Api Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user/agent-rules":{"get":{"summary":"Get User Agent Rules","description":"Get user-level agent rules.","operationId":"get_user_agent_rules_api_user_agent_rules_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"put":{"summary":"Save User Agent Rules","description":"Save user-level agent rules (global + per document type).","operationId":"save_user_agent_rules_api_user_agent_rules_put","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Request"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/health":{"get":{"summary":"Health Check","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AIContractRequest":{"properties":{"contract_type":{"type":"string","title":"Contract Type"},"parties":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Parties"},"terms":{"type":"string","title":"Terms"},"additional_clauses":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Additional Clauses"}},"type":"object","required":["contract_type","parties","terms"],"title":"AIContractRequest"},"APIKeyCreatedResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"api_key":{"type":"string","title":"Api Key"},"key_prefix":{"type":"string","title":"Key Prefix"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","api_key","key_prefix","created_at"],"title":"APIKeyCreatedResponse"},"APIKeyResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["id","name","key_prefix","created_at","last_used_at","is_active"],"title":"APIKeyResponse"},"AcceptInvitationRequest":{"properties":{"token":{"type":"string","title":"Token"},"name":{"type":"string","title":"Name"},"password":{"type":"string","title":"Password"}},"type":"object","required":["token","name","password"],"title":"AcceptInvitationRequest"},"AllowedSenderRequest":{"properties":{"sender_email":{"type":"string","format":"email","title":"Sender Email"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"}},"type":"object","required":["sender_email"],"title":"AllowedSenderRequest"},"AllowedSenderResponse":{"properties":{"id":{"type":"string","title":"Id"},"sender_email":{"type":"string","title":"Sender Email"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","sender_email","sender_name","created_at"],"title":"AllowedSenderResponse"},"ApplyRequest":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"actions":{"items":{"type":"object"},"type":"array","title":"Actions"},"context":{"$ref":"#/components/schemas/filling_agent_chat__ChatContext","default":{"mode":"excel","document_ids":[],"parsed_data":{},"current_mappings":{},"cell_writes":[]}}},"type":"object","required":["conversation_id","actions"],"title":"ApplyRequest"},"AttachmentResponse":{"properties":{"id":{"type":"string","title":"Id"},"filename":{"type":"string","title":"Filename"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"file_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Type"},"download_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Url"}},"type":"object","required":["id","filename","mime_type","file_size_bytes","file_type"],"title":"AttachmentResponse"},"AutomapRequest":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"document_id":{"type":"string","title":"Document Id"},"selected_page_numbers":{"items":{"type":"integer"},"type":"array","title":"Selected Page Numbers"},"excel_fields":{"items":{"$ref":"#/components/schemas/ExcelFieldSchema"},"type":"array","title":"Excel Fields"},"openai_api_key":{"type":"string","title":"Openai Api Key"}},"type":"object","required":["batch_id","document_id","selected_page_numbers","excel_fields","openai_api_key"],"title":"AutomapRequest","description":"Request model for automap operation"},"BatchStatusResponse":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"status":{"type":"string","title":"Status"},"total_documents":{"type":"integer","title":"Total Documents"},"completed_documents":{"type":"integer","title":"Completed Documents"},"failed_documents":{"type":"integer","title":"Failed Documents"},"pending_documents":{"type":"integer","title":"Pending Documents"},"documents":{"items":{"type":"object"},"type":"array","title":"Documents"},"processing_notification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing Notification"},"created_at":{"type":"string","title":"Created At"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["batch_id","status","total_documents","completed_documents","failed_documents","pending_documents","documents","created_at","started_at","completed_at"],"title":"BatchStatusResponse","description":"Response model for batch status"},"BatchUploadResponse":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"document_count":{"type":"integer","title":"Document Count"},"documents":{"items":{"type":"object"},"type":"array","title":"Documents"},"message":{"type":"string","title":"Message"}},"type":"object","required":["batch_id","document_count","documents","message"],"title":"BatchUploadResponse","description":"Response model for batch upload"},"Body_batch_process_api_batch_process_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_batch_process_api_batch_process_post"},"Body_edit_document_visual_api_document_edit_visual_post":{"properties":{"file":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"File","description":"Document image to edit (JPEG, PNG, WebP, or PDF)"},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id","description":"Document ID to fetch from S3 (alternative to file upload)"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id","description":"Batch ID for document (used with document_id)"},"page_number":{"type":"integer","title":"Page Number","description":"Page number to edit (for multi-page documents)","default":1},"changes":{"type":"string","title":"Changes","description":"JSON array of field changes: [{fieldName, oldValue, newValue}]"},"user_id":{"type":"string","title":"User Id","description":"User ID for file organization"},"original_document_id":{"type":"string","title":"Original Document Id","description":"Original document ID for tracking"}},"type":"object","required":["changes","user_id"],"title":"Body_edit_document_visual_api_document_edit_visual_post"},"Body_extract_fields_api_pdf_extract_fields_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_extract_fields_api_pdf_extract_fields_post"},"Body_extract_schema_api_excel_extract_schema_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_extract_schema_api_excel_extract_schema_post"},"Body_extract_schema_from_pdf_api_pdf_extract_schema_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_extract_schema_from_pdf_api_pdf_extract_schema_post"},"Body_extract_validations_api_excel_validations_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_extract_validations_api_excel_validations_post"},"Body_extract_with_api_api_extract__api_id__post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_extract_with_api_api_extract__api_id__post"},"Body_extract_with_custom_model_api_training_extract__model_id__post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_extract_with_custom_model_api_training_extract__model_id__post"},"Body_get_field_positions_api_pdf_field_positions_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","title":"Body_get_field_positions_api_pdf_field_positions_post"},"Body_import_extraction_template_api_templates_import_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_import_extraction_template_api_templates_import_post"},"Body_process_batch_ocr_api_ocr_process_batch_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_process_batch_ocr_api_ocr_process_batch_post"},"Body_process_document_api_process_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_process_document_api_process_post"},"Body_process_ocr_api_ocr_process_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_process_ocr_api_ocr_process_post"},"Body_upload_batch_api_batch_upload_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"},"batch_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Name"},"use_parallel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Use Parallel"},"guest_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guest Session Id"},"schema_fields":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Fields"},"skip_processing":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skip Processing"},"processing_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing Mode"},"amet_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amet Session Id"}},"type":"object","required":["files"],"title":"Body_upload_batch_api_batch_upload_post"},"Body_upload_excel_template_api_excel_templates_upload_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_excel_template_api_excel_templates_upload_post"},"Body_upload_large_file_api_kiwi_upload_large_file_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_large_file_api_kiwi_upload_large_file_post"},"Body_upload_pdf_api_pdf_upload_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_pdf_api_pdf_upload_post"},"Body_upload_pdf_template_api_pdf_templates_upload_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_pdf_template_api_pdf_templates_upload_post"},"Body_upload_source_document_api_filling_agent_upload_source_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_source_document_api_filling_agent_upload_source_post"},"Body_upload_training_documents_api_training_jobs__job_id__documents_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_upload_training_documents_api_training_jobs__job_id__documents_post"},"Body_upload_url_api_batch_url_post":{"properties":{"url":{"type":"string","title":"Url"},"batch_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Name"},"schema_fields":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Fields"},"processing_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing Mode"},"guest_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guest Session Id"}},"type":"object","required":["url"],"title":"Body_upload_url_api_batch_url_post"},"ChannelConnect":{"properties":{"type":{"type":"string","title":"Type"},"config":{"type":"object","title":"Config","default":{}}},"type":"object","required":["type"],"title":"ChannelConnect"},"ChatMessage":{"properties":{"message":{"type":"string","title":"Message"},"context":{"anyOf":[{"$ref":"#/components/schemas/kiwi_routes__ChatContext"},{"type":"null"}]},"thinking_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thinking Mode","default":"fast"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"runtime_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Runtime Mode"},"requested_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested Model"},"runtime_handoff":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Runtime Handoff"},"runtime_capabilities":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Runtime Capabilities"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"file_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Type"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"suppress_user_message":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Suppress User Message","default":false},"structured_payload":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Structured Payload"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"}},"type":"object","required":["message"],"title":"ChatMessage"},"ChatRequest":{"properties":{"message":{"type":"string","title":"Message"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"context":{"$ref":"#/components/schemas/filling_agent_chat__ChatContext","default":{"mode":"excel","document_ids":[],"parsed_data":{},"current_mappings":{},"cell_writes":[]}}},"type":"object","required":["message"],"title":"ChatRequest"},"ChatSessionSave":{"properties":{"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"workflow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"messages":{"items":{"type":"object"},"type":"array","title":"Messages","default":[]},"generated_workflows":{"items":{"type":"object"},"type":"array","title":"Generated Workflows","default":[]}},"type":"object","title":"ChatSessionSave","description":"Request model for saving a chat session"},"ChatWithFileMessage":{"properties":{"message":{"type":"string","title":"Message"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"file_content_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Content Base64"},"file_mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Mime Type"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"suppress_user_message":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Suppress User Message","default":false},"attachment_group":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Attachment Group"}},"type":"object","required":["message"],"title":"ChatWithFileMessage"},"CheckoutSubscriptionRequest":{"properties":{"tier":{"type":"string","title":"Tier"}},"type":"object","required":["tier"],"title":"CheckoutSubscriptionRequest"},"CheckoutTopupRequest":{"properties":{"package":{"type":"string","title":"Package"}},"type":"object","required":["package"],"title":"CheckoutTopupRequest"},"CloudConnectionResponse":{"properties":{"id":{"type":"string","title":"Id"},"provider":{"type":"string","title":"Provider"},"provider_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Email"},"connected_at":{"type":"string","format":"date-time","title":"Connected At"},"is_active":{"type":"boolean","title":"Is Active"},"last_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync At"}},"type":"object","required":["id","provider","provider_email","connected_at","is_active","last_sync_at"],"title":"CloudConnectionResponse"},"ComparisonStartRequest":{"properties":{"template_id":{"type":"string","title":"Template Id"},"document_ids":{"items":{"type":"string"},"type":"array","title":"Document Ids","default":[]},"parsed_data":{"type":"object","title":"Parsed Data","default":{}},"template_data":{"anyOf":[{"items":{"items":{},"type":"array"},"type":"array"},{"type":"null"}],"title":"Template Data"},"active_sheet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Sheet"},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key"},"mode":{"type":"string","title":"Mode","default":"excel"}},"type":"object","required":["template_id"],"title":"ComparisonStartRequest"},"ConnectRequest":{"properties":{"callback_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callback Url"}},"type":"object","title":"ConnectRequest"},"ConvertRequest":{"properties":{"file_s3_key":{"type":"string","title":"File S3 Key"},"source_format":{"type":"string","title":"Source Format"},"target_format":{"type":"string","title":"Target Format"}},"type":"object","required":["file_s3_key","source_format","target_format"],"title":"ConvertRequest"},"CreateAPIKeyRequest":{"properties":{"name":{"type":"string","title":"Name","default":"Default API Key"}},"type":"object","title":"CreateAPIKeyRequest"},"CreateAPIRequest":{"properties":{"fields":{"items":{"$ref":"#/components/schemas/FieldDefinition"},"type":"array","title":"Fields"},"api_name":{"type":"string","title":"Api Name"}},"type":"object","required":["fields","api_name"],"title":"CreateAPIRequest"},"CreateJobRequest":{"properties":{"name":{"type":"string","title":"Name"},"target_schema":{"type":"object","title":"Target Schema"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"}},"type":"object","required":["name","target_schema"],"title":"CreateJobRequest"},"CreateKeyRequest":{"properties":{"name":{"type":"string","title":"Name"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"}},"type":"object","required":["name"],"title":"CreateKeyRequest"},"CreateOrgRequest":{"properties":{"name":{"type":"string","title":"Name"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"}},"type":"object","required":["name"],"title":"CreateOrgRequest"},"CreateOrganizationRequest":{"properties":{"name":{"type":"string","title":"Name"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"}},"type":"object","required":["name"],"title":"CreateOrganizationRequest"},"CreateProjectRequest":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["name"],"title":"CreateProjectRequest"},"CreateSessionRequest":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"CreateSessionRequest"},"CreateTemplateRequest":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"fields":{"items":{"$ref":"#/components/schemas/Field"},"type":"array","title":"Fields"}},"type":"object","required":["name","fields"],"title":"CreateTemplateRequest","description":"Request model for creating extraction template"},"CreateWebhookRequest":{"properties":{"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events","default":["job.completed","job.failed"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["url"],"title":"CreateWebhookRequest"},"CustomFieldModel":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description","default":""},"page":{"type":"integer","title":"Page","default":0},"x":{"type":"number","title":"X","default":10.0},"y":{"type":"number","title":"Y","default":10.0},"width":{"type":"number","title":"Width","default":20.0},"height":{"type":"number","title":"Height","default":4.0},"type":{"type":"string","title":"Type","default":"text"},"font_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Font Size"}},"type":"object","required":["id","name"],"title":"CustomFieldModel","description":"A user-placed field on a non-fillable PDF"},"DailyReportResponse":{"properties":{"report_date":{"type":"string","title":"Report Date"},"generated_at":{"type":"string","title":"Generated At"},"summary_24h":{"type":"object","title":"Summary 24H"},"summary_7d":{"type":"object","title":"Summary 7D"},"new_critical_errors":{"items":{},"type":"array","title":"New Critical Errors"},"recommendations":{"items":{},"type":"array","title":"Recommendations"}},"type":"object","required":["report_date","generated_at","summary_24h","summary_7d","new_critical_errors","recommendations"],"title":"DailyReportResponse"},"DatabaseConnectionCreate":{"properties":{"name":{"type":"string","title":"Name"},"database_type":{"type":"string","title":"Database Type"},"connection_config":{"type":"object","title":"Connection Config"}},"type":"object","required":["name","database_type","connection_config"],"title":"DatabaseConnectionCreate","description":"Request model for creating a new database connection"},"DatabaseConnectionDetailsResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"name":{"type":"string","title":"Name"},"database_type":{"type":"string","title":"Database Type"},"is_active":{"type":"boolean","title":"Is Active"},"is_connected":{"type":"boolean","title":"Is Connected"},"last_tested_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Tested At"},"last_test_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Test Status"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Host"},"port":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Port"},"database_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Database Name"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"password_set":{"type":"boolean","title":"Password Set","default":false},"ssl":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ssl"}},"type":"object","required":["id","user_id","name","database_type","is_active","is_connected","created_at","updated_at"],"title":"DatabaseConnectionDetailsResponse","description":"Response model for database connection with config (password masked)"},"DatabaseConnectionResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"name":{"type":"string","title":"Name"},"database_type":{"type":"string","title":"Database Type"},"is_active":{"type":"boolean","title":"Is Active"},"is_connected":{"type":"boolean","title":"Is Connected"},"last_tested_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Tested At"},"last_test_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Test Status"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","user_id","name","database_type","is_active","is_connected","created_at","updated_at"],"title":"DatabaseConnectionResponse","description":"Response model for database connection (without sensitive data)"},"DatabaseConnectionUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"connection_config":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Connection Config"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"DatabaseConnectionUpdate","description":"Request model for updating a database connection"},"DetectMappingsStreamRequest":{"properties":{"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"},"workbook":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workbook"},"document_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Document Ids"},"documents":{"anyOf":[{"items":{"$ref":"#/components/schemas/excel_routes__DocumentData"},"type":"array"},{"type":"null"}],"title":"Documents"},"field_data":{"type":"object","title":"Field Data","default":{}},"fill_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fill Mode","default":"smart"},"retry_columns":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Retry Columns"},"retry_context":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Retry Context"},"schema_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Schema Fields"},"schema_field_definitions":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Schema Field Definitions"}},"type":"object","title":"DetectMappingsStreamRequest","description":"Request model for streaming mapping detection - uses IDs, not raw data"},"DetectTypeRequest":{"properties":{"text_content":{"type":"string","title":"Text Content"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"}},"type":"object","required":["text_content"],"title":"DetectTypeRequest"},"DocumentChatRequest":{"properties":{"document_name":{"type":"string","title":"Document Name","default":""},"extracted_data":{"type":"object","title":"Extracted Data","default":{}},"raw_text":{"type":"string","title":"Raw Text","default":""},"messages":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Messages","default":[]},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"available_documents":{"items":{"type":"object"},"type":"array","title":"Available Documents","default":[]},"active_target":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Active Target"},"active_document_ids":{"items":{"type":"string"},"type":"array","title":"Active Document Ids","default":[]},"available_targets":{"items":{"type":"object"},"type":"array","title":"Available Targets","default":[]},"use_global_memory":{"type":"boolean","title":"Use Global Memory","default":true},"runtime_handoff":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Runtime Handoff"},"runtime_capabilities":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Runtime Capabilities"}},"type":"object","title":"DocumentChatRequest","description":"Request model for document AI chat"},"DocumentChatSessionSave":{"properties":{"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"document_name":{"type":"string","title":"Document Name","default":""},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"messages":{"items":{"type":"object"},"type":"array","title":"Messages","default":[]},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"extracted_data":{"type":"object","title":"Extracted Data","default":{}},"has_charts":{"type":"boolean","title":"Has Charts","default":false},"has_files":{"type":"boolean","title":"Has Files","default":false}},"type":"object","title":"DocumentChatSessionSave"},"DocumentShareResponse":{"properties":{"id":{"type":"string","title":"Id"},"resource_type":{"type":"string","title":"Resource Type"},"resource_id":{"type":"string","title":"Resource Id"},"resource_name":{"type":"string","title":"Resource Name"},"shared_by_email":{"type":"string","title":"Shared By Email"},"shared_with_team_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shared With Team Name"},"shared_with_user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shared With User Email"},"permission_level":{"type":"string","title":"Permission Level"},"shared_at":{"type":"string","title":"Shared At"}},"type":"object","required":["id","resource_type","resource_id","resource_name","shared_by_email","permission_level","shared_at"],"title":"DocumentShareResponse"},"ErrorListResponse":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/ErrorResponse"},"type":"array","title":"Errors"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["errors","total","page","page_size"],"title":"ErrorListResponse"},"ErrorResponse":{"properties":{"id":{"type":"string","title":"Id"},"timestamp":{"type":"string","title":"Timestamp"},"category":{"type":"string","title":"Category"},"severity":{"type":"string","title":"Severity"},"endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint"},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method"},"error_type":{"type":"string","title":"Error Type"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"stack_trace":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stack Trace"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"guest_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guest Id"},"request_context":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Request Context"},"resolved":{"type":"boolean","title":"Resolved"},"resolution_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Notes"},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved At"}},"type":"object","required":["id","timestamp","category","severity","error_type","resolved"],"title":"ErrorResponse"},"ErrorSummaryResponse":{"properties":{"period_hours":{"type":"integer","title":"Period Hours"},"since":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"},"total_errors":{"type":"integer","title":"Total Errors"},"unresolved":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unresolved"},"by_category":{"type":"object","title":"By Category"},"by_severity":{"type":"object","title":"By Severity"},"top_errors":{"items":{},"type":"array","title":"Top Errors"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["period_hours","total_errors","by_category","by_severity","top_errors"],"title":"ErrorSummaryResponse"},"ExcelAIToolRequest":{"properties":{"template_id":{"type":"string","title":"Template Id"},"task":{"type":"string","title":"Task"},"task_type":{"type":"string","title":"Task Type","default":"custom"},"selection":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Selection"}},"type":"object","required":["template_id","task"],"title":"ExcelAIToolRequest"},"ExcelFieldSchema":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"required":{"type":"boolean","title":"Required","default":false}},"type":"object","required":["name","type"],"title":"ExcelFieldSchema","description":"Schema for Excel template field"},"ExecuteSingleStepRequest":{"properties":{"session_id":{"type":"string","title":"Session Id"},"step":{"type":"object","title":"Step","default":{}}},"type":"object","required":["session_id"],"title":"ExecuteSingleStepRequest"},"ExecuteStepsRequest":{"properties":{"session_id":{"type":"string","title":"Session Id"},"steps":{"items":{},"type":"array","title":"Steps","default":[]},"global_instructions":{"type":"string","title":"Global Instructions","default":""}},"type":"object","required":["session_id"],"title":"ExecuteStepsRequest"},"ExecutionRequest":{"properties":{"parameters":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Parameters","default":{}}},"type":"object","title":"ExecutionRequest","description":"Request model for executing a workflow"},"ExecutionResponse":{"properties":{"id":{"type":"string","title":"Id"},"workflow_id":{"type":"string","title":"Workflow Id"},"user_id":{"type":"string","title":"User Id"},"status":{"type":"string","title":"Status"},"started_at":{"type":"string","title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"result_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Result Data"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"execution_log":{"items":{"type":"object"},"type":"array","title":"Execution Log"},"rows_processed":{"type":"integer","title":"Rows Processed"},"bytes_processed":{"type":"integer","title":"Bytes Processed"},"execution_time_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Execution Time Ms"},"metadata_json":{"type":"object","title":"Metadata Json"},"workflow_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Name"},"workflow_snapshot":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Workflow Snapshot"}},"type":"object","required":["id","workflow_id","user_id","status","started_at","completed_at","result_data","error_message","execution_log","rows_processed","bytes_processed","execution_time_ms","metadata_json"],"title":"ExecutionResponse","description":"Response model for a workflow execution"},"ExportRequest":{"properties":{"documents":{"items":{"type":"object"},"type":"array","title":"Documents"},"include_images":{"type":"boolean","title":"Include Images","default":true}},"type":"object","required":["documents"],"title":"ExportRequest","description":"Request model for export operations"},"ExtractFieldsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"fields":{"items":{"$ref":"#/components/schemas/PDFFormField"},"type":"array","title":"Fields"},"page_count":{"type":"integer","title":"Page Count"},"is_fillable":{"type":"boolean","title":"Is Fillable"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success","fields","page_count","is_fillable"],"title":"ExtractFieldsResponse","description":"Response model for field extraction"},"ExtractRequest":{"properties":{"query":{"type":"string","title":"Query"},"max_rows":{"type":"integer","title":"Max Rows","default":1000},"structure_with_ai":{"type":"boolean","title":"Structure With Ai","default":true}},"type":"object","required":["query"],"title":"ExtractRequest","description":"Request model for extracting structured data from database"},"ExtractStructuredRequest":{"properties":{"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"ExtractStructuredRequest"},"Field":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"required":{"type":"boolean","title":"Required","default":false},"constraints":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Constraints"}},"type":"object","required":["name","type"],"title":"Field","description":"Field definition for extraction template"},"FieldConstraints":{"properties":{"minLength":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Minlength"},"maxLength":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Maxlength"},"pattern":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pattern"},"enum":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Enum"},"min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min"},"max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max"}},"type":"object","title":"FieldConstraints"},"FieldDefaultConfig":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":true},"default":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default"}},"type":"object","title":"FieldDefaultConfig","description":"Configuration for a single payload field"},"FieldDefinition":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","enum":["string","number","boolean","array","object","date"],"title":"Type"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"required":{"type":"boolean","title":"Required","default":true},"constraints":{"anyOf":[{"$ref":"#/components/schemas/FieldConstraints"},{"type":"null"}]}},"type":"object","required":["name","type"],"title":"FieldDefinition"},"FieldMapping":{"properties":{"field":{"type":"string","title":"Field"},"cell":{"type":"string","title":"Cell"},"sheet":{"type":"string","title":"Sheet"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"type":{"type":"string","title":"Type","default":"cell"}},"type":"object","required":["field","cell","sheet"],"title":"FieldMapping","description":"A single field-to-cell mapping"},"FieldSuggestRequest":{"properties":{"field_name":{"type":"string","title":"Field Name"},"field_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field Description"},"source_fields":{"items":{"type":"object"},"type":"array","title":"Source Fields"},"top_k":{"type":"integer","title":"Top K","default":5}},"type":"object","required":["field_name","source_fields"],"title":"FieldSuggestRequest"},"FillFieldsRequest":{"properties":{"fields":{"items":{"type":"object"},"type":"array","title":"Fields"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"},"num_alternatives":{"type":"integer","title":"Num Alternatives","default":5}},"type":"object","required":["fields"],"title":"FillFieldsRequest","description":"Request to find values for filling fields"},"FillOverlayField":{"properties":{"page":{"type":"integer","title":"Page","default":0},"x":{"type":"number","title":"X"},"y":{"type":"number","title":"Y"},"width":{"type":"number","title":"Width"},"height":{"type":"number","title":"Height"},"value":{"type":"string","title":"Value"},"type":{"type":"string","title":"Type","default":"text"},"font_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Font Size"}},"type":"object","required":["x","y","width","height","value"],"title":"FillOverlayField","description":"A field with value to stamp onto the PDF"},"FillOverlayRequest":{"properties":{"template_id":{"type":"string","title":"Template Id"},"fields":{"items":{"$ref":"#/components/schemas/FillOverlayField"},"type":"array","title":"Fields"}},"type":"object","required":["template_id","fields"],"title":"FillOverlayRequest","description":"Request to fill a non-fillable PDF with overlay text"},"FillPDFRequest":{"properties":{"pdf_content":{"type":"string","title":"Pdf Content"},"field_values":{"type":"object","title":"Field Values"},"flatten":{"type":"boolean","title":"Flatten","default":false}},"type":"object","required":["pdf_content","field_values"],"title":"FillPDFRequest","description":"Request model for PDF filling"},"FillPDFResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"pdf":{"type":"string","title":"Pdf"},"fields_filled":{"type":"integer","title":"Fields Filled"},"filename":{"type":"string","title":"Filename"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success","pdf","fields_filled","filename"],"title":"FillPDFResponse","description":"Response model for PDF filling"},"FillRequest":{"properties":{"connection_id":{"type":"string","title":"Connection Id"},"table_name":{"type":"string","title":"Table Name"},"data":{"items":{"type":"object"},"type":"array","title":"Data"},"auto_map":{"type":"boolean","title":"Auto Map","default":true}},"type":"object","required":["connection_id","table_name","data"],"title":"FillRequest","description":"Request model for filling/inserting data into database"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"GenerateExcelRequest":{"properties":{"json_data":{"type":"object","title":"Json Data"},"mappings":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Mappings"},"template_workbook":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Workbook"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"}},"type":"object","required":["json_data"],"title":"GenerateExcelRequest","description":"Request model for Excel generation"},"GenerateExcelResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"excel":{"type":"string","title":"Excel"},"filename":{"type":"string","title":"Filename"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success","excel","filename"],"title":"GenerateExcelResponse","description":"Response model for Excel generation"},"GenerateRequest":{"properties":{"template_id":{"type":"string","title":"Template Id"},"field_values":{"type":"object","title":"Field Values"},"file_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Format","default":"pdf"}},"type":"object","required":["template_id","field_values"],"title":"GenerateRequest"},"GenerateStepsRequest":{"properties":{"session_id":{"type":"string","title":"Session Id"},"source_data":{"type":"object","title":"Source Data","default":{}}},"type":"object","required":["session_id"],"title":"GenerateStepsRequest"},"GoogleAuthResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"user":{"type":"object","title":"User"}},"type":"object","required":["access_token","user"],"title":"GoogleAuthResponse"},"GoogleDriveAuthRequest":{"properties":{"code":{"type":"string","title":"Code"},"redirect_uri":{"type":"string","title":"Redirect Uri"}},"type":"object","required":["code","redirect_uri"],"title":"GoogleDriveAuthRequest"},"GoogleTokenRequest":{"properties":{"token":{"type":"string","title":"Token"},"promo_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Promo Code"}},"type":"object","required":["token"],"title":"GoogleTokenRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImportFilesRequest":{"properties":{"connection_id":{"type":"string","title":"Connection Id"},"file_ids":{"items":{"type":"string"},"type":"array","title":"File Ids"}},"type":"object","required":["connection_id","file_ids"],"title":"ImportFilesRequest"},"IndexDocumentRequest":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"document_id":{"type":"string","title":"Document Id"},"document_name":{"type":"string","title":"Document Name"},"page_number":{"type":"integer","title":"Page Number"},"structured_data":{"type":"object","title":"Structured Data"}},"type":"object","required":["batch_id","document_id","document_name","page_number","structured_data"],"title":"IndexDocumentRequest","description":"Request to index a document's extracted data"},"InvitationInfo":{"properties":{"team_name":{"type":"string","title":"Team Name"},"organization_name":{"type":"string","title":"Organization Name"},"inviter_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inviter Name"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["team_name","organization_name","inviter_name","email","role","expires_at"],"title":"InvitationInfo"},"KiwiAgentCreate":{"properties":{"name":{"type":"string","title":"Name","default":"qomplement AI"}},"type":"object","title":"KiwiAgentCreate"},"KiwiAgentUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"guardrails":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Guardrails"}},"type":"object","title":"KiwiAgentUpdate"},"KiwiConnectionCreate":{"properties":{"name":{"type":"string","title":"Name"},"instance_url":{"type":"string","title":"Instance Url"},"api_token":{"type":"string","title":"Api Token"},"default_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Agent Id"},"default_agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Agent Name"},"metadata_json":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Metadata Json"},"from_kiwi":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"From Kiwi","default":false}},"type":"object","required":["name","instance_url","api_token"],"title":"KiwiConnectionCreate"},"KiwiConnectionUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"instance_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Url"},"api_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Token"},"default_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Agent Id"},"default_agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Agent Name"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"metadata_json":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Metadata Json"}},"type":"object","title":"KiwiConnectionUpdate"},"ManualEventCreate":{"properties":{"title":{"type":"string","title":"Title"},"start_datetime":{"type":"string","title":"Start Datetime"},"duration_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Minutes","default":60},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"end_datetime":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Datetime"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"}},"type":"object","required":["title","start_datetime"],"title":"ManualEventCreate"},"MappingAlternative":{"properties":{"value":{"type":"string","title":"Value"},"document_id":{"type":"string","title":"Document Id","default":""},"document_name":{"type":"string","title":"Document Name","default":""},"page_number":{"type":"integer","title":"Page Number","default":1},"source_field":{"type":"string","title":"Source Field","default":""},"confidence":{"type":"number","title":"Confidence","default":0.0},"reason":{"type":"string","title":"Reason","default":""}},"type":"object","required":["value"],"title":"MappingAlternative","description":"An alternative match for a field"},"MappingChatRequest":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"document_id":{"type":"string","title":"Document Id"},"aggregated_data":{"type":"object","title":"Aggregated Data"},"user_query":{"type":"string","title":"User Query"},"openai_api_key":{"type":"string","title":"Openai Api Key"}},"type":"object","required":["batch_id","document_id","aggregated_data","user_query","openai_api_key"],"title":"MappingChatRequest","description":"Request model for mapping chat"},"MatchRequest":{"properties":{"comparison_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comparison Id"},"target_data":{"items":{"type":"object"},"type":"array","title":"Target Data"},"source_data":{"items":{"type":"object"},"type":"array","title":"Source Data"},"match_fields":{"items":{"type":"string"},"type":"array","title":"Match Fields","default":[]},"fuzzy_threshold":{"type":"number","title":"Fuzzy Threshold","default":0.6},"source_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Label"}},"type":"object","required":["target_data","source_data"],"title":"MatchRequest"},"MatchSchemaRequest":{"properties":{"document_id":{"type":"string","title":"Document Id"},"batch_id":{"type":"string","title":"Batch Id"},"schema_fields":{"items":{"type":"object"},"type":"array","title":"Schema Fields"},"page_numbers":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Page Numbers"}},"type":"object","required":["document_id","batch_id","schema_fields"],"title":"MatchSchemaRequest","description":"Request to re-structure extracted text using a schema"},"MemberResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"picture_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Picture Url"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"joined_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Joined At"}},"type":"object","required":["id","user_id","email","name","role","status"],"title":"MemberResponse"},"MemoryCreate":{"properties":{"title":{"type":"string","title":"Title"},"content":{"type":"string","title":"Content"},"scope":{"type":"string","title":"Scope","default":"user"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},"type":"object","required":["title","content"],"title":"MemoryCreate"},"MemoryUpdate":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"pinned":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Pinned"}},"type":"object","title":"MemoryUpdate"},"MessageResponse":{"properties":{"message":{"type":"string","title":"Message"},"success":{"type":"boolean","title":"Success","default":true}},"type":"object","required":["message"],"title":"MessageResponse"},"MiniAgentConfigureRequest":{"properties":{"prompt":{"type":"string","title":"Prompt"},"available_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Available Tools"}},"type":"object","required":["prompt"],"title":"MiniAgentConfigureRequest"},"OCRRegionRequest":{"properties":{"page":{"type":"integer","title":"Page","default":0},"x":{"type":"number","title":"X"},"y":{"type":"number","title":"Y"},"width":{"type":"number","title":"Width"},"height":{"type":"number","title":"Height"}},"type":"object","required":["x","y","width","height"],"title":"OCRRegionRequest","description":"Request to OCR a specific region of a PDF page"},"OCRResponse":{"properties":{"document_id":{"type":"string","title":"Document Id"},"text":{"type":"string","title":"Text"},"pages":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Pages"},"bounding_boxes":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Bounding Boxes","default":[]},"api_dimensions":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"Api Dimensions"},"structured_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Structured Data"},"tokens_used":{"type":"integer","title":"Tokens Used"},"tokens_remaining":{"type":"integer","title":"Tokens Remaining"},"processing_time_ms":{"type":"integer","title":"Processing Time Ms"}},"type":"object","required":["document_id","text","tokens_used","tokens_remaining","processing_time_ms"],"title":"OCRResponse","description":"Response model for OCR processing"},"OrganizationResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"max_teams":{"type":"integer","title":"Max Teams"},"max_members_per_team":{"type":"integer","title":"Max Members Per Team"},"created_at":{"type":"string","title":"Created At"},"is_owner":{"type":"boolean","title":"Is Owner","default":false}},"type":"object","required":["id","name","slug","subscription_tier","max_teams","max_members_per_team","created_at"],"title":"OrganizationResponse"},"PDFFieldMapping":{"properties":{"pdf_field":{"type":"string","title":"Pdf Field"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"field_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field Type"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"source_field":{"type":"string","title":"Source Field"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"confidence":{"type":"number","title":"Confidence","default":0.0},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"document_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Name"},"page_number":{"type":"integer","title":"Page Number","default":1},"alternatives":{"items":{"$ref":"#/components/schemas/MappingAlternative"},"type":"array","title":"Alternatives","default":[]}},"type":"object","required":["pdf_field","source_field"],"title":"PDFFieldMapping","description":"A single field-to-value mapping with alternatives"},"PDFFormField":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value","default":""},"default_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Value","default":""},"tooltip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tooltip","default":""},"required":{"type":"boolean","title":"Required","default":false},"readonly":{"type":"boolean","title":"Readonly","default":false},"multiline":{"type":"boolean","title":"Multiline","default":false},"options":{"anyOf":[{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array"},{"type":"null"}],"title":"Options"}},"type":"object","required":["name","type"],"title":"PDFFormField","description":"A single PDF form field"},"PageUpdateRequest":{"properties":{"extracted_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extracted Text"},"bounding_boxes":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Bounding Boxes"},"structured_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Structured Data"}},"type":"object","title":"PageUpdateRequest","description":"Request model for updating page data"},"PreviewRequest":{"properties":{"pdf_content":{"type":"string","title":"Pdf Content"},"page":{"type":"integer","title":"Page","default":0}},"type":"object","required":["pdf_content"],"title":"PreviewRequest","description":"Request model for PDF preview"},"PreviewResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"image":{"type":"string","title":"Image"},"width":{"type":"integer","title":"Width"},"height":{"type":"integer","title":"Height"},"page_count":{"type":"integer","title":"Page Count"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success","image","width","height","page_count"],"title":"PreviewResponse","description":"Response model for PDF preview"},"ProcessingResponse":{"properties":{"documentId":{"type":"string","title":"Documentid"},"extractedData":{"type":"object","title":"Extracteddata"},"rawText":{"type":"string","title":"Rawtext"},"suggestedFields":{"anyOf":[{"items":{"$ref":"#/components/schemas/FieldDefinition"},"type":"array"},{"type":"null"}],"title":"Suggestedfields"},"formats":{"additionalProperties":{"type":"string"},"type":"object","title":"Formats","default":{}},"apiEndpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Apiendpoint"}},"type":"object","required":["documentId","extractedData","rawText"],"title":"ProcessingResponse"},"PurchaseCreditsRequest":{"properties":{"package_id":{"type":"string","title":"Package Id"}},"type":"object","required":["package_id"],"title":"PurchaseCreditsRequest"},"QueryRequest":{"properties":{"query":{"type":"string","title":"Query"},"max_rows":{"type":"integer","title":"Max Rows","default":1000}},"type":"object","required":["query"],"title":"QueryRequest","description":"Request model for executing a database query"},"QuickActionCreate":{"properties":{"webhook_id":{"type":"string","title":"Webhook Id"},"name":{"type":"string","title":"Name"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon","default":"Zap"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color","default":"#3b82f6"},"order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Order","default":0}},"type":"object","required":["webhook_id","name"],"title":"QuickActionCreate"},"QuickActionFromWorkflow":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"name":{"type":"string","title":"Name"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon","default":"Zap"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color","default":"#3b82f6"}},"type":"object","required":["workflow_id","name"],"title":"QuickActionFromWorkflow","description":"Create a quick action directly from a workflow - auto-creates webhook if needed"},"QuickActionUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"},"order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Order"},"is_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Enabled"}},"type":"object","title":"QuickActionUpdate"},"ReceivedEmailDetail":{"properties":{"id":{"type":"string","title":"Id"},"sender_email":{"type":"string","title":"Sender Email"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text"},"received_at":{"type":"string","format":"date-time","title":"Received At"},"is_read":{"type":"boolean","title":"Is Read"},"attachments":{"items":{"$ref":"#/components/schemas/AttachmentResponse"},"type":"array","title":"Attachments"}},"type":"object","required":["id","sender_email","sender_name","subject","body_text","received_at","is_read","attachments"],"title":"ReceivedEmailDetail"},"ReceivedEmailSummary":{"properties":{"id":{"type":"string","title":"Id"},"sender_email":{"type":"string","title":"Sender Email"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"received_at":{"type":"string","format":"date-time","title":"Received At"},"is_read":{"type":"boolean","title":"Is Read"},"attachment_count":{"type":"integer","title":"Attachment Count"}},"type":"object","required":["id","sender_email","sender_name","subject","received_at","is_read","attachment_count"],"title":"ReceivedEmailSummary"},"ResetPasswordRequest":{"properties":{"token":{"type":"string","title":"Token"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["token","new_password"],"title":"ResetPasswordRequest"},"ResolveRequest":{"properties":{"resolved":{"type":"boolean","title":"Resolved","default":true},"resolution_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Notes"}},"type":"object","title":"ResolveRequest"},"RestoreSnapshotRequest":{"properties":{"template_id":{"type":"string","title":"Template Id"},"snapshot_key":{"type":"string","title":"Snapshot Key"},"charts":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Charts"}},"type":"object","required":["template_id","snapshot_key"],"title":"RestoreSnapshotRequest"},"RetryFieldInfo":{"properties":{"pdf_field":{"type":"string","title":"Pdf Field"},"display_name":{"type":"string","title":"Display Name"},"field_type":{"type":"string","title":"Field Type","default":"text"},"description":{"type":"string","title":"Description","default":""},"current_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Value"},"issue":{"type":"string","title":"Issue","default":""}},"type":"object","required":["pdf_field","display_name"],"title":"RetryFieldInfo","description":"A field to retry with context about what went wrong"},"RetryFieldsRequest":{"properties":{"fields_to_retry":{"items":{"$ref":"#/components/schemas/RetryFieldInfo"},"type":"array","title":"Fields To Retry"},"documents":{"items":{"$ref":"#/components/schemas/pdf_routes__DocumentData"},"type":"array","title":"Documents"},"all_mappings":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"All Mappings"},"source_template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Template Id"},"filled_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Filled Data"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["fields_to_retry","documents"],"title":"RetryFieldsRequest","description":"Request model for retrying specific fields"},"RunAgentRequest":{"properties":{"prompt":{"type":"string","title":"Prompt"},"max_steps":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Steps"}},"type":"object","required":["prompt"],"title":"RunAgentRequest"},"RuntimeChatAttachment":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"metadata":{"type":"object","title":"Metadata"}},"type":"object","title":"RuntimeChatAttachment"},"RuntimeChatContext":{"properties":{"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"},"metadata":{"type":"object","title":"Metadata"}},"type":"object","title":"RuntimeChatContext"},"RuntimeChatMessage":{"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"],"title":"Role"},"content":{"type":"string","title":"Content"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"metadata":{"type":"object","title":"Metadata"}},"type":"object","required":["role","content"],"title":"RuntimeChatMessage"},"RuntimeChatRequest":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/RuntimeChatMessage"},"type":"array","title":"Messages"},"stream":{"type":"boolean","title":"Stream","default":true},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"},"attachments":{"items":{"$ref":"#/components/schemas/RuntimeChatAttachment"},"type":"array","title":"Attachments"},"context":{"anyOf":[{"$ref":"#/components/schemas/RuntimeChatContext"},{"type":"null"}]},"metadata":{"type":"object","title":"Metadata"}},"type":"object","title":"RuntimeChatRequest"},"SaveCustomFieldsRequest":{"properties":{"custom_fields":{"items":{"$ref":"#/components/schemas/CustomFieldModel"},"type":"array","title":"Custom Fields"}},"type":"object","required":["custom_fields"],"title":"SaveCustomFieldsRequest","description":"Request to save custom fields for a PDF template"},"SaveFieldDescriptionsRequest":{"properties":{"field_descriptions":{"additionalProperties":{"type":"string"},"type":"object","title":"Field Descriptions"}},"type":"object","required":["field_descriptions"],"title":"SaveFieldDescriptionsRequest","description":"Request to save field descriptions for a fillable PDF"},"SaveFilledExcelRequest":{"properties":{"excel_content":{"type":"string","title":"Excel Content"},"name":{"type":"string","title":"Name"},"source_template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Template Id"},"filled_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Filled Data"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["excel_content","name"],"title":"SaveFilledExcelRequest","description":"Request model for saving a filled Excel file"},"SaveFilledPDFRequest":{"properties":{"pdf_content":{"type":"string","title":"Pdf Content"},"name":{"type":"string","title":"Name"}},"type":"object","required":["pdf_content","name"],"title":"SaveFilledPDFRequest","description":"Request model for saving a filled PDF"},"SaveGeneratedFileRequest":{"properties":{"s3_key":{"type":"string","title":"S3 Key"},"filename":{"type":"string","title":"Filename"},"action":{"type":"string","title":"Action"},"file_type":{"type":"string","title":"File Type","default":"excel"}},"type":"object","required":["s3_key","filename","action"],"title":"SaveGeneratedFileRequest"},"ScheduleCreate":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"schedule_type":{"type":"string","title":"Schedule Type"},"time_of_day":{"type":"string","title":"Time Of Day","default":"09:00"},"days_of_week":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Days Of Week"},"day_of_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Day Of Month"},"cron_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cron Expression"},"timezone":{"type":"string","title":"Timezone","default":"UTC"},"is_enabled":{"type":"boolean","title":"Is Enabled","default":true},"notification_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notification Email"},"notify_on_start":{"type":"boolean","title":"Notify On Start","default":false},"notify_on_complete":{"type":"boolean","title":"Notify On Complete","default":true},"notify_on_failure":{"type":"boolean","title":"Notify On Failure","default":true}},"type":"object","required":["workflow_id","schedule_type"],"title":"ScheduleCreate"},"ScheduleUpdate":{"properties":{"schedule_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Type"},"time_of_day":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Time Of Day"},"days_of_week":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Days Of Week"},"day_of_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Day Of Month"},"cron_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cron Expression"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"is_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Enabled"},"is_paused":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Paused"},"notification_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notification Email"},"notify_on_start":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Notify On Start"},"notify_on_complete":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Notify On Complete"},"notify_on_failure":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Notify On Failure"}},"type":"object","title":"ScheduleUpdate"},"SchemaField":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type","default":"text"},"description":{"type":"string","title":"Description","default":""}},"type":"object","required":["name"],"title":"SchemaField","description":"A schema field with description"},"SchemaGeneratorRequest":{"properties":{"messages":{"items":{"type":"object"},"type":"array","title":"Messages","default":[]},"document_text":{"type":"string","title":"Document Text","default":""},"document_data":{"type":"object","title":"Document Data","default":{}},"existing_schema":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Existing Schema"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"}},"type":"object","title":"SchemaGeneratorRequest","description":"Request model for conversational schema generation"},"SearchRequest":{"properties":{"query":{"type":"string","title":"Query"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"},"num_results":{"type":"integer","title":"Num Results","default":10}},"type":"object","required":["query"],"title":"SearchRequest","description":"Request for semantic search"},"SelectVariationRequest":{"properties":{"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Name"}},"type":"object","title":"SelectVariationRequest"},"SessionCreate":{"properties":{"connection_id":{"type":"string","title":"Connection Id"},"phone_number":{"type":"string","title":"Phone Number"},"agent_config":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Agent Config"}},"type":"object","required":["connection_id","phone_number"],"title":"SessionCreate"},"SessionRequest":{"properties":{"session_id":{"type":"string","title":"Session Id"}},"type":"object","required":["session_id"],"title":"SessionRequest"},"SessionUpdate":{"properties":{"agent_config":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Agent Config"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"SessionUpdate"},"ShareDocumentRequest":{"properties":{"resource_type":{"type":"string","title":"Resource Type"},"resource_id":{"type":"string","title":"Resource Id"},"share_with_team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Share With Team Id"},"share_with_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Share With User Id"},"permission_level":{"type":"string","title":"Permission Level","default":"view"}},"type":"object","required":["resource_type","resource_id"],"title":"ShareDocumentRequest"},"ShareWorkflowRequest":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"share_with_team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Share With Team Id"},"share_with_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Share With User Id"},"permission_level":{"type":"string","title":"Permission Level","default":"view"}},"type":"object","required":["workflow_id"],"title":"ShareWorkflowRequest"},"SharedDocumentResponse":{"properties":{"id":{"type":"string","title":"Id"},"resource_type":{"type":"string","title":"Resource Type"},"resource_id":{"type":"string","title":"Resource Id"},"resource_name":{"type":"string","title":"Resource Name"},"owner_email":{"type":"string","title":"Owner Email"},"permission_level":{"type":"string","title":"Permission Level"},"shared_at":{"type":"string","title":"Shared At"}},"type":"object","required":["id","resource_type","resource_id","resource_name","owner_email","permission_level","shared_at"],"title":"SharedDocumentResponse"},"SharedWorkflowResponse":{"properties":{"id":{"type":"string","title":"Id"},"workflow_id":{"type":"string","title":"Workflow Id"},"workflow_name":{"type":"string","title":"Workflow Name"},"workflow_type":{"type":"string","title":"Workflow Type"},"owner_email":{"type":"string","title":"Owner Email"},"permission_level":{"type":"string","title":"Permission Level"},"shared_at":{"type":"string","title":"Shared At"}},"type":"object","required":["id","workflow_id","workflow_name","workflow_type","owner_email","permission_level","shared_at"],"title":"SharedWorkflowResponse"},"SignatureRequestCreate":{"properties":{"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"signers":{"items":{"$ref":"#/components/schemas/SignerCreate"},"type":"array","title":"Signers"},"expires_in_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In Days","default":30}},"type":"object","required":["signers"],"title":"SignatureRequestCreate"},"SignatureSubmit":{"properties":{"signature_image":{"type":"string","title":"Signature Image"},"signed_name":{"type":"string","title":"Signed Name"}},"type":"object","required":["signature_image","signed_name"],"title":"SignatureSubmit"},"SignerCreate":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"}},"type":"object","required":["name","email"],"title":"SignerCreate"},"StartSessionRequest":{"properties":{"session_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Name"}},"type":"object","title":"StartSessionRequest"},"SubmitRequest":{"properties":{"session_id":{"type":"string","title":"Session Id"},"submit_step":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Submit Step"}},"type":"object","required":["session_id"],"title":"SubmitRequest"},"SubscribePlanRequest":{"properties":{"plan_id":{"type":"string","title":"Plan Id"}},"type":"object","required":["plan_id"],"title":"SubscribePlanRequest"},"TeamActivityResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"user_email":{"type":"string","title":"User Email"},"user_name":{"type":"string","title":"User Name"},"activity_type":{"type":"string","title":"Activity Type"},"activity_description":{"type":"string","title":"Activity Description"},"timestamp":{"type":"string","title":"Timestamp"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id"}},"type":"object","required":["user_id","user_email","user_name","activity_type","activity_description","timestamp"],"title":"TeamActivityResponse"},"TeamDocumentResponse":{"properties":{"id":{"type":"string","title":"Id"},"filename":{"type":"string","title":"Filename"},"status":{"type":"string","title":"Status"},"owner_id":{"type":"string","title":"Owner Id"},"owner_email":{"type":"string","title":"Owner Email"},"owner_name":{"type":"string","title":"Owner Name"},"created_at":{"type":"string","title":"Created At"},"processed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processed At"}},"type":"object","required":["id","filename","status","owner_id","owner_email","owner_name","created_at"],"title":"TeamDocumentResponse"},"TeamMemberSummary":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"picture_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Picture Url"},"role":{"type":"string","title":"Role"},"documents_count":{"type":"integer","title":"Documents Count"},"workflows_count":{"type":"integer","title":"Workflows Count"},"last_active":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Active"}},"type":"object","required":["user_id","email","name","role","documents_count","workflows_count"],"title":"TeamMemberSummary"},"TeamMembershipResponse":{"properties":{"team_id":{"type":"string","title":"Team Id"},"team_name":{"type":"string","title":"Team Name"},"organization_id":{"type":"string","title":"Organization Id"},"organization_name":{"type":"string","title":"Organization Name"},"role":{"type":"string","title":"Role"},"is_admin":{"type":"boolean","title":"Is Admin"}},"type":"object","required":["team_id","team_name","organization_id","organization_name","role","is_admin"],"title":"TeamMembershipResponse"},"TeamResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"member_count":{"type":"integer","title":"Member Count"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","name","member_count","created_at"],"title":"TeamResponse"},"TeamUsageStats":{"properties":{"total_documents":{"type":"integer","title":"Total Documents"},"total_workflows":{"type":"integer","title":"Total Workflows"},"total_executions":{"type":"integer","title":"Total Executions"},"tokens_used_today":{"type":"integer","title":"Tokens Used Today"},"tokens_used_this_week":{"type":"integer","title":"Tokens Used This Week"},"active_members":{"type":"integer","title":"Active Members"}},"type":"object","required":["total_documents","total_workflows","total_executions","tokens_used_today","tokens_used_this_week","active_members"],"title":"TeamUsageStats"},"TeamWorkflowResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"workflow_type":{"type":"string","title":"Workflow Type"},"owner_id":{"type":"string","title":"Owner Id"},"owner_email":{"type":"string","title":"Owner Email"},"owner_name":{"type":"string","title":"Owner Name"},"execution_count":{"type":"integer","title":"Execution Count"},"last_executed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Executed At"},"last_execution_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Execution Status"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","name","workflow_type","owner_id","owner_email","owner_name","execution_count","created_at"],"title":"TeamWorkflowResponse"},"Template-Input":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"fields":{"items":{"$ref":"#/components/schemas/FieldDefinition"},"type":"array","title":"Fields"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"updatedAt":{"type":"string","format":"date-time","title":"Updatedat"}},"type":"object","required":["id","name","fields","createdAt","updatedAt"],"title":"Template"},"Template-Output":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"fields":{"items":{"$ref":"#/components/schemas/FieldDefinition"},"type":"array","title":"Fields"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"updatedAt":{"type":"string","format":"date-time","title":"Updatedat"}},"type":"object","required":["id","name","fields","createdAt","updatedAt"],"title":"Template"},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"user":{"type":"object","title":"User"}},"type":"object","required":["access_token","user"],"title":"TokenResponse"},"TokenUsageResponse":{"properties":{"tokens_used_today":{"type":"integer","title":"Tokens Used Today"},"daily_limit":{"type":"integer","title":"Daily Limit"},"tokens_remaining":{"type":"integer","title":"Tokens Remaining"},"subscription_tier":{"type":"string","title":"Subscription Tier"}},"type":"object","required":["tokens_used_today","daily_limit","tokens_remaining","subscription_tier"],"title":"TokenUsageResponse"},"ToolExecuteRequest":{"properties":{"tool":{"type":"string","title":"Tool"},"params":{"type":"object","title":"Params","default":{}},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"allowed_connectors":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Connectors"}},"type":"object","required":["tool"],"title":"ToolExecuteRequest"},"Ui2BookCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"documentIds":{"items":{"type":"string"},"type":"array","title":"Documentids"},"target":{"anyOf":[{"$ref":"#/components/schemas/Ui2BookTarget"},{"type":"null"}]}},"type":"object","required":["name"],"title":"Ui2BookCreateRequest"},"Ui2BookTarget":{"properties":{"kind":{"type":"string","title":"Kind"},"templateId":{"type":"string","title":"Templateid"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["kind","templateId","name"],"title":"Ui2BookTarget"},"Ui2BookUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"documentIds":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Documentids"},"target":{"anyOf":[{"$ref":"#/components/schemas/Ui2BookTarget"},{"type":"null"}]}},"type":"object","title":"Ui2BookUpdateRequest"},"UpdateMemberRoleRequest":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"UpdateMemberRoleRequest"},"UpdateOrgRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","title":"UpdateOrgRequest"},"UpdateOrganizationRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"}},"type":"object","title":"UpdateOrganizationRequest"},"UpdateProjectRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"UpdateProjectRequest"},"UpdateRoleRequest":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"UpdateRoleRequest"},"UpdateTeamRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"UpdateTeamRequest"},"UpdateWebhookRequest":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"events":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Events"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"UpdateWebhookRequest"},"UploadEmailResponse":{"properties":{"email_address":{"type":"string","title":"Email Address"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["email_address","is_active","created_at"],"title":"UploadEmailResponse"},"UserLogin":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"UserLogin"},"UserRegistration":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"subscription_tier":{"type":"string","title":"Subscription Tier","default":"free"}},"type":"object","required":["email"],"title":"UserRegistration"},"UserSignup":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"},"promo_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Promo Code"}},"type":"object","required":["name","email","password"],"title":"UserSignup"},"UserUsageStats":{"properties":{"total_documents":{"type":"integer","title":"Total Documents"},"total_workflows":{"type":"integer","title":"Total Workflows"},"total_executions":{"type":"integer","title":"Total Executions"},"tokens_used_today":{"type":"integer","title":"Tokens Used Today"},"tokens_used_this_week":{"type":"integer","title":"Tokens Used This Week"},"last_active_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Active At"}},"type":"object","required":["total_documents","total_workflows","total_executions","tokens_used_today","tokens_used_this_week"],"title":"UserUsageStats"},"ValidateRequest":{"properties":{"ratings":{"items":{"type":"object"},"type":"array","title":"Ratings"}},"type":"object","required":["ratings"],"title":"ValidateRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyEmailRequest":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"VerifyEmailRequest"},"WebFillRequest":{"properties":{"url":{"type":"string","title":"Url"},"field_data":{"type":"object","title":"Field Data"},"rescan":{"type":"boolean","title":"Rescan","default":false}},"type":"object","required":["url","field_data"],"title":"WebFillRequest"},"WebFillV3Request":{"properties":{"url":{"type":"string","title":"Url"},"field_data":{"type":"object","title":"Field Data","default":{}},"additional_instructions":{"type":"string","title":"Additional Instructions","default":""}},"type":"object","required":["url"],"title":"WebFillV3Request"},"WebPreviewRequest":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"WebPreviewRequest"},"WebScanRequest":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"WebScanRequest"},"WebSubmitRequest":{"properties":{"url":{"type":"string","title":"Url"},"fields":{"items":{},"type":"array","title":"Fields","default":[]}},"type":"object","required":["url"],"title":"WebSubmitRequest"},"WebUpdateRequest":{"properties":{"url":{"type":"string","title":"Url"},"field_values":{"additionalProperties":{"type":"string"},"type":"object","title":"Field Values"}},"type":"object","required":["url","field_values"],"title":"WebUpdateRequest"},"WebhookCreate":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"auth_type":{"type":"string","title":"Auth Type","default":"none"},"secret_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret Key"}},"type":"object","required":["workflow_id"],"title":"WebhookCreate"},"WebhookFieldDefaults":{"properties":{"field_defaults":{"additionalProperties":{"$ref":"#/components/schemas/FieldDefaultConfig"},"type":"object","title":"Field Defaults"}},"type":"object","required":["field_defaults"],"title":"WebhookFieldDefaults","description":"Field defaults configuration for a webhook"},"WorkflowChatRequest":{"properties":{"messages":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Messages","default":[]},"current_nodes":{"items":{"type":"object"},"type":"array","title":"Current Nodes","default":[]},"current_edges":{"items":{"type":"object"},"type":"array","title":"Current Edges","default":[]},"workflow_name":{"type":"string","title":"Workflow Name","default":""},"context":{"type":"object","title":"Context","default":{}}},"type":"object","title":"WorkflowChatRequest","description":"Request model for workflow AI chat"},"WorkflowCreate":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"workflow_type":{"type":"string","title":"Workflow Type"},"nodes":{"items":{"$ref":"#/components/schemas/WorkflowNode"},"type":"array","title":"Nodes","default":[]},"edges":{"items":{"$ref":"#/components/schemas/WorkflowEdge"},"type":"array","title":"Edges","default":[]},"is_template":{"type":"boolean","title":"Is Template","default":false},"metadata_json":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Metadata Json","default":{}}},"type":"object","required":["name","workflow_type"],"title":"WorkflowCreate","description":"Request model for creating a new workflow"},"WorkflowEdge":{"properties":{"id":{"type":"string","title":"Id"},"source":{"type":"string","title":"Source"},"target":{"type":"string","title":"Target"},"sourceHandle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sourcehandle"},"targetHandle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Targethandle"}},"type":"object","required":["id","source","target"],"title":"WorkflowEdge","description":"An edge/connection between workflow nodes"},"WorkflowExecutionResponse":{"properties":{"id":{"type":"string","title":"Id"},"workflow_id":{"type":"string","title":"Workflow Id"},"workflow_name":{"type":"string","title":"Workflow Name"},"executed_by_id":{"type":"string","title":"Executed By Id"},"executed_by_email":{"type":"string","title":"Executed By Email"},"status":{"type":"string","title":"Status"},"started_at":{"type":"string","title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"rows_processed":{"type":"integer","title":"Rows Processed"},"execution_time_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Execution Time Ms"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"}},"type":"object","required":["id","workflow_id","workflow_name","executed_by_id","executed_by_email","status","started_at","rows_processed"],"title":"WorkflowExecutionResponse"},"WorkflowNode":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"position":{"additionalProperties":{"type":"number"},"type":"object","title":"Position"},"data":{"$ref":"#/components/schemas/WorkflowNodeData"}},"type":"object","required":["id","type","position","data"],"title":"WorkflowNode","description":"A node in the workflow graph"},"WorkflowNodeData":{"properties":{"label":{"type":"string","title":"Label"},"nodeType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nodetype"}},"additionalProperties":true,"type":"object","required":["label"],"title":"WorkflowNodeData","description":"Configuration data for a workflow node"},"WorkflowResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"workflow_type":{"type":"string","title":"Workflow Type"},"nodes":{"items":{"type":"object"},"type":"array","title":"Nodes"},"edges":{"items":{"type":"object"},"type":"array","title":"Edges"},"is_active":{"type":"boolean","title":"Is Active"},"is_template":{"type":"boolean","title":"Is Template"},"last_executed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Executed At"},"last_execution_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Execution Status"},"execution_count":{"type":"integer","title":"Execution Count"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"metadata_json":{"type":"object","title":"Metadata Json"}},"type":"object","required":["id","user_id","name","description","workflow_type","nodes","edges","is_active","is_template","last_executed_at","last_execution_status","execution_count","created_at","updated_at","metadata_json"],"title":"WorkflowResponse","description":"Response model for a workflow"},"WorkflowShareResponse":{"properties":{"id":{"type":"string","title":"Id"},"workflow_id":{"type":"string","title":"Workflow Id"},"workflow_name":{"type":"string","title":"Workflow Name"},"shared_by_email":{"type":"string","title":"Shared By Email"},"shared_with_team_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shared With Team Name"},"shared_with_user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shared With User Email"},"permission_level":{"type":"string","title":"Permission Level"},"shared_at":{"type":"string","title":"Shared At"}},"type":"object","required":["id","workflow_id","workflow_name","shared_by_email","permission_level","shared_at"],"title":"WorkflowShareResponse"},"WorkflowUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"nodes":{"anyOf":[{"items":{"$ref":"#/components/schemas/WorkflowNode"},"type":"array"},{"type":"null"}],"title":"Nodes"},"edges":{"anyOf":[{"items":{"$ref":"#/components/schemas/WorkflowEdge"},"type":"array"},{"type":"null"}],"title":"Edges"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"is_template":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Template"},"metadata_json":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Metadata Json"}},"type":"object","title":"WorkflowUpdate","description":"Request model for updating a workflow"},"auth_routes__UserResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"email_verified":{"type":"boolean","title":"Email Verified","default":false},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"},"is_org_owner":{"type":"boolean","title":"Is Org Owner","default":false},"google_linked":{"type":"boolean","title":"Google Linked","default":false}},"type":"object","required":["id","email","name"],"title":"UserResponse"},"batch_routes__RetryRequest":{"properties":{"document_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Document Ids"},"processing_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing Mode","default":"normal"}},"type":"object","title":"RetryRequest"},"developer_routes__CreateTeamRequest":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["name"],"title":"CreateTeamRequest"},"developer_routes__InviteMemberRequest":{"properties":{"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role","default":"member"}},"type":"object","required":["email"],"title":"InviteMemberRequest"},"excel_routes__DetectMappingsRequest":{"properties":{"workbook":{"type":"string","title":"Workbook"},"fields":{"items":{"type":"string"},"type":"array","title":"Fields"},"field_data":{"type":"object","title":"Field Data","default":{}}},"type":"object","required":["workbook","fields"],"title":"DetectMappingsRequest","description":"Request model for mapping detection"},"excel_routes__DetectMappingsResponse":{"properties":{"mappings":{"items":{"$ref":"#/components/schemas/FieldMapping"},"type":"array","title":"Mappings"}},"type":"object","required":["mappings"],"title":"DetectMappingsResponse","description":"Response model for mapping detection"},"excel_routes__DocumentData":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"extracted_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Extracted Data"}},"type":"object","required":["id","name"],"title":"DocumentData","description":"A single document's extracted data for streaming endpoint"},"filling_agent_chat__ChatContext":{"properties":{"mode":{"type":"string","title":"Mode","default":"excel"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"},"filled_template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filled Template Id"},"document_ids":{"items":{"type":"string"},"type":"array","title":"Document Ids","default":[]},"parsed_data":{"type":"object","title":"Parsed Data","default":{}},"current_mappings":{"additionalProperties":{"type":"string"},"type":"object","title":"Current Mappings","default":{}},"cell_writes":{"items":{"type":"object"},"type":"array","title":"Cell Writes","default":[]},"template_data":{"anyOf":[{"items":{"items":{},"type":"array"},"type":"array"},{"type":"null"}],"title":"Template Data"},"selection":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Selection"},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key"},"active_sheet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Sheet"},"field_definitions":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Field Definitions"},"agent_rules":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Rules"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"}},"type":"object","title":"ChatContext"},"kiwi_routes__ChatContext":{"properties":{"activeDocument":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Activedocument"},"activeBatch":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Activebatch"},"activeView":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activeview"}},"type":"object","title":"ChatContext"},"organization_routes__InviteMemberRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"role":{"type":"string","title":"Role","default":"member"}},"type":"object","required":["email"],"title":"InviteMemberRequest"},"pdf_routes__DetectMappingsRequest":{"properties":{"pdf_content":{"type":"string","title":"Pdf Content"},"document_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Document Data"},"documents":{"anyOf":[{"items":{"$ref":"#/components/schemas/pdf_routes__DocumentData"},"type":"array"},{"type":"null"}],"title":"Documents"},"field_schema":{"anyOf":[{"items":{"$ref":"#/components/schemas/SchemaField"},"type":"array"},{"type":"null"}],"title":"Field Schema"},"schema":{"anyOf":[{"items":{"$ref":"#/components/schemas/SchemaField"},"type":"array"},{"type":"null"}],"title":"Schema"},"high_precision":{"type":"boolean","title":"High Precision","default":false},"field_descriptions":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Field Descriptions"},"custom_fields":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Custom Fields"},"agent_rules":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Rules"}},"type":"object","required":["pdf_content"],"title":"DetectMappingsRequest","description":"Request model for mapping detection - supports multiple documents"},"pdf_routes__DetectMappingsResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"mappings":{"items":{"$ref":"#/components/schemas/PDFFieldMapping"},"type":"array","title":"Mappings"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"notice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notice"}},"type":"object","required":["success","mappings"],"title":"DetectMappingsResponse","description":"Response model for mapping detection"},"pdf_routes__DocumentData":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"extracted_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Extracted Data"}},"type":"object","required":["id","name"],"title":"DocumentData","description":"A single document's extracted data"},"precision_retry_routes__RetryRequest":{"properties":{"document_ids":{"items":{"type":"string"},"type":"array","title":"Document Ids"},"batch_id":{"type":"string","title":"Batch Id"},"apply_to_all_pages":{"type":"boolean","title":"Apply To All Pages","default":false},"page_numbers":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Page Numbers"},"schema_fields":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Schema Fields"}},"type":"object","required":["document_ids","batch_id"],"title":"RetryRequest"},"user_management__UserResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"daily_token_limit":{"type":"integer","title":"Daily Token Limit"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","full_name","subscription_tier","daily_token_limit","is_active","created_at"],"title":"UserResponse"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}