{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/models":{"get":{"summary":"Get Available Models","description":"Get list of available models from configuration.\n\nReturns models grouped by type (chat, embedding, etc.) with their metadata.","operationId":"get_available_models_models_get","parameters":[{"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/ModelsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["models"],"summary":"Save Model","description":"Save a custom model configuration.","operationId":"save_model_models_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveModelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ping":{"get":{"tags":["health"],"summary":"Ping Health","description":"Simple health check endpoint that returns 200 OK.","operationId":"ping_health_ping_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthCheckResponse"}}}}}}},"/health":{"get":{"tags":["health"],"summary":"Health Check","description":"Comprehensive health check endpoint that queries all underlying services.\n\nChecks the following services:\n- PostgreSQL database\n- Redis\n- PGVector store\n- Storage service (Local/S3)\n- ColPali vector store (if enabled)","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetailedHealthCheckResponse"}}}}}}},"/ingest/text":{"post":{"tags":["Ingestion"],"summary":"Ingest Text","description":"Ingest a **text** document asynchronously (queued like /ingest/file).","operationId":"ingest_text_ingest_text_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestTextRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ingest/file":{"post":{"tags":["Ingestion"],"summary":"Ingest File","description":"Ingest a **file** asynchronously.\n\nThe file is uploaded to object storage, a *Document* stub is persisted\nwith ``status='processing'`` and a background worker picks up the heavy\nparsing / chunking work.","operationId":"ingest_file_ingest_file_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_ingest_file_ingest_file_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ingest/files":{"post":{"tags":["Ingestion"],"summary":"Batch Ingest Files","description":"Batch ingest **multiple files** (async).\n\nEach file is treated the same as :func:`ingest_file` but sharing the same\nrequest avoids many round-trips. All heavy work is still delegated to the\nbackground worker pool.","operationId":"batch_ingest_files_ingest_files_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_batch_ingest_files_ingest_files_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchIngestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ingest/requeue":{"post":{"tags":["Ingestion"],"summary":"Requeue Ingest Jobs","description":"Requeue ingestion jobs for documents stuck in processing or marked as failed.","operationId":"requeue_ingest_jobs_ingest_requeue_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequeueIngestionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequeueIngestionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ingest/document/query":{"post":{"tags":["Ingestion"],"summary":"Query Document","description":"Execute a one-off analysis for a document using Morphik On-the-Fly, optionally enforcing structured output and\nscheduling a follow-up ingestion.\n\n`ingestion_options` is a JSON string controlling post-analysis ingestion behaviour via keys such as `ingest`,\n`metadata`, `use_colpali`, `folder_name`, and `end_user_id`. Additional keys are ignored. A\n:class:`DocumentQueryResponse` describing the inline analysis and any queued ingestion is returned.","operationId":"query_document_ingest_document_query_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_query_document_ingest_document_query_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentQueryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/migrate/document":{"post":{"tags":["Migration"],"summary":"Migrate Document","description":"Ingest a migrated source document while preserving its document ID.","operationId":"migrate_document_migrate_document_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_migrate_document_migrate_document_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MigrationIngestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/list_docs":{"post":{"tags":["Documents"],"summary":"List Docs","description":"Flexible document listing with aggregates, projections, and advanced pagination.\n\nAlias: `/documents` and `/documents/list_docs` share this handler.\n\n**Supported operators**: `$and`, `$or`, `$nor`, `$not`, `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte`,\n`$in`, `$nin`, `$exists`, `$type`, `$regex`, `$contains`.\n\n**Implicit equality** (backwards compatible, JSONB containment):\n```json\n{\"status\": \"active\"}\n```\n\n**Explicit operators** (typed comparisons for number, decimal, datetime, date):\n```json\n{\"priority\": {\"$gte\": 40}, \"end_date\": {\"$lt\": \"2025-01-01\"}}\n```\n\nUse `document_filters` with a `filename` key to filter the filename column:\n```json\n{\"filename\": {\"$regex\": {\"pattern\": \"^report_.*\\.pdf$\", \"flags\": \"i\"}}}\n```\n\nUse `folder_name` and `end_user_id` query parameters to scope system metadata.","operationId":"list_docs_documents_list_docs_post","parameters":[{"name":"folder_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"null"}],"openapi_extra":{"style":"form","explode":true},"title":"Folder Name"}},{"name":"folder_depth","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Folder scope depth: 0/None = exact, -1 = all descendants, n > 0 = include descendants up to n levels.","title":"Folder Depth"},"description":"Folder scope depth: 0/None = exact, -1 = all descendants, n > 0 = include descendants up to n levels."},{"name":"end_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDocsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDocsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents":{"post":{"tags":["Documents"],"summary":"List Docs","description":"Flexible document listing with aggregates, projections, and advanced pagination.\n\nAlias: `/documents` and `/documents/list_docs` share this handler.\n\n**Supported operators**: `$and`, `$or`, `$nor`, `$not`, `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte`,\n`$in`, `$nin`, `$exists`, `$type`, `$regex`, `$contains`.\n\n**Implicit equality** (backwards compatible, JSONB containment):\n```json\n{\"status\": \"active\"}\n```\n\n**Explicit operators** (typed comparisons for number, decimal, datetime, date):\n```json\n{\"priority\": {\"$gte\": 40}, \"end_date\": {\"$lt\": \"2025-01-01\"}}\n```\n\nUse `document_filters` with a `filename` key to filter the filename column:\n```json\n{\"filename\": {\"$regex\": {\"pattern\": \"^report_.*\\.pdf$\", \"flags\": \"i\"}}}\n```\n\nUse `folder_name` and `end_user_id` query parameters to scope system metadata.","operationId":"list_docs_documents_post","parameters":[{"name":"folder_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"null"}],"openapi_extra":{"style":"form","explode":true},"title":"Folder Name"}},{"name":"folder_depth","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Folder scope depth: 0/None = exact, -1 = all descendants, n > 0 = include descendants up to n levels.","title":"Folder Depth"},"description":"Folder scope depth: 0/None = exact, -1 = all descendants, n > 0 = include descendants up to n levels."},{"name":"end_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDocsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDocsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}":{"get":{"tags":["Documents"],"summary":"Get Document","description":"Retrieve a single document by its external identifier.\n\nReturns the :class:`Document` metadata if found or raises 404.","operationId":"get_document_documents__document_id__get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"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/Document"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Documents"],"summary":"Delete Document","description":"Delete a document and all associated data.\n\nThis endpoint deletes a document and all its associated data, including:\n- Document metadata\n- Document content in storage\n- Document chunks and embeddings in vector store","operationId":"delete_document_documents__document_id__delete","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"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/DocumentDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/status":{"get":{"tags":["Documents"],"summary":"Get Document Status","description":"Get the processing status of a document.","operationId":"get_document_status_documents__document_id__status_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Document Status Documents  Document Id  Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/summary":{"get":{"tags":["Documents"],"summary":"Get Document Summary","description":"Retrieve the latest summary for a document.","operationId":"get_document_summary_documents__document_id__summary_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"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/SummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Documents"],"summary":"Upsert Document Summary","description":"Create or update a document summary with optional versioning.","operationId":"upsert_document_summary_documents__document_id__summary_put","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummaryUpsertRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/filename/{filename}":{"get":{"tags":["Documents"],"summary":"Get Document By Filename","description":"Get document by filename.","operationId":"get_document_by_filename_documents_filename__filename__get","parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}},{"name":"folder_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"null"}],"openapi_extra":{"style":"form","explode":true},"title":"Folder Name"}},{"name":"folder_depth","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Folder scope depth: 0/None = exact, -1 = all descendants, n > 0 = include descendants up to n levels.","title":"Folder Depth"},"description":"Folder scope depth: 0/None = exact, -1 = all descendants, n > 0 = include descendants up to n levels."},{"name":"end_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id"}},{"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/Document"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/download_url":{"get":{"tags":["Documents"],"summary":"Get Document Download Url","description":"Get a download URL for a specific document.","operationId":"get_document_download_url_documents__document_id__download_url_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"expires_in","in":"query","required":false,"schema":{"type":"integer","description":"URL expiration time in seconds","default":3600,"title":"Expires In"},"description":"URL expiration time in seconds"},{"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/DocumentDownloadUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/file":{"get":{"tags":["Documents"],"summary":"Download Document File","description":"Download the actual file content for a document.\nThis endpoint is used for local storage when file:// URLs cannot be accessed by browsers.","operationId":"download_document_file_documents__document_id__file_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"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"}}}}}}},"/documents/{document_id}/update_text":{"post":{"tags":["Documents"],"summary":"Update Document Text","description":"Update a document by replacing its text content and queueing re-ingestion.","operationId":"update_document_text_documents__document_id__update_text_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestTextRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/update_file":{"post":{"tags":["Documents"],"summary":"Update Document File","description":"Update a document by replacing its content with a new file and queueing re-ingestion.","operationId":"update_document_file_documents__document_id__update_file_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_update_document_file_documents__document_id__update_file_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/update_metadata":{"post":{"tags":["Documents"],"summary":"Update Document Metadata","description":"Update only a document's metadata.","operationId":"update_document_metadata_documents__document_id__update_metadata_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetadataUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/pages":{"post":{"tags":["Documents"],"summary":"Extract Document Pages","description":"Extract specific pages from a document (PDF, PowerPoint, or Word) as base64-encoded images or URLs.\nWhen output_format=\"url\", pages that fail URL generation fall back to base64 data URIs (mixed output possible).","operationId":"extract_document_pages_documents_pages_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPagesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPagesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/folders":{"post":{"tags":["Folders"],"summary":"Create Folder","description":"Create a new folder.","operationId":"create_folder_folders_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Folder"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Folders"],"summary":"List Folders","description":"List all folders the user has access to.","operationId":"list_folders_folders_get","parameters":[{"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/Folder"},"title":"Response List Folders Folders Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/folders/details":{"post":{"tags":["Folders"],"summary":"Folder Details","description":"Retrieve folder metadata with optional document statistics and projections.","operationId":"folder_details_folders_details_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderDetailsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderDetailsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/folders/summary":{"get":{"tags":["Folders"],"summary":"List Folder Summaries","description":"Return compact folder list (id, name, doc_count, updated_at).","operationId":"list_folder_summaries_folders_summary_get","parameters":[{"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/FolderSummary"},"title":"Response List Folder Summaries Folders Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/folders/{folder_id_or_name}/summary":{"get":{"tags":["Folders"],"summary":"Get Folder Summary","description":"Retrieve the latest summary for a folder.","operationId":"get_folder_summary_folders__folder_id_or_name__summary_get","parameters":[{"name":"folder_id_or_name","in":"path","required":true,"schema":{"type":"string","title":"Folder Id Or Name"}},{"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/SummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Folders"],"summary":"Upsert Folder Summary","description":"Create or update a folder summary with optional versioning.","operationId":"upsert_folder_summary_folders__folder_id_or_name__summary_put","parameters":[{"name":"folder_id_or_name","in":"path","required":true,"schema":{"type":"string","title":"Folder Id Or Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummaryUpsertRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/folders/{folder_id_or_name}/documents/{document_id}":{"post":{"tags":["Folders"],"summary":"Add Document To Folder","description":"Add a document to a folder.","operationId":"add_document_to_folder_folders__folder_id_or_name__documents__document_id__post","parameters":[{"name":"folder_id_or_name","in":"path","required":true,"schema":{"type":"string","title":"Folder Id Or Name"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"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/DocumentAddToFolderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Folders"],"summary":"Remove Document From Folder","description":"Remove a document from a folder.","operationId":"remove_document_from_folder_folders__folder_id_or_name__documents__document_id__delete","parameters":[{"name":"folder_id_or_name","in":"path","required":true,"schema":{"type":"string","title":"Folder Id Or Name"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"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/DocumentDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/folders/{folder_id_or_name}/move":{"post":{"tags":["Folders"],"summary":"Move Folder","description":"Move and/or rename a folder by providing a new path.\n\n- Changing the last segment renames the folder.\n- Changing parent segments moves it.\n- All descendant folders and documents are updated atomically.\n- Missing ancestor folders at the new location are created automatically.","operationId":"move_folder_folders__folder_id_or_name__move_post","parameters":[{"name":"folder_id_or_name","in":"path","required":true,"schema":{"type":"string","title":"Folder Id Or Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderMove"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Folder"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/folders/{folder_id_or_name}":{"get":{"tags":["Folders"],"summary":"Get Folder","description":"Get a folder by ID or name.","operationId":"get_folder_folders__folder_id_or_name__get","parameters":[{"name":"folder_id_or_name","in":"path","required":true,"schema":{"type":"string","title":"Folder Id Or Name"}},{"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/Folder"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Folders"],"summary":"Delete Folder","description":"Delete a folder and all associated documents.","operationId":"delete_folder_folders__folder_id_or_name__delete","parameters":[{"name":"folder_id_or_name","in":"path","required":true,"schema":{"type":"string","title":"Folder Id Or Name"}},{"name":"recursive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Recursive"}},{"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/FolderDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/custom":{"get":{"tags":["models"],"summary":"List Custom Models","description":"List all custom models for the authenticated user.","operationId":"list_custom_models_models_custom_get","parameters":[{"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/ModelResponse"},"title":"Response List Custom Models Models Custom Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/{model_id}":{"delete":{"tags":["models"],"summary":"Delete Model","description":"Delete a custom model.","operationId":"delete_model_models__model_id__delete","parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Delete Model Models  Model Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api-keys":{"post":{"tags":["models"],"summary":"Save Api Key","description":"Save API key for a provider.","operationId":"save_api_key_api_keys_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveApiKeyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Save Api Key Api Keys Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["models"],"summary":"List Api Keys","description":"List all configured API keys (sanitized).","operationId":"list_api_keys_api_keys_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":true},"title":"Response List Api Keys Api Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/documents":{"post":{"tags":["V2"],"summary":"Ingest Document V2","operationId":"ingest_document_v2_v2_documents_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_ingest_document_v2_v2_documents_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2IngestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/retrieve/chunks":{"post":{"tags":["V2"],"summary":"Retrieve Chunks V2","operationId":"retrieve_chunks_v2_v2_retrieve_chunks_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2RetrieveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2RetrieveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/documents/{document_id}":{"delete":{"tags":["V2"],"summary":"Delete Document V2","operationId":"delete_document_v2_v2_documents__document_id__delete","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"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/DocumentDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logs/":{"get":{"tags":["Logs"],"summary":"Get Logs","description":"Return recent logs for the authenticated user (scoped by app_id).\n\nArgs:\n    hours: Number of hours of history to retrieve (default 4)\n           - <= 4 hours: reads from local files\n           - > 4 hours: queries logs.morphik.ai proxy (requires proxy endpoint)","operationId":"get_logs_logs__get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"hours","in":"query","required":false,"schema":{"type":"number","maximum":168.0,"minimum":0.1,"default":4.0,"title":"Hours"}},{"name":"op_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Op Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"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/LogResponse"},"title":"Response Get Logs Logs  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/usage/app-storage":{"get":{"tags":["Usage"],"summary":"Get App Storage Usage","operationId":"get_app_storage_usage_usage_app_storage_get","parameters":[{"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/AppStorageUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ee/connectors/{connector_type}/auth_status":{"get":{"tags":["EE - Connectors"],"summary":"Get Auth Status For Connector","description":"Checks the current authentication status for the given connector type.","operationId":"get_auth_status_for_connector_ee_connectors__connector_type__auth_status_get","parameters":[{"name":"connector_type","in":"path","required":true,"schema":{"type":"string","title":"Connector Type"}},{"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/ConnectorAuthStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ee/connectors/{connector_type}/auth/initiate_url":{"get":{"tags":["EE - Connectors"],"summary":"Get Initiate Auth Url","description":"Return the provider's *authorization_url* for the given connector.\n\nThe method mirrors the logic of the `/auth/initiate` endpoint but sends a\nJSON payload instead of a redirect so that browsers can stay on the same\norigin until they intentionally navigate away.\n\nFor OAuth-based connectors, this returns authorization_url.\nFor manual credential connectors, this returns the credential form specification.","operationId":"get_initiate_auth_url_ee_connectors__connector_type__auth_initiate_url_get","parameters":[{"name":"connector_type","in":"path","required":true,"schema":{"type":"string","title":"Connector Type"}},{"name":"app_redirect_uri","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Redirect Uri"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ManualCredentialsAuthResponse"},{"$ref":"#/components/schemas/OAuthAuthResponse"}],"title":"Response Get Initiate Auth Url Ee Connectors  Connector Type  Auth Initiate Url Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ee/connectors/{connector_type}/oauth2callback":{"get":{"tags":["EE - Connectors"],"summary":"Connector Oauth Callback","description":"Handles the OAuth 2.0 callback from the authentication provider.\nValidates state, finalizes authentication, and stores credentials.","operationId":"connector_oauth_callback_ee_connectors__connector_type__oauth2callback_get","parameters":[{"name":"connector_type","in":"path","required":true,"schema":{"type":"string","title":"Connector Type"}},{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ee/connectors/{connector_type}/auth/finalize":{"post":{"tags":["EE - Connectors"],"summary":"Finalize Manual Auth","description":"Finalize authentication using manual credentials.\n\nThis endpoint is used for connectors that require manual credential input\n(like Zotero) instead of OAuth flows.","operationId":"finalize_manual_auth_ee_connectors__connector_type__auth_finalize_post","parameters":[{"name":"connector_type","in":"path","required":true,"schema":{"type":"string","title":"Connector Type"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualCredentialsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Finalize Manual Auth Ee Connectors  Connector Type  Auth Finalize Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ee/connectors/{connector_type}/files":{"get":{"tags":["EE - Connectors"],"summary":"List Files For Connector","description":"Lists files and folders from the specified connector.","operationId":"list_files_for_connector_ee_connectors__connector_type__files_get","parameters":[{"name":"connector_type","in":"path","required":true,"schema":{"type":"string","title":"Connector Type"}},{"name":"path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path"}},{"name":"page_token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Token"}},{"name":"q_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q Filter"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Page Size"}},{"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/FileListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ee/connectors/{connector_type}/ingest":{"post":{"tags":["EE - Connectors"],"summary":"Ingest File","description":"Ingest a single file from a connector.","operationId":"ingest_file_ee_connectors__connector_type__ingest_post","parameters":[{"name":"connector_type","in":"path","required":true,"schema":{"type":"string","title":"Connector Type"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorIngestRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ee/connectors/{connector_type}/ingest-repository":{"post":{"tags":["EE - Connectors"],"summary":"Ingest Repository","description":"Ingest an entire GitHub repository.","operationId":"ingest_repository_ee_connectors__connector_type__ingest_repository_post","parameters":[{"name":"connector_type","in":"path","required":true,"schema":{"type":"string","title":"Connector Type"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitHubRepositoryIngestRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ee/connectors/status":{"post":{"tags":["EE - Connectors"],"summary":"Get Status","description":"Get the authentication status for a connector.","operationId":"get_status_ee_connectors_status_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorAuthRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ee/connectors/initiate-auth":{"post":{"tags":["EE - Connectors"],"summary":"Initiate Auth","description":"Initiate the OAuth flow for a connector.","operationId":"initiate_auth_ee_connectors_initiate_auth_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorAuthRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ee/connectors/finalize-auth":{"post":{"tags":["EE - Connectors"],"summary":"Finalize Auth","description":"Finalize the OAuth flow and exchange the code for a token.","operationId":"finalize_auth_ee_connectors_finalize_auth_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorAuthResponse"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ee/connectors/disconnect":{"post":{"tags":["EE - Connectors"],"summary":"Disconnect","description":"Disconnect from a connector and remove credentials.","operationId":"disconnect_ee_connectors_disconnect_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorAuthRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ee/connectors/list-files":{"post":{"tags":["EE - Connectors"],"summary":"List Files","description":"List files from a connector.","operationId":"list_files_ee_connectors_list_files_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorListFilesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/retrieve/chunks":{"post":{"summary":"Retrieve Chunks","description":"Retrieve relevant chunks.\n\nThe optional `request.filters` payload accepts equality checks (which also match scalars inside JSON arrays)\nplus the logical operators `$and`, `$or`, `$nor`, and `$not`. Field-level predicates include `$eq`, `$ne`,\n`$in`, `$nin`, `$exists`, `$type`, `$regex`, `$contains`, and the comparison operators `$gt`, `$gte`, `$lt`,\nand `$lte`. Comparison clauses evaluate typed metadata (`number`, `decimal`, `datetime`, or `date`) and\nraise detailed validation errors when operands cannot be coerced. Regex filters allow the optional `i` flag\nfor case-insensitive matching, while `$contains` performs substring checks (case-insensitive by default,\nconfigurable via `case_sensitive`). Filters can be nested freely, for example:\n\n```json\n{\n  \"$and\": [\n    {\"category\": \"policy\"},\n    {\"$or\": [{\"region\": \"emea\"}, {\"priority\": {\"$in\": [\"p0\", \"p1\"]}}]}\n  ]\n}\n```\nReturns a list of `ChunkResult` objects ordered by relevance.","operationId":"retrieve_chunks_retrieve_chunks_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChunkResult"},"title":"Response Retrieve Chunks Retrieve Chunks Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/retrieve/chunks/grouped":{"post":{"summary":"Retrieve Chunks Grouped","description":"Retrieve relevant chunks with grouped response format.\n\nUses the same filter operators as `/retrieve/chunks` (equality, `$eq/$ne`, `$gt/$gte/$lt/$lte`, `$in/$nin`,\n`$exists`, `$type`, `$regex`, `$contains`, and the logical `$and/$or/$nor/$not`), with arbitrary nesting\nsupported inside `request.filters`.\n\nReturns both flat results (for backward compatibility) and grouped results (for UI).\nWhen padding > 0, groups chunks by main matches and their padding chunks.","operationId":"retrieve_chunks_grouped_retrieve_chunks_grouped_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupedChunkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/retrieve/docs":{"post":{"summary":"Retrieve Documents","description":"Retrieve relevant documents.\n\n`request.filters` supports equality checks (including scalar-to-array matches) and the same operator set as\n`/retrieve/chunks`: logical composition via `$and`, `$or`, `$nor`, `$not`, plus field predicates `$eq`, `$ne`,\n`$gt`, `$gte`, `$lt`, `$lte`, `$in`, `$nin`, `$exists`, `$type`, `$regex`, and `$contains`. Use the same JSON\nstructure as `/retrieve/chunks` when expressing complex logic. Comparison operators require metadata typed as\n`number`, `decimal`, `datetime`, or `date`.","operationId":"retrieve_documents_retrieve_docs_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentResult"},"title":"Response Retrieve Documents Retrieve Docs Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/search/documents":{"post":{"summary":"Search Documents By Name","description":"Search documents by filename using full-text search.\n\n`request.filters` accepts the same operator set as `/retrieve/chunks`: `$eq`, `$ne`, `$gt`, `$gte`, `$lt`,\n`$lte`, `$in`, `$nin`, `$exists`, `$type`, `$regex` (with optional `i` flag), `$contains`, and the logical\noperators `$and`, `$or`, `$nor`, `$not`. Comparison clauses honor typed metadata (`number`, `decimal`,\n`datetime`, `date`).","operationId":"search_documents_by_name_search_documents_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchDocumentsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"},"title":"Response Search Documents By Name Search Documents Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/batch/documents":{"post":{"summary":"Batch Get Documents","description":"Retrieve multiple documents by their IDs in a single batch operation.","operationId":"batch_get_documents_batch_documents_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchDocumentsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"},"title":"Response Batch Get Documents Batch Documents Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/batch/chunks":{"post":{"summary":"Batch Get Chunks","description":"Retrieve specific chunks by their document ID and chunk number in a single batch operation.","operationId":"batch_get_chunks_batch_chunks_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchChunksRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChunkResult"},"title":"Response Batch Get Chunks Batch Chunks Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/query":{"post":{"summary":"Query Completion","description":"Generate completion using relevant chunks as context.","operationId":"query_completion_query_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompletionQueryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompletionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/{chat_id}":{"get":{"summary":"Get Chat History","description":"Retrieve the message history for a chat conversation.","operationId":"get_chat_history_chat__chat_id__get","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}},{"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/ChatMessage"},"title":"Response Get Chat History Chat  Chat Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/available":{"get":{"summary":"Get Available Models For Selection","description":"Get list of available models for UI selection.\n\nReturns a list of models that can be used for queries. Each model includes:\n- id: Model identifier to use in llm_config\n- name: Display name for the model\n- provider: The LLM provider (e.g., openai, anthropic, ollama)\n- description: Optional description of the model","operationId":"get_available_models_for_selection_models_available_get","parameters":[{"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"}}}}}}},"/cloud/generate_uri":{"post":{"summary":"Generate Cloud Uri","description":"Generate an authenticated URI for a cloud-hosted Morphik application.","operationId":"generate_cloud_uri_cloud_generate_uri_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"X-Morphik-Admin-Secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Morphik-Admin-Secret"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateUriRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Generate Cloud Uri Cloud Generate Uri Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/apps":{"get":{"summary":"List Cloud Apps","description":"List provisioned apps for the specified organization/user.","operationId":"list_cloud_apps_apps_get","parameters":[{"name":"org_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter apps by organization ID","title":"Org Id"},"description":"Filter apps by organization ID"},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter apps by creator","title":"User Id"},"description":"Filter apps by creator"},{"name":"app_id_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"JSON filter expression for app IDs (supports $and/$or/$not/$nor and $eq/$ne/$gt/$gte/$lt/$lte/$in/$nin/$exists/$regex/$contains).","title":"App Id Filter"},"description":"JSON filter expression for app IDs (supports $and/$or/$not/$nor and $eq/$ne/$gt/$gte/$lt/$lte/$in/$nin/$exists/$regex/$contains)."},{"name":"app_name_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"JSON filter expression for app name (supports $and/$or/$not/$nor and $eq/$ne/$gt/$gte/$lt/$lte/$in/$nin/$exists/$regex/$contains).","title":"App Name Filter"},"description":"JSON filter expression for app name (supports $and/$or/$not/$nor and $eq/$ne/$gt/$gte/$lt/$lte/$in/$nin/$exists/$regex/$contains)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"X-Morphik-Admin-Secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Morphik-Admin-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Cloud App","description":"Delete all resources associated with a given cloud application.","operationId":"delete_cloud_app_apps_delete","parameters":[{"name":"app_name","in":"query","required":true,"schema":{"type":"string","description":"Name of the application to delete","title":"App Name"},"description":"Name of the application to delete"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"X-Morphik-Admin-Secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Morphik-Admin-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Cloud App Apps Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/apps/rotate_token":{"post":{"summary":"Rotate App Token","description":"Rotate the token for an existing application.","operationId":"rotate_app_token_apps_rotate_token_post","parameters":[{"name":"app_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Application ID to rotate","title":"App Id"},"description":"Application ID to rotate"},{"name":"app_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Application name to rotate","title":"App Name"},"description":"Application name to rotate"},{"name":"expiry_days","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Number of days until the new token expires","default":5475,"title":"Expiry Days"},"description":"Number of days until the new token expires"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"X-Morphik-Admin-Secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Morphik-Admin-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rotate App Token Apps Rotate Token Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/apps/rename":{"patch":{"summary":"Rename Cloud App","description":"Rename an existing cloud application.","operationId":"rename_cloud_app_apps_rename_patch","parameters":[{"name":"app_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Application ID to rename","title":"App Id"},"description":"Application ID to rename"},{"name":"app_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Current application name to rename","title":"App Name"},"description":"Current application name to rename"},{"name":"new_name","in":"query","required":true,"schema":{"type":"string","description":"New application name","title":"New Name"},"description":"New application name"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"X-Morphik-Admin-Secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Morphik-Admin-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rename Cloud App Apps Rename Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chats":{"get":{"summary":"List Chat Conversations","description":"List chat conversations available to the current user.","operationId":"list_chat_conversations_chats_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"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":{"type":"object","additionalProperties":true},"title":"Response List Chat Conversations Chats Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chats/{chat_id}/title":{"patch":{"summary":"Update Chat Title","description":"Update the title of a chat conversation.","operationId":"update_chat_title_chats__chat_id__title_patch","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}},{"name":"title","in":"query","required":true,"schema":{"type":"string","description":"New title for the chat","title":"Title"},"description":"New title for the chat"},{"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/ChatTitleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AppStorageUsageResponse":{"properties":{"app_id":{"type":"string","title":"App Id"},"doc_raw_bytes_mb":{"type":"number","title":"Doc Raw Bytes Mb"},"chunk_raw_bytes_mb":{"type":"number","title":"Chunk Raw Bytes Mb"},"multivector_mb":{"type":"number","title":"Multivector Mb"},"total_mb":{"type":"number","title":"Total Mb"},"document_count":{"type":"integer","title":"Document Count"}},"type":"object","required":["app_id","doc_raw_bytes_mb","chunk_raw_bytes_mb","multivector_mb","total_mb","document_count"],"title":"AppStorageUsageResponse"},"BaseModel":{"properties":{},"type":"object","title":"BaseModel"},"BatchChunksRequest":{"properties":{"sources":{"items":{"$ref":"#/components/schemas/ChunkSource"},"type":"array","title":"Sources","description":"List of chunk sources to retrieve"},"folder_name":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Folder Name","description":"Optional folder scope. Accepts a folder PATH (e.g., '/Company/Reports') or list of paths."},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id","description":"Optional end-user scope for the operation"},"use_colpali":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Colpali","description":"Whether to use ColPali embeddings for retrieval"},"output_format":{"anyOf":[{"$ref":"#/components/schemas/OutputFormat"},{"type":"null"}],"description":"How to return image chunks: base64 (default), url, or text (markdown format)"}},"type":"object","title":"BatchChunksRequest","description":"Request model for batch chunk retrieval."},"BatchDocumentsRequest":{"properties":{"document_ids":{"items":{"type":"string"},"type":"array","title":"Document Ids","description":"List of document IDs to retrieve"},"folder_name":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Folder Name","description":"Optional folder scope. Accepts a folder PATH (e.g., '/Company/Reports') or list of paths."},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id","description":"Optional end-user scope for the operation"}},"type":"object","title":"BatchDocumentsRequest","description":"Request model for batch document retrieval."},"BatchIngestResponse":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/Document"},"type":"array","title":"Documents"},"errors":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Errors"}},"type":"object","required":["documents","errors"],"title":"BatchIngestResponse","description":"Response model for batch ingestion"},"Body_batch_ingest_files_ingest_files_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"},"metadata":{"type":"string","title":"Metadata","default":"{}"},"metadata_types":{"type":"string","title":"Metadata Types","default":"{}"},"use_colpali":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Colpali"},"folder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Name"},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id"}},"type":"object","required":["files"],"title":"Body_batch_ingest_files_ingest_files_post"},"Body_ingest_document_v2_v2_documents_post":{"properties":{"file":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"File"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"metadata":{"type":"string","title":"Metadata","default":"{}"},"metadata_types":{"type":"string","title":"Metadata Types","default":"{}"},"folder_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Path"},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id"}},"type":"object","title":"Body_ingest_document_v2_v2_documents_post"},"Body_ingest_file_ingest_file_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"metadata":{"type":"string","title":"Metadata","default":"{}"},"metadata_types":{"type":"string","title":"Metadata Types","default":"{}"},"use_colpali":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Colpali"},"folder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Name"},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id"}},"type":"object","required":["file"],"title":"Body_ingest_file_ingest_file_post"},"Body_migrate_document_migrate_document_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"source_document_id":{"type":"string","title":"Source Document Id"},"metadata":{"type":"string","title":"Metadata","default":"{}"},"metadata_types":{"type":"string","title":"Metadata Types","default":"{}"},"use_colpali":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Colpali"},"folder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Name"},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id"},"on_conflict":{"type":"string","enum":["skip","fail"],"title":"On Conflict","default":"skip"}},"type":"object","required":["file","source_document_id"],"title":"Body_migrate_document_migrate_document_post"},"Body_query_document_ingest_document_query_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"prompt":{"type":"string","title":"Prompt"},"response_schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Schema"},"ingestion_options":{"type":"string","title":"Ingestion Options","default":"{}"}},"type":"object","required":["file","prompt"],"title":"Body_query_document_ingest_document_query_post"},"Body_update_document_file_documents__document_id__update_file_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"metadata":{"type":"string","title":"Metadata","default":"{}"},"metadata_types":{"type":"string","title":"Metadata Types","default":"{}"},"use_colpali":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Colpali"}},"type":"object","required":["file"],"title":"Body_update_document_file_documents__document_id__update_file_post"},"ChatMessage":{"properties":{"role":{"type":"string","enum":["user","assistant"],"title":"Role"},"content":{"type":"string","title":"Content"},"timestamp":{"type":"string","title":"Timestamp"}},"type":"object","required":["role","content"],"title":"ChatMessage","description":"Simple chat message model for chat persistence."},"ChatTitleResponse":{"properties":{"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"},"title":{"type":"string","title":"Title"}},"type":"object","required":["status","message","title"],"title":"ChatTitleResponse","description":"Response for chat title update endpoint"},"ChunkGroup":{"properties":{"main_chunk":{"$ref":"#/components/schemas/ChunkResult"},"padding_chunks":{"items":{"$ref":"#/components/schemas/ChunkResult"},"type":"array","title":"Padding Chunks"},"total_chunks":{"type":"integer","title":"Total Chunks","description":"Total number of chunks in this group"}},"type":"object","required":["main_chunk","total_chunks"],"title":"ChunkGroup","description":"Represents a group of chunks: one main match + its padding chunks"},"ChunkResult":{"properties":{"content":{"type":"string","title":"Content"},"score":{"type":"number","title":"Score"},"document_id":{"type":"string","title":"Document Id"},"chunk_number":{"type":"integer","title":"Chunk Number"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"content_type":{"type":"string","title":"Content Type"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"download_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Url"},"is_padding":{"type":"boolean","title":"Is Padding","description":"Whether this chunk was added as padding","default":false}},"type":"object","required":["content","score","document_id","chunk_number","metadata","content_type"],"title":"ChunkResult","description":"Query result at chunk level"},"ChunkSource":{"properties":{"document_id":{"type":"string","title":"Document Id"},"chunk_number":{"type":"integer","title":"Chunk Number"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"}},"type":"object","required":["document_id","chunk_number"],"title":"ChunkSource","description":"Source information for a chunk used in completion"},"CompletionQueryRequest":{"properties":{"query":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Query","description":"Natural-language query used to retrieve relevant chunks or documents."},"query_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query Image","description":"Base64-encoded image to use as query for Morphik multimodal retrieval. Requires use_colpali=True. Mutually exclusive with 'query'."},"filters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filters","description":"Metadata filters supporting logical operators ($and/$or/$not/$nor) and field predicates ($eq/$ne/$gt/$gte/$lt/$lte/$in/$nin/$exists/$type/$regex/$contains)."},"k":{"type":"integer","exclusiveMinimum":0.0,"title":"K","description":"Maximum number of chunks or documents to return.","default":4},"min_score":{"type":"number","title":"Min Score","description":"Minimum similarity score a result must meet before it is returned.","default":0.0},"use_reranking":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Reranking","description":"When provided, overrides the workspace reranking configuration for this request."},"use_colpali":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Colpali","description":"When provided, uses Morphik's finetuned ColPali style embeddings (recommended to be True for high quality retrieval)."},"output_format":{"anyOf":[{"$ref":"#/components/schemas/OutputFormat"},{"type":"null"}],"description":"How to return image chunks: base64 (default), url, or text (markdown format)","default":"base64"},"padding":{"type":"integer","minimum":0.0,"title":"Padding","description":"Number of additional chunks/pages to retrieve before and after matched chunks (ColPali only)","default":0},"folder_name":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Folder Name","description":"Optional folder scope. Accepts a folder PATH (e.g., '/Company/Reports') or list of paths."},"folder_depth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Folder Depth","description":"Folder scope depth. 0 or None = exact folder only, -1 = include all descendants, n > 0 = include descendants up to n levels deeper."},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id","description":"Optional end-user scope for the operation"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens","description":"Maximum number of tokens allowed in the generated completion."},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","description":"Sampling temperature passed to the completion model (None uses provider default)."},"prompt_overrides":{"anyOf":[{"$ref":"#/components/schemas/QueryPromptOverrides"},{"type":"null"}],"description":"Optional customizations for entity extraction, resolution, and query prompts"},"schema":{"anyOf":[{},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Schema","description":"Schema for structured output, can be a Pydantic model or JSON schema dict"},"chat_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Id","description":"Optional chat session ID for persisting conversation history"},"stream_response":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stream Response","description":"Whether to stream the response back in chunks","default":false},"llm_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Llm Config","description":"LiteLLM-compatible model configuration (e.g., model name, API key, base URL)"},"inline_citations":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Inline Citations","description":"Whether to include inline citations with filename and page number in the response","default":false}},"type":"object","title":"CompletionQueryRequest","description":"Request model for completion generation"},"CompletionResponse":{"properties":{"completion":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/StructuredCompletion"}],"title":"Completion"},"usage":{"additionalProperties":{"type":"integer"},"type":"object","title":"Usage"},"finish_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finish Reason"},"sources":{"items":{"$ref":"#/components/schemas/ChunkSource"},"type":"array","title":"Sources","default":[]},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["completion","usage"],"title":"CompletionResponse","description":"Response from completion generation"},"ConnectorAuthRequest":{"properties":{"connector_type":{"type":"string","title":"Connector Type"}},"type":"object","required":["connector_type"],"title":"ConnectorAuthRequest"},"ConnectorAuthResponse":{"properties":{"connector_type":{"type":"string","title":"Connector Type"},"auth_response_data":{"additionalProperties":true,"type":"object","title":"Auth Response Data"}},"type":"object","required":["connector_type","auth_response_data"],"title":"ConnectorAuthResponse"},"ConnectorAuthStatus":{"properties":{"is_authenticated":{"type":"boolean","title":"Is Authenticated"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"auth_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Url"}},"type":"object","required":["is_authenticated"],"title":"ConnectorAuthStatus"},"ConnectorFile":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"is_folder":{"type":"boolean","title":"Is Folder","default":false},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size"},"modified_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Modified Date"}},"type":"object","required":["id","name"],"title":"ConnectorFile"},"ConnectorIngestRequest":{"properties":{"file_id":{"type":"string","title":"File Id","description":"Identifier of the connector file being ingested."},"folder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Name","description":"Optional Morphik folder name applied to the ingested document."},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Metadata attached to the document when ingesting from the connector."}},"additionalProperties":true,"type":"object","required":["file_id"],"title":"ConnectorIngestRequest"},"ConnectorListFilesRequest":{"properties":{"connector_type":{"type":"string","title":"Connector Type"},"path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path"},"page_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Token"}},"type":"object","required":["connector_type"],"title":"ConnectorListFilesRequest"},"CredentialField":{"properties":{"name":{"type":"string","title":"Name"},"label":{"type":"string","title":"Label"},"description":{"type":"string","title":"Description"},"type":{"type":"string","title":"Type"},"required":{"type":"boolean","title":"Required"},"options":{"anyOf":[{"items":{"$ref":"#/components/schemas/CredentialFieldOption"},"type":"array"},{"type":"null"}],"title":"Options"}},"type":"object","required":["name","label","description","type","required"],"title":"CredentialField"},"CredentialFieldOption":{"properties":{"value":{"type":"string","title":"Value"},"label":{"type":"string","title":"Label"}},"type":"object","required":["value","label"],"title":"CredentialFieldOption"},"DetailedHealthCheckResponse":{"properties":{"status":{"type":"string","title":"Status"},"services":{"items":{"$ref":"#/components/schemas/ServiceStatus"},"type":"array","title":"Services"},"timestamp":{"type":"string","title":"Timestamp"}},"type":"object","required":["status","services","timestamp"],"title":"DetailedHealthCheckResponse","description":"Response for detailed health check endpoint"},"Document":{"properties":{"external_id":{"type":"string","title":"External Id"},"content_type":{"type":"string","title":"Content Type"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"metadata_types":{"additionalProperties":{"type":"string"},"type":"object","title":"Metadata Types"},"storage_info":{"additionalProperties":true,"type":"object","title":"Storage Info"},"system_metadata":{"additionalProperties":true,"type":"object","title":"System Metadata"},"additional_metadata":{"additionalProperties":true,"type":"object","title":"Additional Metadata"},"chunk_ids":{"items":{"type":"string"},"type":"array","title":"Chunk Ids"},"summary_storage_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Storage Key"},"summary_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Summary Version"},"summary_bucket":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Bucket"},"summary_updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Updated At"},"folder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Name"},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id"},"app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Id"},"folder_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Path"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Id"}},"type":"object","required":["content_type"],"title":"Document","description":"Represents a document stored in the database documents collection"},"DocumentAddToFolderResponse":{"properties":{"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["status","message"],"title":"DocumentAddToFolderResponse","description":"Response for adding document to folder endpoint"},"DocumentContent":{"properties":{"type":{"type":"string","enum":["url","string"],"title":"Type"},"value":{"type":"string","title":"Value"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Filename when type is url"}},"type":"object","required":["type","value"],"title":"DocumentContent","description":"Represents either a URL or content string"},"DocumentDeleteResponse":{"properties":{"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["status","message"],"title":"DocumentDeleteResponse","description":"Response for document deletion endpoint"},"DocumentDownloadUrlResponse":{"properties":{"download_url":{"type":"string","title":"Download Url"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["download_url","expires_in"],"title":"DocumentDownloadUrlResponse","description":"Response for document download URL endpoint"},"DocumentPagesRequest":{"properties":{"document_id":{"type":"string","title":"Document Id","description":"ID of the document to extract pages from"},"start_page":{"type":"integer","minimum":1.0,"title":"Start Page","description":"Starting page number (1-indexed)"},"end_page":{"type":"integer","minimum":1.0,"title":"End Page","description":"Ending page number (1-indexed)"},"output_format":{"anyOf":[{"type":"string","enum":["base64","url"]},{"type":"null"}],"title":"Output Format","description":"How to return page images: base64 (default) or url","default":"base64"}},"type":"object","required":["document_id","start_page","end_page"],"title":"DocumentPagesRequest","description":"Request model for extracting pages from a document"},"DocumentPagesResponse":{"properties":{"document_id":{"type":"string","title":"Document Id"},"pages":{"items":{"type":"string"},"type":"array","title":"Pages"},"start_page":{"type":"integer","title":"Start Page"},"end_page":{"type":"integer","title":"End Page"},"total_pages":{"type":"integer","title":"Total Pages"}},"type":"object","required":["document_id","pages","start_page","end_page","total_pages"],"title":"DocumentPagesResponse","description":"Response for document pages extraction endpoint"},"DocumentQueryResponse":{"properties":{"structured_output":{"anyOf":[{},{"type":"null"}],"title":"Structured Output","description":"Raw structured output returned from Morphik On-the-Fly (may be list/dict)"},"extracted_metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extracted Metadata","description":"Structured output coerced to metadata when possible"},"text_output":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Output","description":"Raw text returned from Morphik On-the-Fly when no schema is provided"},"ingestion_enqueued":{"type":"boolean","title":"Ingestion Enqueued","description":"True when the document was queued for ingestion after extraction","default":false},"ingestion_document":{"anyOf":[{"$ref":"#/components/schemas/Document"},{"type":"null"}],"description":"Queued document stub when ingestion_enqueued is true"},"input_metadata":{"additionalProperties":true,"type":"object","title":"Input Metadata","description":"Original metadata supplied alongside the request"},"combined_metadata":{"additionalProperties":true,"type":"object","title":"Combined Metadata","description":"Metadata that would be used if ingestion is performed"},"ingestion_options":{"$ref":"#/components/schemas/IngestionOptions","description":"Normalized ingestion options applied to this request"}},"type":"object","title":"DocumentQueryResponse","description":"Response model for document query with optional ingestion follow-up."},"DocumentResult":{"properties":{"score":{"type":"number","title":"Score"},"document_id":{"type":"string","title":"Document Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"content":{"$ref":"#/components/schemas/DocumentContent"},"additional_metadata":{"additionalProperties":true,"type":"object","title":"Additional Metadata"}},"type":"object","required":["score","document_id","metadata","content","additional_metadata"],"title":"DocumentResult","description":"Query result at document level"},"EntityExtractionExample":{"properties":{"label":{"type":"string","title":"Label","description":"The entity label (e.g., 'John Doe', 'Apple Inc.')"},"type":{"type":"string","title":"Type","description":"The entity type (e.g., 'PERSON', 'ORGANIZATION', 'PRODUCT')"},"properties":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Properties","description":"Optional properties of the entity (e.g., {'role': 'CEO', 'age': 42})"}},"type":"object","required":["label","type"],"title":"EntityExtractionExample","description":"Example entity for guiding entity extraction.\n\nUsed to provide domain-specific examples to the LLM of what entities to extract.\nThese examples help steer the extraction process toward entities relevant to your domain."},"EntityExtractionPromptOverride":{"properties":{"prompt_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Template","description":"Custom prompt template, MUST include both {content} and {examples} placeholders. The {content} placeholder will be replaced with the text to analyze, and {examples} will be replaced with formatted examples."},"examples":{"anyOf":[{"items":{"$ref":"#/components/schemas/EntityExtractionExample"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Examples of entities to extract, used to guide the LLM toward domain-specific entity types and patterns."}},"type":"object","title":"EntityExtractionPromptOverride","description":"Configuration for customizing entity extraction prompts.\n\nThis allows you to override both the prompt template used for entity extraction\nand provide domain-specific examples of entities to be extracted.\n\nIf only examples are provided (without a prompt_template), they will be\nincorporated into the default prompt. If only prompt_template is provided,\nit will be used with default examples (if any).\n\nRequired placeholders:\n- {content}: Will be replaced with the text to analyze for entity extraction\n- {examples}: Will be replaced with formatted examples of entities to extract\n\nExample prompt template:\n```\nExtract entities from the following text. Look for entities similar to these examples:\n\n{examples}\n\nText to analyze:\n{content}\n\nExtracted entities (in JSON format):\n```"},"EntityResolutionExample":{"properties":{"canonical":{"type":"string","title":"Canonical","description":"The canonical (standard/preferred) form of the entity"},"variants":{"items":{"type":"string"},"type":"array","title":"Variants","description":"List of variant forms that should resolve to the canonical form"}},"type":"object","required":["canonical","variants"],"title":"EntityResolutionExample","description":"Example for entity resolution, showing how variants should be grouped.\n\nEntity resolution is the process of identifying when different references\n(variants) in text refer to the same real-world entity. These examples\nhelp the LLM understand domain-specific patterns for resolving entities."},"EntityResolutionPromptOverride":{"properties":{"prompt_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Template","description":"Custom prompt template that MUST include both {entities_str} and {examples_json} placeholders. The {entities_str} placeholder will be replaced with the extracted entities, and {examples_json} will be replaced with JSON-formatted examples of entity resolution groups."},"examples":{"anyOf":[{"items":{"$ref":"#/components/schemas/EntityResolutionExample"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Examples of entity resolution groups showing how variants of the same entity should be resolved to their canonical forms. This is particularly useful for domain-specific terminology, abbreviations, and naming conventions."}},"type":"object","title":"EntityResolutionPromptOverride","description":"Configuration for customizing entity resolution prompts.\n\nEntity resolution identifies and groups variant forms of the same entity.\nThis override allows you to customize how this process works by providing\na custom prompt template and/or domain-specific examples.\n\nIf only examples are provided (without a prompt_template), they will be\nincorporated into the default prompt. If only prompt_template is provided,\nit will be used with default examples (if any).\n\nRequired placeholders:\n- {entities_str}: Will be replaced with the extracted entities\n- {examples_json}: Will be replaced with JSON-formatted examples of entity resolution groups\n\nExample prompt template:\n```\nI have extracted the following entities:\n\n{entities_str}\n\nBelow are examples of how different entity references can be grouped together:\n\n{examples_json}\n\nGroup the above entities by resolving which mentions refer to the same entity.\nReturn the results in JSON format.\n```"},"FileListResponse":{"properties":{"files":{"items":{"$ref":"#/components/schemas/ConnectorFile"},"type":"array","title":"Files"},"next_page_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Page Token"}},"type":"object","required":["files"],"title":"FileListResponse"},"Folder":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"full_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Path"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"depth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Depth"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"document_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Document Ids"},"system_metadata":{"additionalProperties":true,"type":"object","title":"System Metadata"},"summary_storage_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Storage Key"},"summary_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Summary Version"},"summary_bucket":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Bucket"},"summary_updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Updated At"},"app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Id"},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id"},"child_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Child Count"}},"type":"object","required":["name"],"title":"Folder","description":"Represents a folder that contains documents"},"FolderCount":{"properties":{"folder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["folder","count"],"title":"FolderCount","description":"Count of documents grouped by folder name."},"FolderCreate":{"properties":{"name":{"type":"string","title":"Name"},"full_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Path"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["name"],"title":"FolderCreate","description":"Request model for folder creation"},"FolderDeleteResponse":{"properties":{"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["status","message"],"title":"FolderDeleteResponse","description":"Response for folder deletion endpoint"},"FolderDetails":{"properties":{"folder":{"$ref":"#/components/schemas/Folder"},"document_info":{"anyOf":[{"$ref":"#/components/schemas/FolderDocumentInfo"},{"type":"null"}]}},"type":"object","required":["folder"],"title":"FolderDetails","description":"Folder details with optional document summary."},"FolderDetailsRequest":{"properties":{"identifiers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Identifiers","description":"List of folder IDs or names. If omitted, returns details for all accessible folders."},"include_document_count":{"type":"boolean","title":"Include Document Count","description":"Include total document count when true","default":true},"include_status_counts":{"type":"boolean","title":"Include Status Counts","description":"Include document counts grouped by status when true","default":false},"include_documents":{"type":"boolean","title":"Include Documents","description":"Include a paginated list of documents for each folder when true","default":false},"document_filters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Document Filters","description":"Optional metadata filters applied when computing folder document statistics"},"document_skip":{"type":"integer","minimum":0.0,"title":"Document Skip","description":"Number of documents to skip within each folder when include_documents is true","default":0},"document_limit":{"type":"integer","minimum":0.0,"title":"Document Limit","description":"Maximum number of documents to return per folder when include_documents is true","default":25},"document_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Document Fields","description":"Optional list of fields to project for folder documents (dot notation supported)"},"sort_by":{"anyOf":[{"type":"string","enum":["created_at","updated_at","filename","external_id"]},{"type":"null"}],"title":"Sort By","description":"Field to sort folder documents by when include_documents is true","default":"updated_at"},"sort_direction":{"type":"string","enum":["asc","desc"],"title":"Sort Direction","description":"Sort direction for folder documents when include_documents is true","default":"desc"}},"type":"object","title":"FolderDetailsRequest","description":"Request model for retrieving folder details with document statistics."},"FolderDetailsResponse":{"properties":{"folders":{"items":{"$ref":"#/components/schemas/FolderDetails"},"type":"array","title":"Folders"}},"type":"object","required":["folders"],"title":"FolderDetailsResponse","description":"Response wrapping folder detail entries."},"FolderDocumentInfo":{"properties":{"documents":{"items":{},"type":"array","title":"Documents"},"document_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Document Count"},"status_counts":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"Status Counts"},"skip":{"type":"integer","title":"Skip","default":0},"limit":{"type":"integer","title":"Limit","default":0},"returned_count":{"type":"integer","title":"Returned Count","default":0},"has_more":{"type":"boolean","title":"Has More","default":false},"next_skip":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Skip"}},"type":"object","title":"FolderDocumentInfo","description":"Document summary for a folder."},"FolderMove":{"properties":{"new_path":{"type":"string","title":"New Path","description":"The new full path for the folder (e.g. '/NewParent/NewName')"}},"type":"object","required":["new_path"],"title":"FolderMove","description":"Request model for moving/renaming a folder via a new path."},"FolderSummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"full_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Path"},"depth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Depth"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"doc_count":{"type":"integer","title":"Doc Count","default":0},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","name"],"title":"FolderSummary"},"GenerateUriRequest":{"properties":{"app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Id","description":"Optional client-generated app ID (UUID recommended). If omitted, the server generates one."},"name":{"type":"string","title":"Name","description":"Name of the application"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"Optional owner user ID. If omitted, derived from the bearer token."},"expiry_days":{"type":"integer","title":"Expiry Days","description":"Number of days until the token expires (default: 15 years)","default":5475},"org_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Id","description":"Optional organization identifier for multi-tenant control planes"},"created_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By User Id","description":"ID of the admin or service user that initiated the request"}},"type":"object","required":["name"],"title":"GenerateUriRequest","description":"Request model for generating a cloud URI"},"GitHubRepositoryIngestRequest":{"properties":{"connector_type":{"type":"string","title":"Connector Type","default":"github","x-stainless-param":"body_connector_type"},"repo_path":{"type":"string","title":"Repo Path","description":"Repository path in the format \"owner/repo\"."},"folder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Name","description":"Optional Morphik folder for the ingested repository documents."},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Metadata applied to each document created from the repository."},"include_patterns":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Include Patterns","description":"Optional glob patterns restricting which files are ingested."},"ignore_patterns":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Ignore Patterns","description":"Optional glob patterns for files that should be skipped."},"compress":{"type":"boolean","title":"Compress","description":"When true, package repository files before uploading to Morphik.","default":true},"force":{"type":"boolean","title":"Force","description":"Re-ingest the repository even if it was previously processed.","default":false}},"type":"object","required":["repo_path"],"title":"GitHubRepositoryIngestRequest"},"GroupedChunkResponse":{"properties":{"chunks":{"items":{"$ref":"#/components/schemas/ChunkResult"},"type":"array","title":"Chunks","description":"Flat list of all chunks (for backward compatibility)"},"groups":{"items":{"$ref":"#/components/schemas/ChunkGroup"},"type":"array","title":"Groups","description":"Grouped chunks for UI display"},"total_results":{"type":"integer","title":"Total Results","description":"Total number of unique chunks"},"has_padding":{"type":"boolean","title":"Has Padding","description":"Whether padding was applied to any results"}},"type":"object","required":["chunks","groups","total_results","has_padding"],"title":"GroupedChunkResponse","description":"Response that includes both flat results and grouped results for UI"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthCheckResponse":{"properties":{"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["status","message"],"title":"HealthCheckResponse","description":"Response for health check endpoint"},"IngestTextRequest":{"properties":{"content":{"type":"string","minLength":1,"title":"Content","description":"Raw text content to store as a document."},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Optional filename hint used when inferring MIME type or displaying the document."},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"User-defined metadata stored with the document (JSON-serializable)."},"metadata_types":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata Types","description":"Optional per-field type hints: 'string', 'number', 'decimal', 'datetime', 'date', 'boolean', 'array', 'object'. Enables typed comparisons with $eq, $gt, etc. Types are inferred if omitted."},"use_colpali":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Colpali","description":"When provided, uses Morphik's finetuned ColPali style embeddings (recommended to be True for high quality retrieval)."},"folder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Name","description":"Optional folder scope for the operation"},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id","description":"Optional end-user scope for the operation"}},"additionalProperties":true,"type":"object","required":["content"],"title":"IngestTextRequest","description":"Request model for ingesting text content"},"IngestionOptions":{"properties":{"ingest":{"type":"boolean","title":"Ingest","description":"Whether to enqueue ingestion after metadata extraction.","default":false},"use_colpali":{"type":"boolean","title":"Use Colpali","description":"Whether to use Morphik's ColPali-style embeddings during ingestion (recommended for quality).","default":false},"folder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Name","description":"Optional target folder path for the ingested document. Only a single folder is supported."},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id","description":"Optional end-user scope for the operation."},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Metadata to merge into the ingested document when ingestion is triggered."}},"additionalProperties":false,"type":"object","title":"IngestionOptions","description":"Normalized options controlling post-analysis ingestion."},"ListDocsRequest":{"properties":{"document_filters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Document Filters","description":"Metadata filters with operator support: $and, $or, $nor, $not, $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, $type, $regex, $contains. Implicit equality uses JSONB containment; explicit operators support typed comparisons. Reserved key: 'filename' filters the filename column."},"skip":{"type":"integer","minimum":0.0,"title":"Skip","description":"Number of documents to skip","default":0},"limit":{"type":"integer","minimum":0.0,"title":"Limit","description":"Maximum number of documents to return","default":100},"return_documents":{"type":"boolean","title":"Return Documents","description":"When false, only aggregates are returned","default":true},"include_total_count":{"type":"boolean","title":"Include Total Count","description":"Include total number of matching documents when true","default":false},"include_status_counts":{"type":"boolean","title":"Include Status Counts","description":"Include document counts grouped by processing status when true","default":false},"include_folder_counts":{"type":"boolean","title":"Include Folder Counts","description":"Include document counts grouped by folder when true","default":false},"completed_only":{"type":"boolean","title":"Completed Only","description":"When true, only documents with completed processing status are returned and counted","default":false},"sort_by":{"anyOf":[{"type":"string","enum":["created_at","updated_at","filename","external_id"]},{"type":"null"}],"title":"Sort By","description":"Field to sort the results by","default":"updated_at"},"sort_direction":{"type":"string","enum":["asc","desc"],"title":"Sort Direction","description":"Sort direction for the results","default":"desc"},"fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Fields","description":"Optional list of fields to project for each document (dot notation supported). Derived fields such as 'page_count' are also supported."}},"type":"object","title":"ListDocsRequest","description":"Flexible request model for listing documents with projection and aggregates."},"ListDocsResponse":{"properties":{"documents":{"items":{},"type":"array","title":"Documents"},"skip":{"type":"integer","title":"Skip"},"limit":{"type":"integer","title":"Limit"},"returned_count":{"type":"integer","title":"Returned Count"},"total_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Count"},"has_more":{"type":"boolean","title":"Has More","default":false},"next_skip":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Skip"},"status_counts":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"Status Counts"},"folder_counts":{"anyOf":[{"items":{"$ref":"#/components/schemas/FolderCount"},"type":"array"},{"type":"null"}],"title":"Folder Counts"}},"type":"object","required":["skip","limit","returned_count"],"title":"ListDocsResponse","description":"Flexible response for listing documents with aggregates."},"LogResponse":{"properties":{"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"user_id":{"type":"string","title":"User Id"},"operation_type":{"type":"string","title":"Operation Type"},"status":{"type":"string","title":"Status"},"tokens_used":{"type":"integer","title":"Tokens Used"},"duration_ms":{"type":"number","title":"Duration Ms"},"app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Id"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["timestamp","user_id","operation_type","status","tokens_used","duration_ms"],"title":"LogResponse","description":"Public serialisable view of a telemetry event."},"ManualCredentialsAuthResponse":{"properties":{"auth_type":{"type":"string","title":"Auth Type"},"required_fields":{"items":{"$ref":"#/components/schemas/CredentialField"},"type":"array","title":"Required Fields"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions"}},"type":"object","required":["auth_type","required_fields"],"title":"ManualCredentialsAuthResponse"},"ManualCredentialsRequest":{"properties":{"credentials":{"additionalProperties":true,"type":"object","title":"Credentials"}},"type":"object","required":["credentials"],"title":"ManualCredentialsRequest","description":"Request model for manual credential submission."},"MetadataUpdateRequest":{"properties":{"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Metadata fields to merge into the document."},"metadata_types":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata Types","description":"Optional per-field type hints: 'string', 'number', 'decimal', 'datetime', 'date', 'boolean', 'array', 'object'. Enables typed comparisons."}},"type":"object","title":"MetadataUpdateRequest","description":"Request payload for metadata-only document updates."},"MigrationIngestResponse":{"properties":{"status":{"type":"string","enum":["created","skipped"],"title":"Status"},"document":{"$ref":"#/components/schemas/Document"}},"type":"object","required":["status","document"],"title":"MigrationIngestResponse","description":"Response for a migration document ingest request."},"ModelResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"provider":{"type":"string","title":"Provider"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","name","provider","config","created_at","updated_at"],"title":"ModelResponse","description":"Response for a saved model."},"ModelsResponse":{"properties":{"chat_models":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Chat Models"},"embedding_models":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Embedding Models"},"default_models":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object","title":"Default Models"},"providers":{"items":{"type":"string"},"type":"array","title":"Providers"}},"type":"object","required":["chat_models","embedding_models","default_models","providers"],"title":"ModelsResponse","description":"Response for available models endpoint"},"OAuthAuthResponse":{"properties":{"authorization_url":{"type":"string","title":"Authorization Url"}},"type":"object","required":["authorization_url"],"title":"OAuthAuthResponse"},"OutputFormat":{"type":"string","enum":["base64","url","text"],"title":"OutputFormat","description":"Output format for image chunks in retrieval results."},"QueryPromptOverride":{"properties":{"prompt_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Template","description":"Custom prompt template for generating responses to queries. REQUIRED PLACEHOLDERS: {question} and {context} must be included in the template. The {question} placeholder will be replaced with the user query, and {context} will be replaced with the retrieved content. Use this to control response style, format, and tone."},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt","description":"Custom system prompt that replaces Morphik's default query agent instructions. Use this to fully control the assistant's behavior when generating responses."}},"type":"object","title":"QueryPromptOverride","description":"Configuration for customizing query prompts.\n\nThis allows you to customize how responses are generated during query operations.\nQuery prompts guide the LLM on how to format and style responses, what tone to use,\nand how to incorporate retrieved information into the response.\n\nRequired placeholders:\n- {question}: Will be replaced with the user's query\n- {context}: Will be replaced with the retrieved content/context\n\nExample prompt template:\n```\nAnswer the following question based on the provided information.\n\nQuestion: {question}\n\nContext:\n{context}\n\nAnswer:\n```"},"QueryPromptOverrides":{"properties":{"entity_extraction":{"anyOf":[{"$ref":"#/components/schemas/EntityExtractionPromptOverride"},{"type":"null"}],"description":"Overrides for entity extraction prompts - controls how entities are identified in text during queries"},"entity_resolution":{"anyOf":[{"$ref":"#/components/schemas/EntityResolutionPromptOverride"},{"type":"null"}],"description":"Overrides for entity resolution prompts - controls how variant forms are grouped during queries"},"query":{"anyOf":[{"$ref":"#/components/schemas/QueryPromptOverride"},{"type":"null"}],"description":"Overrides for query prompts - controls response generation style, format, and tone"}},"additionalProperties":false,"type":"object","title":"QueryPromptOverrides","description":"Container for query-related prompt overrides.\n\nUse this class when customizing prompts for query operations, which may\ninclude customizations for entity extraction, entity resolution, and\nthe query/response generation itself.\n\nThis is the most feature-complete override class, supporting all customization types.\n\nAvailable customizations:\n- entity_extraction: Customize how entities are identified in text\n- entity_resolution: Customize how entity variants are grouped\n- query: Customize response generation style, format, and tone\n\nEach type has its own required placeholders. See the specific class documentation\nfor details and examples."},"RequeueIngestionJob":{"properties":{"external_id":{"type":"string","title":"External Id","description":"External identifier of the document to requeue"},"use_colpali":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Colpali","description":"When provided, uses Morphik's finetuned ColPali style embeddings (recommended to be True for high quality retrieval)."}},"type":"object","required":["external_id"],"title":"RequeueIngestionJob","description":"Job descriptor for requeuing an ingestion task."},"RequeueIngestionRequest":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/RequeueIngestionJob"},"type":"array","title":"Jobs","description":"Collection of jobs to requeue, each with optional ColPali override."},"include_all":{"type":"boolean","title":"Include All","description":"When true, requeue every accessible document whose status matches `statuses` (defaults to processing/failed).","default":false},"statuses":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Statuses","description":"Processing statuses to include when `include_all` is true. Defaults to ['processing', 'failed']."},"limit":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Limit","description":"Maximum number of documents to auto-select from the provided statuses when include_all is true."}},"type":"object","title":"RequeueIngestionRequest","description":"Request payload for requeueing ingestion jobs."},"RequeueIngestionResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/RequeueIngestionResult"},"type":"array","title":"Results","description":"Per-document outcomes"}},"type":"object","required":["results"],"title":"RequeueIngestionResponse","description":"Response payload for requeueing ingestion jobs."},"RequeueIngestionResult":{"properties":{"external_id":{"type":"string","title":"External Id","description":"Document external identifier"},"status":{"type":"string","title":"Status","description":"Outcome status for this job"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Optional human-readable message describing the outcome"}},"type":"object","required":["external_id","status"],"title":"RequeueIngestionResult","description":"Result information for an individual requeued ingestion job."},"RetrieveRequest":{"properties":{"query":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Query","description":"Natural-language query used to retrieve relevant chunks or documents."},"query_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query Image","description":"Base64-encoded image to use as query for Morphik multimodal retrieval. Requires use_colpali=True. Mutually exclusive with 'query'."},"filters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filters","description":"Metadata filters supporting logical operators ($and/$or/$not/$nor) and field predicates ($eq/$ne/$gt/$gte/$lt/$lte/$in/$nin/$exists/$type/$regex/$contains)."},"k":{"type":"integer","exclusiveMinimum":0.0,"title":"K","description":"Maximum number of chunks or documents to return.","default":4},"min_score":{"type":"number","title":"Min Score","description":"Minimum similarity score a result must meet before it is returned.","default":0.0},"use_reranking":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Reranking","description":"When provided, overrides the workspace reranking configuration for this request."},"use_colpali":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Colpali","description":"When provided, uses Morphik's finetuned ColPali style embeddings (recommended to be True for high quality retrieval)."},"output_format":{"anyOf":[{"$ref":"#/components/schemas/OutputFormat"},{"type":"null"}],"description":"How to return image chunks: base64 (default), url, or text (markdown format)","default":"base64"},"padding":{"type":"integer","minimum":0.0,"title":"Padding","description":"Number of additional chunks/pages to retrieve before and after matched chunks (ColPali only)","default":0},"folder_name":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Folder Name","description":"Optional folder scope. Accepts a folder PATH (e.g., '/Company/Reports') or list of paths."},"folder_depth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Folder Depth","description":"Folder scope depth. 0 or None = exact folder only, -1 = include all descendants, n > 0 = include descendants up to n levels deeper."},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id","description":"Optional end-user scope for the operation"}},"type":"object","title":"RetrieveRequest","description":"Base retrieve request model"},"SaveApiKeyRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"api_key":{"type":"string","title":"Api Key"},"base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Url"}},"type":"object","required":["provider","api_key"],"title":"SaveApiKeyRequest","description":"Request to save API keys."},"SaveModelRequest":{"properties":{"name":{"type":"string","title":"Name"},"provider":{"type":"string","title":"Provider"},"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["name","provider","config"],"title":"SaveModelRequest","description":"Request to save a custom model."},"SearchDocumentsRequest":{"properties":{"query":{"type":"string","minLength":1,"title":"Query","description":"Search query for document names/filenames"},"limit":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Limit","description":"Number of documents to return","default":10},"filters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filters","description":"Optional metadata filters for documents"},"folder_name":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Folder Name","description":"Optional folder scope. Accepts a folder PATH (e.g., '/Company/Reports') or list of paths."},"folder_depth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Folder Depth","description":"Folder scope depth: 0/None exact, -1 all descendants, n>0 include descendants up to n levels."},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id","description":"Optional end-user scope for the search"}},"type":"object","required":["query"],"title":"SearchDocumentsRequest","description":"Request model for searching documents by name"},"ServiceStatus":{"properties":{"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"response_time_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Response Time Ms"}},"type":"object","required":["name","status"],"title":"ServiceStatus","description":"Status of an individual service"},"StructuredCompletion":{"properties":{},"additionalProperties":true,"type":"object","title":"StructuredCompletion","description":"Structured completion object for schema-based responses"},"SummaryResponse":{"properties":{"content":{"type":"string","title":"Content"},"storage_key":{"type":"string","title":"Storage Key"},"bucket":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bucket"},"version":{"type":"integer","title":"Version"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["content","storage_key","version"],"title":"SummaryResponse","description":"Response payload returned when reading or writing summaries."},"SummaryUpsertRequest":{"properties":{"content":{"type":"string","title":"Content","description":"Summary content to persist (markdown/text)"},"versioning":{"type":"boolean","title":"Versioning","description":"When true, automatically increments the summary version instead of overwriting the latest version","default":true},"overwrite_latest":{"type":"boolean","title":"Overwrite Latest","description":"Allow overwriting the latest summary when versioning is disabled","default":false}},"type":"object","required":["content"],"title":"SummaryUpsertRequest","description":"Request payload for writing or updating an entity summary."},"V2ChunkResult":{"properties":{"chunk_id":{"type":"string","title":"Chunk Id"},"document_id":{"type":"string","title":"Document Id"},"page_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Number"},"chunk_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Chunk Number"},"score":{"type":"number","title":"Score"},"content":{"type":"string","title":"Content"}},"type":"object","required":["chunk_id","document_id","score","content"],"title":"V2ChunkResult"},"V2IngestResponse":{"properties":{"document_id":{"type":"string","title":"Document Id"},"filename":{"type":"string","title":"Filename"},"chunk_count":{"type":"integer","title":"Chunk Count"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","required":["document_id","filename","chunk_count"],"title":"V2IngestResponse"},"V2RetrieveFilters":{"properties":{"document_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Document Ids","description":"Limit to specific document IDs"},"folder_paths":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Folder Paths","description":"Limit to specific folder paths"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Chunk-level metadata filters"}},"type":"object","title":"V2RetrieveFilters"},"V2RetrieveRequest":{"properties":{"query":{"type":"string","title":"Query"},"filters":{"anyOf":[{"$ref":"#/components/schemas/V2RetrieveFilters"},{"type":"null"}]},"top_k":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Top K","default":5},"end_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Id","description":"Optional end-user scope"}},"type":"object","required":["query"],"title":"V2RetrieveRequest"},"V2RetrieveResponse":{"properties":{"query":{"type":"string","title":"Query"},"chunks":{"items":{"$ref":"#/components/schemas/V2ChunkResult"},"type":"array","title":"Chunks"}},"type":"object","required":["query","chunks"],"title":"V2RetrieveResponse"},"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"}}}}