{"openapi":"3.1.0","info":{"title":"Hayfork Search API","description":"Production-style Search-as-a-Service with hybrid retrieval. Every request is authenticated with a tenant-scoped Bearer API key or a console session; scopes are search, ingest, admin, platform.","version":"0.2.0"},"paths":{"/health":{"get":{"tags":["system"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/me":{"get":{"tags":["identity"],"summary":"Me","operationId":"me_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/embedding-profile":{"get":{"tags":["system"],"summary":"Active Embedding Profile","description":"The embedding model, chunking, prefixes, and index this deployment is using.","operationId":"active_embedding_profile_embedding_profile_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingProfileOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/capabilities":{"get":{"tags":["system"],"summary":"Capabilities","description":"What this deployment allows, so clients can hide options that would be refused.","operationId":"capabilities_capabilities_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/embedding-profiles":{"get":{"tags":["system"],"summary":"List Embedding Profiles","description":"Every profile defined in code; set EMBEDDING_PROFILE to one of these names.","operationId":"list_embedding_profiles_embedding_profiles_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmbeddingProfileOut"},"title":"Response List Embedding Profiles Embedding Profiles Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/collections":{"get":{"summary":"List Collections","operationId":"list_collections_collections_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CollectionOut"},"title":"Response List Collections Collections Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Collection","operationId":"create_collection_collections_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/collections/{collection_id}":{"get":{"summary":"Get Collection","operationId":"get_collection_collections__collection_id__get","parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Collection","description":"Rename a collection, change its description, or replace the data sources it searches.","operationId":"update_collection_collections__collection_id__patch","parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Collection","operationId":"delete_collection_collections__collection_id__delete","parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/data-sources":{"get":{"summary":"List Data Sources","operationId":"list_data_sources_data_sources_get","parameters":[{"name":"collection_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DataSourceOut"},"title":"Response List Data Sources Data Sources Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Data Source","operationId":"create_data_source_data_sources_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/data-sources/{data_source_id}":{"get":{"summary":"Get Data Source","operationId":"get_data_source_data_sources__data_source_id__get","parameters":[{"name":"data_source_id","in":"path","required":true,"schema":{"type":"string","title":"Data Source Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Data Source","operationId":"delete_data_source_data_sources__data_source_id__delete","parameters":[{"name":"data_source_id","in":"path","required":true,"schema":{"type":"string","title":"Data Source Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents":{"get":{"summary":"List Documents","operationId":"list_documents_documents_get","parameters":[{"name":"collection_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Id"}},{"name":"data_source_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data Source Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentOut"},"title":"Response List Documents Documents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}":{"get":{"summary":"Get Document","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"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Document","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"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/chunks":{"get":{"summary":"Retrieve Document","operationId":"retrieve_document_documents__document_id__chunks_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/crawl":{"get":{"summary":"List Crawls","operationId":"list_crawls_crawl_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CrawlOut"},"title":"Response List Crawls Crawl Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Crawl","operationId":"create_crawl_crawl_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlCreate"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/crawl/{job_id}":{"get":{"summary":"Get Crawl","operationId":"get_crawl_crawl__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/search":{"post":{"summary":"Search","description":"Human-facing search: ranked hits with clean snippets, one per document by default.\nLLM consumers should use POST /retrieve for full chunk text.","operationId":"search_search_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/retrieve":{"post":{"summary":"Retrieve","operationId":"retrieve_retrieve_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/industry-benchmarks":{"get":{"summary":"List Industry Benchmarks","operationId":"list_industry_benchmarks_industry_benchmarks_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/benchmarks":{"get":{"summary":"List Benchmarks","operationId":"list_benchmarks_benchmarks_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BenchmarkSuiteOut"},"title":"Response List Benchmarks Benchmarks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Benchmark","operationId":"create_benchmark_benchmarks_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BenchmarkSuiteCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BenchmarkSuiteOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/benchmarks/{suite_id}":{"get":{"summary":"Get Benchmark","operationId":"get_benchmark_benchmarks__suite_id__get","parameters":[{"name":"suite_id","in":"path","required":true,"schema":{"type":"string","title":"Suite Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BenchmarkSuiteOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Benchmark","operationId":"delete_benchmark_benchmarks__suite_id__delete","parameters":[{"name":"suite_id","in":"path","required":true,"schema":{"type":"string","title":"Suite Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/openai-tools.json":{"get":{"summary":"Openai Tool Schema","operationId":"openai_tool_schema_openai_tools_json_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/collections/{collection_id}/data-sources/{data_source_id}":{"put":{"summary":"Attach Data Source","operationId":"attach_data_source_collections__collection_id__data_sources__data_source_id__put","parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}},{"name":"data_source_id","in":"path","required":true,"schema":{"type":"string","title":"Data Source Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Detach Data Source","operationId":"detach_data_source_collections__collection_id__data_sources__data_source_id__delete","parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}},{"name":"data_source_id","in":"path","required":true,"schema":{"type":"string","title":"Data Source Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/upload":{"post":{"summary":"Upload Documents","operationId":"upload_documents_documents_upload_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_documents_documents_upload_post"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentOut"},"title":"Response Upload Documents Documents Upload Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/data-sources/{data_source_id}/reindex":{"post":{"summary":"Reindex Data Source","description":"Re-embed every document in the source with the current embedding provider.","operationId":"reindex_data_source_data_sources__data_source_id__reindex_post","parameters":[{"name":"data_source_id","in":"path","required":true,"schema":{"type":"string","title":"Data Source Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reindex":{"post":{"summary":"Reindex Tenant","description":"Re-embed every document in the workspace, for example after changing EMBEDDING_PROVIDER.","operationId":"reindex_tenant_reindex_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/crawl/check":{"post":{"summary":"Check Crawl Target","description":"Look before you crawl: policy, reachability, robots.txt, sitemap size, llms.txt, JavaScript-only pages.\nFetches a handful of URLs and indexes nothing.","operationId":"check_crawl_target_crawl_check_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteCheckRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteCheckOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/crawl/{job_id}/cancel":{"post":{"summary":"Cancel Crawl","description":"Stop a running crawl. Pages already indexed are kept.","operationId":"cancel_crawl_crawl__job_id__cancel_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/crawl/{job_id}/retry":{"post":{"summary":"Retry Crawl","description":"Re-queue a failed or cancelled crawl. Pages it already indexed are skipped, so it resumes.","operationId":"retry_crawl_crawl__job_id__retry_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/benchmarks/{suite_id}/run":{"post":{"summary":"Run Benchmark","operationId":"run_benchmark_benchmarks__suite_id__run_post","parameters":[{"name":"suite_id","in":"path","required":true,"schema":{"type":"string","title":"Suite Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BenchmarkRunOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api-keys":{"get":{"tags":["api-keys"],"summary":"List Api Keys","operationId":"list_api_keys_api_keys_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyOut"},"title":"Response List Api Keys Api Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["api-keys"],"summary":"Create Api Key","operationId":"create_api_key_api_keys_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api-keys/{key_id}":{"delete":{"tags":["api-keys"],"summary":"Revoke Api Key","operationId":"revoke_api_key_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants":{"get":{"tags":["tenants"],"summary":"List Tenants","operationId":"list_tenants_tenants_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TenantOut"},"title":"Response List Tenants Tenants Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tenants"],"summary":"Create Tenant","operationId":"create_tenant_tenants_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/signup":{"post":{"tags":["account"],"summary":"Signup","operationId":"signup_auth_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"tags":["account"],"summary":"Login","operationId":"login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/logout":{"post":{"tags":["account"],"summary":"Logout","operationId":"logout_auth_logout_post","parameters":[{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/verify":{"post":{"tags":["account"],"summary":"Verify Email","operationId":"verify_email_auth_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/resend-verification":{"post":{"tags":["account"],"summary":"Resend Verification","operationId":"resend_verification_auth_resend_verification_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/forgot-password":{"post":{"tags":["account"],"summary":"Forgot Password","operationId":"forgot_password_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/reset-password":{"post":{"tags":["account"],"summary":"Reset Password","operationId":"reset_password_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/workspace":{"delete":{"tags":["account"],"summary":"Delete Workspace","operationId":"delete_workspace_auth_workspace_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"hayfork_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hayfork Session"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteWorkspaceRequest"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AccountOut":{"properties":{"user":{"$ref":"#/components/schemas/UserOut"},"tenant":{"$ref":"#/components/schemas/TenantOut"},"role":{"type":"string","title":"Role"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"plan":{"type":"string","title":"Plan"}},"type":"object","required":["user","tenant","role","scopes","plan"],"title":"AccountOut"},"ApiKeyCreate":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"scopes":{"items":{"type":"string"},"type":"array","maxItems":4,"minItems":1,"title":"Scopes"},"expires_in_days":{"anyOf":[{"type":"integer","maximum":3650.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Days"}},"type":"object","required":["name"],"title":"ApiKeyCreate"},"ApiKeyCreated":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"status":{"type":"string","title":"Status","default":"active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"key":{"type":"string","title":"Key","description":"The plaintext secret. It is shown once and never stored."}},"type":"object","required":["id","name","prefix","scopes","created_at","key"],"title":"ApiKeyCreated"},"ApiKeyOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"status":{"type":"string","title":"Status","default":"active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"}},"type":"object","required":["id","name","prefix","scopes","created_at"],"title":"ApiKeyOut"},"BenchmarkCaseCreate":{"properties":{"query":{"type":"string","maxLength":2000,"minLength":1,"title":"Query"},"relevant_document_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Relevant Document Ids"}},"type":"object","required":["query","relevant_document_ids"],"title":"BenchmarkCaseCreate"},"BenchmarkCaseOut":{"properties":{"id":{"type":"string","title":"Id"},"query":{"type":"string","title":"Query"},"relevant_document_ids":{"items":{"type":"string"},"type":"array","title":"Relevant Document Ids"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","query","relevant_document_ids","created_at"],"title":"BenchmarkCaseOut"},"BenchmarkRunOut":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"},"query_count":{"type":"integer","title":"Query Count"},"top_k":{"type":"integer","title":"Top K"},"metrics":{"additionalProperties":true,"type":"object","title":"Metrics"},"results":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Results"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","status","query_count","top_k","metrics","results","created_at"],"title":"BenchmarkRunOut"},"BenchmarkSuiteCreate":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"type":"string","maxLength":2000,"title":"Description","default":""},"collection_id":{"type":"string","title":"Collection Id"},"top_k":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Top K","default":10},"cases":{"items":{"$ref":"#/components/schemas/BenchmarkCaseCreate"},"type":"array","maxItems":500,"minItems":1,"title":"Cases"}},"type":"object","required":["name","collection_id","cases"],"title":"BenchmarkSuiteCreate"},"BenchmarkSuiteOut":{"properties":{"id":{"type":"string","title":"Id"},"collection_id":{"type":"string","title":"Collection Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"top_k":{"type":"integer","title":"Top K"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"cases":{"items":{"$ref":"#/components/schemas/BenchmarkCaseOut"},"type":"array","title":"Cases"},"runs":{"items":{"$ref":"#/components/schemas/BenchmarkRunOut"},"type":"array","title":"Runs"}},"type":"object","required":["id","collection_id","name","description","top_k","created_at","cases","runs"],"title":"BenchmarkSuiteOut"},"Body_upload_documents_documents_upload_post":{"properties":{"data_source_id":{"type":"string","title":"Data Source Id"},"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"}},"type":"object","required":["data_source_id","files"],"title":"Body_upload_documents_documents_upload_post"},"CollectionCreate":{"properties":{"name":{"type":"string","maxLength":160,"minLength":1,"title":"Name"},"description":{"type":"string","maxLength":2000,"title":"Description","default":""},"data_source_ids":{"items":{"type":"string"},"type":"array","title":"Data Source Ids"}},"type":"object","required":["name"],"title":"CollectionCreate"},"CollectionOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"document_count":{"type":"integer","title":"Document Count","default":0},"indexed_count":{"type":"integer","title":"Indexed Count","default":0},"data_source_count":{"type":"integer","title":"Data Source Count","default":0}},"type":"object","required":["id","name","description","created_at"],"title":"CollectionOut"},"CollectionUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":160,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"data_source_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Data Source Ids"}},"type":"object","title":"CollectionUpdate","description":"Partial update: only the fields present change. data_source_ids replaces the whole set."},"CrawlCreate":{"properties":{"collection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Id"},"data_source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data Source Id"},"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"},"max_depth":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Max Depth","default":2},"page_limit":{"type":"integer","maximum":20000.0,"minimum":1.0,"title":"Page Limit","default":25},"render_js":{"type":"boolean","title":"Render Js","description":"Render pages in a headless browser (slower; for JS-only sites)","default":false},"include_paths":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Include Paths","description":"Only crawl URLs whose path starts with one of these prefixes, e.g. ['/en/']. Empty = whole site."}},"type":"object","required":["url"],"title":"CrawlCreate"},"CrawlOut":{"properties":{"id":{"type":"string","title":"Id"},"data_source_id":{"type":"string","title":"Data Source Id"},"url":{"type":"string","title":"Url"},"status":{"type":"string","title":"Status"},"pages_crawled":{"type":"integer","title":"Pages Crawled"},"page_limit":{"type":"integer","title":"Page Limit"},"max_depth":{"type":"integer","title":"Max Depth"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","data_source_id","url","status","pages_crawled","page_limit","max_depth","created_at"],"title":"CrawlOut"},"DataSourceCreate":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"source_type":{"type":"string","pattern":"^(upload|website)$","title":"Source Type"},"configuration":{"additionalProperties":true,"type":"object","title":"Configuration"},"collection_ids":{"items":{"type":"string"},"type":"array","title":"Collection Ids"}},"type":"object","required":["name","source_type"],"title":"DataSourceCreate"},"DataSourceOut":{"properties":{"id":{"type":"string","title":"Id"},"collection_ids":{"items":{"type":"string"},"type":"array","title":"Collection Ids"},"name":{"type":"string","title":"Name"},"source_type":{"type":"string","title":"Source Type"},"status":{"type":"string","title":"Status"},"configuration":{"additionalProperties":true,"type":"object","title":"Configuration"},"last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Synced At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"document_count":{"type":"integer","title":"Document Count","default":0},"indexed_count":{"type":"integer","title":"Indexed Count","default":0}},"type":"object","required":["id","name","source_type","status","configuration","created_at"],"title":"DataSourceOut"},"DeleteWorkspaceRequest":{"properties":{"confirm":{"type":"string","title":"Confirm","description":"The workspace slug, typed by the owner to confirm."}},"type":"object","required":["confirm"],"title":"DeleteWorkspaceRequest"},"DocumentOut":{"properties":{"id":{"type":"string","title":"Id"},"data_source_id":{"type":"string","title":"Data Source Id"},"title":{"type":"string","title":"Title"},"source_type":{"type":"string","title":"Source Type"},"source":{"type":"string","title":"Source"},"status":{"type":"string","title":"Status"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","data_source_id","title","source_type","source","status","created_at"],"title":"DocumentOut"},"EmbeddingProfileOut":{"properties":{"name":{"type":"string","title":"Name"},"provider":{"type":"string","title":"Provider"},"model":{"type":"string","title":"Model"},"dimension":{"type":"integer","title":"Dimension"},"max_input_tokens":{"type":"integer","title":"Max Input Tokens"},"chunk_size_tokens":{"type":"integer","title":"Chunk Size Tokens"},"chunk_overlap_tokens":{"type":"integer","title":"Chunk Overlap Tokens"},"query_prefix":{"type":"string","title":"Query Prefix"},"passage_prefix":{"type":"string","title":"Passage Prefix"},"modalities":{"items":{"type":"string"},"type":"array","title":"Modalities"},"description":{"type":"string","title":"Description"},"active":{"type":"boolean","title":"Active","default":false},"index_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Index Name"}},"type":"object","required":["name","provider","model","dimension","max_input_tokens","chunk_size_tokens","chunk_overlap_tokens","query_prefix","passage_prefix","modalities","description"],"title":"EmbeddingProfileOut"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","maxLength":320,"title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LoginRequest":{"properties":{"email":{"type":"string","maxLength":320,"title":"Email"},"password":{"type":"string","maxLength":200,"title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"MeOut":{"properties":{"tenant":{"$ref":"#/components/schemas/TenantOut"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"key":{"anyOf":[{"$ref":"#/components/schemas/ApiKeyOut"},{"type":"null"}]},"user":{"anyOf":[{"$ref":"#/components/schemas/UserOut"},{"type":"null"}]},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"plan":{"type":"string","title":"Plan","default":"free"},"auth_method":{"type":"string","title":"Auth Method","default":"api_key"},"usage":{"anyOf":[{"$ref":"#/components/schemas/UsageOut"},{"type":"null"}]}},"type":"object","required":["tenant","scopes"],"title":"MeOut"},"ResetPasswordRequest":{"properties":{"token":{"type":"string","maxLength":500,"title":"Token"},"password":{"type":"string","maxLength":200,"minLength":10,"title":"Password"}},"type":"object","required":["token","password"],"title":"ResetPasswordRequest"},"RetrieveRequest":{"properties":{"collection_id":{"type":"string","title":"Collection Id"},"query":{"type":"string","maxLength":2000,"minLength":1,"title":"Query"},"top_k":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Top K","description":"Maximum matched chunks to return","default":8},"max_chunks_per_document":{"type":"integer","maximum":20.0,"minimum":1.0,"title":"Max Chunks Per Document","default":3},"context_window":{"type":"integer","maximum":2.0,"minimum":0.0,"title":"Context Window","description":"Also return this many adjacent chunks before and after each match","default":0},"max_tokens":{"anyOf":[{"type":"integer","maximum":64000.0,"minimum":100.0},{"type":"null"}],"title":"Max Tokens","description":"Trim contexts to this estimated token budget"},"format":{"type":"string","pattern":"^(json|text)$","title":"Format","default":"json"}},"type":"object","required":["collection_id","query"],"title":"RetrieveRequest"},"RetrieveResponse":{"properties":{"query":{"type":"string","title":"Query"},"took_ms":{"type":"integer","title":"Took Ms"},"contexts":{"items":{"$ref":"#/components/schemas/RetrievedContext"},"type":"array","title":"Contexts"},"documents":{"items":{"$ref":"#/components/schemas/RetrievedDocument"},"type":"array","title":"Documents"},"token_estimate":{"type":"integer","title":"Token Estimate"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"Ready-to-paste context block when format=text"}},"type":"object","required":["query","took_ms","contexts","documents","token_estimate"],"title":"RetrieveResponse"},"RetrievedContext":{"properties":{"id":{"type":"string","title":"Id"},"document_id":{"type":"string","title":"Document Id"},"title":{"type":"string","title":"Title"},"source":{"type":"string","title":"Source"},"position":{"type":"integer","title":"Position"},"heading_path":{"items":{"type":"string"},"type":"array","title":"Heading Path","default":[]},"text":{"type":"string","title":"Text"},"score":{"type":"number","title":"Score"},"expanded":{"type":"boolean","title":"Expanded","default":false},"citation":{"type":"integer","title":"Citation"}},"type":"object","required":["id","document_id","title","source","position","text","score","citation"],"title":"RetrievedContext"},"RetrievedDocument":{"properties":{"document_id":{"type":"string","title":"Document Id"},"title":{"type":"string","title":"Title"},"source":{"type":"string","title":"Source"},"best_score":{"type":"number","title":"Best Score"},"chunks":{"type":"integer","title":"Chunks"}},"type":"object","required":["document_id","title","source","best_score","chunks"],"title":"RetrievedDocument"},"SearchHit":{"properties":{"document_id":{"type":"string","title":"Document Id"},"chunk_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chunk Id"},"title":{"type":"string","title":"Title"},"snippet":{"type":"string","title":"Snippet"},"score":{"type":"number","title":"Score"},"source":{"type":"string","title":"Source"},"heading_path":{"items":{"type":"string"},"type":"array","title":"Heading Path","default":[]},"position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Position"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"highlights":{"items":{"type":"string"},"type":"array","title":"Highlights","default":[]}},"type":"object","required":["document_id","title","snippet","score","source","metadata"],"title":"SearchHit"},"SearchRequest":{"properties":{"collection_id":{"type":"string","title":"Collection Id"},"query":{"type":"string","maxLength":2000,"minLength":1,"title":"Query"},"top_k":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Top K","default":10},"collapse_documents":{"type":"boolean","title":"Collapse Documents","description":"Return one hit per document (its best chunk)","default":true}},"type":"object","required":["collection_id","query"],"title":"SearchRequest"},"SearchResponse":{"properties":{"query":{"type":"string","title":"Query"},"took_ms":{"type":"integer","title":"Took Ms"},"total":{"type":"integer","title":"Total"},"results":{"items":{"$ref":"#/components/schemas/SearchHit"},"type":"array","title":"Results"}},"type":"object","required":["query","took_ms","total","results"],"title":"SearchResponse"},"SignupRequest":{"properties":{"email":{"type":"string","maxLength":320,"pattern":"^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$","title":"Email"},"password":{"type":"string","maxLength":200,"minLength":10,"title":"Password"},"workspace_name":{"type":"string","maxLength":200,"minLength":1,"title":"Workspace Name"}},"type":"object","required":["email","password","workspace_name"],"title":"SignupRequest"},"SiteCheckItem":{"properties":{"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["name","status","detail"],"title":"SiteCheckItem"},"SiteCheckOut":{"properties":{"url":{"type":"string","title":"Url"},"final_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Url"},"reachable":{"type":"boolean","title":"Reachable"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Code"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"can_crawl":{"type":"boolean","title":"Can Crawl"},"blocked_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Blocked Reason"},"robots_found":{"type":"boolean","title":"Robots Found"},"robots_allowed":{"type":"boolean","title":"Robots Allowed"},"crawl_delay":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Crawl Delay"},"sitemap_found":{"type":"boolean","title":"Sitemap Found"},"sitemap_page_count":{"type":"integer","title":"Sitemap Page Count"},"sitemap_index_count":{"type":"integer","title":"Sitemap Index Count"},"sitemap_sampled":{"type":"boolean","title":"Sitemap Sampled"},"sitemap_sample":{"items":{"type":"string"},"type":"array","title":"Sitemap Sample"},"llms_txt_found":{"type":"boolean","title":"Llms Txt Found"},"llms_txt_page_count":{"type":"integer","title":"Llms Txt Page Count"},"markdown_twin":{"type":"boolean","title":"Markdown Twin"},"needs_js":{"type":"boolean","title":"Needs Js"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"},"estimated_pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Estimated Pages"},"suggested_page_limit":{"type":"integer","title":"Suggested Page Limit"},"suggested_depth":{"type":"integer","title":"Suggested Depth"},"checks":{"items":{"$ref":"#/components/schemas/SiteCheckItem"},"type":"array","title":"Checks"},"elapsed_ms":{"type":"integer","title":"Elapsed Ms"}},"type":"object","required":["url","final_url","reachable","status_code","content_type","can_crawl","blocked_reason","robots_found","robots_allowed","crawl_delay","sitemap_found","sitemap_page_count","sitemap_index_count","sitemap_sampled","sitemap_sample","llms_txt_found","llms_txt_page_count","markdown_twin","needs_js","scope","estimated_pages","suggested_page_limit","suggested_depth","checks","elapsed_ms"],"title":"SiteCheckOut"},"SiteCheckRequest":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"}},"type":"object","required":["url"],"title":"SiteCheckRequest"},"TenantCreate":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"slug":{"anyOf":[{"type":"string","maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},{"type":"null"}],"title":"Slug"},"admin_key_name":{"type":"string","maxLength":120,"minLength":1,"title":"Admin Key Name","default":"Admin key"}},"type":"object","required":["name"],"title":"TenantCreate"},"TenantCreated":{"properties":{"tenant":{"$ref":"#/components/schemas/TenantOut"},"admin_key":{"$ref":"#/components/schemas/ApiKeyCreated"}},"type":"object","required":["tenant","admin_key"],"title":"TenantCreated"},"TenantOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","slug","created_at"],"title":"TenantOut"},"UsageOut":{"properties":{"period":{"type":"string","title":"Period"},"sources_used":{"type":"integer","title":"Sources Used"},"sources_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sources Limit"},"documents_used":{"type":"integer","title":"Documents Used"},"documents_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Documents Limit"},"queries_used":{"type":"integer","title":"Queries Used"},"queries_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Queries Limit"}},"type":"object","required":["period","sources_used","sources_limit","documents_used","documents_limit","queries_used","queries_limit"],"title":"UsageOut"},"UserOut":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"email_verified":{"type":"boolean","title":"Email Verified"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","email_verified","created_at"],"title":"UserOut"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyEmailRequest":{"properties":{"token":{"type":"string","maxLength":500,"title":"Token"}},"type":"object","required":["token"],"title":"VerifyEmailRequest"}}}}