{"openapi":"3.1.0","info":{"title":"Latent Lab API","version":"0.1.0"},"paths":{"/v1/auth/register":{"post":{"tags":["auth"],"summary":"Register User","description":"Register a new user with email and password","operationId":"register_user_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/login":{"post":{"tags":["auth"],"summary":"Login","description":"Login a user with email and password\n\nThis endpoint authenticates the user and returns their data.\nNextAuth.js will create a JWT on the client side.","operationId":"login_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginCredentials"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","description":"Logout endpoint for NextAuth integration\n\nWith JWT-based auth, the logout is handled entirely on the client side\nby NextAuth removing the token. This endpoint exists for API completeness.","operationId":"logout_v1_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/verification/request":{"post":{"tags":["auth"],"summary":"Request Verification","description":"Request an email verification token","operationId":"request_verification_v1_auth_verification_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailVerificationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/verification/verify":{"post":{"tags":["auth"],"summary":"Verify Email Token","description":"Verify an email with a token","operationId":"verify_email_token_v1_auth_verification_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenVerificationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/password/reset-request":{"post":{"tags":["auth"],"summary":"Request Password Reset","description":"Request a password reset token","operationId":"request_password_reset_v1_auth_password_reset_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/password/reset":{"post":{"tags":["auth"],"summary":"Reset Password","description":"Reset a user's password using a reset token","operationId":"reset_password_v1_auth_password_reset_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetComplete"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/oauth/callback":{"post":{"tags":["auth"],"summary":"Oauth Callback","description":"Handle OAuth authentication callback\nThis endpoint is called by the frontend after receiving OAuth data from the provider","operationId":"oauth_callback_v1_auth_oauth_callback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthUserData"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/password/change":{"post":{"tags":["auth"],"summary":"Change Password","description":"Change password for authenticated user\n\nThis endpoint works with NextAuth JWT authentication.","operationId":"change_password_v1_auth_password_change_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordChangeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/me":{"get":{"tags":["auth"],"summary":"Get User Profile","description":"Get the current user's profile\n\nThis endpoint works with NextAuth JWT authentication.\n\nAdds `tenant_slug` for tenant-provisioned users (ADR-053). The\nUI uses it to detect iframe-SSO sessions and to render a tenant\nbadge on /account.","operationId":"get_user_profile_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}}},"delete":{"tags":["auth"],"summary":"Delete User","description":"Delete the current user's account.\nThis is a permanent operation and cannot be undone.\n\nThis endpoint works with NextAuth JWT authentication.","operationId":"delete_user_v1_auth_me_delete","responses":{"204":{"description":"Successful Response"}}},"patch":{"tags":["auth"],"summary":"Update User Profile","description":"Update the current user's profile\n\nThis endpoint works with NextAuth JWT authentication.","operationId":"update_user_profile_v1_auth_me_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/users/by-email/{email}":{"get":{"tags":["auth"],"summary":"Get User By Email","description":"Get a user by their email address\nThis endpoint is used by the NextAuth.js adapter","operationId":"get_user_by_email_v1_auth_users_by_email__email__get","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/users/{user_id}":{"get":{"tags":["auth"],"summary":"Get User By Id","description":"Get a user by their ID\nThis endpoint is used by the NextAuth.js adapter","operationId":"get_user_by_id_v1_auth_users__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/session/info":{"get":{"tags":["auth"],"summary":"Get Session Info","description":"Get information about the current JWT session\n\nReturns information about the current user and session expiration.\nThis is used by NextAuth.js adapter.","operationId":"get_session_info_v1_auth_session_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/token":{"post":{"tags":["auth"],"summary":"Get Auth Token","description":"Get a JWT token for API clients\n\nThis endpoint is used by API clients that need a token\nrather than cookie-based authentication.","operationId":"get_auth_token_v1_auth_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginCredentials"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/api-keys":{"get":{"tags":["api-keys"],"summary":"List Api Keys","description":"List the authenticated user's API keys (without the secret).","operationId":"list_api_keys_v1_auth_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApiKeyListItem"},"type":"array","title":"Response List Api Keys V1 Auth Api Keys Get"}}}}}},"post":{"tags":["api-keys"],"summary":"Create Api Key","description":"Mint a fresh API key for the authenticated user.\n\nThe full key is returned ONCE in this response and never recoverable\nafterwards. The server only persists ``prefix`` (visible in UI/logs)\nand ``key_hash`` (SHA-256 for lookup).","operationId":"create_api_key_v1_auth_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/api-keys/{key_id}":{"delete":{"tags":["api-keys"],"summary":"Revoke Api Key","description":"Soft-delete an API key. Subsequent auth attempts will 401.","operationId":"revoke_api_key_v1_auth_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeApiKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/device/start":{"post":{"tags":["device-auth"],"summary":"Start Device Flow","description":"Initiate device authorization. Returns the codes the agent shows\nto the user, plus polling parameters.","operationId":"start_device_flow_v1_auth_device_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/device/poll":{"post":{"tags":["device-auth"],"summary":"Poll Device Flow","description":"Agent polls here every ``interval`` seconds. Returns ``pending``\nuntil the user approves, then returns the API key plaintext exactly\nonce. Subsequent polls return ``denied`` (consumed).","operationId":"poll_device_flow_v1_auth_device_poll_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/device/info":{"get":{"tags":["device-auth"],"summary":"Device Info","description":"Look up a device-code request by its short ``user_code``. Used\nby the /device page to show 'Approve <client_name>?'.","operationId":"device_info_v1_auth_device_info_get","parameters":[{"name":"user_code","in":"query","required":true,"schema":{"type":"string","title":"User Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfoResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/device/approve":{"post":{"tags":["device-auth"],"summary":"Approve Device Flow","description":"User-facing approval. Mints an API key for the signed-in user\nand stashes its plaintext on the device-code row so the agent's\nnext poll can return it.\n\nRequires NextAuth session (cookie) — API keys cannot approve\ndevice codes (lateral-movement containment, like /api-keys).","operationId":"approve_device_flow_v1_auth_device_approve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/gdrive/start":{"get":{"tags":["gdrive-auth"],"summary":"Gdrive Start","description":"Redirect the popup to Google's consent screen.\n\nRequires a signed-in session (cookie). Encodes the user id into a\nsigned, short-lived `state` so the callback can verify the flow.","operationId":"gdrive_start_v1_auth_gdrive_start_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/gdrive/callback":{"get":{"tags":["gdrive-auth"],"summary":"Gdrive Callback","description":"Exchange the authorization code for tokens and relay the refresh\ntoken to the opener via postMessage.","operationId":"gdrive_callback_v1_auth_gdrive_callback_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/tenant-exchange":{"post":{"tags":["tenant-auth"],"summary":"Tenant Exchange","description":"Verify a tenant-signed RS256 JWT and mint a NextAuth-compatible JWT.","operationId":"tenant_exchange_v1_auth_tenant_exchange_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantExchangeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantExchangeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{slug}/sources/{source_type}/ingest":{"post":{"tags":["tenant-sources"],"summary":"Push Ingest","description":"Persist a pushed batch, auto-provisioning user + dataset on first sight.\n\nStrict embedding-model lock: if the dataset's\n`settings.embedding_model` is set, every item's `embeddingModel`\nmust match. First batch establishes the lock from the items'\ndeclared model.","operationId":"push_ingest_tenants__slug__sources__source_type__ingest_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"source_type","in":"path","required":true,"schema":{"type":"string","title":"Source Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{slug}/sources/{source_type}/users/{tenant_external_user_id}":{"delete":{"tags":["tenant-sources"],"summary":"Push Drop User","description":"Delete the user's push-source dataset entirely.\n\nThe User row is preserved (they may still have other datasets); only\nthe source-typed dataset for this user is dropped.","operationId":"push_drop_user_tenants__slug__sources__source_type__users__tenant_external_user_id__delete","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"source_type","in":"path","required":true,"schema":{"type":"string","title":"Source Type"}},{"name":"tenant_external_user_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant External User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{slug}/sources/{source_type}/users/{tenant_external_user_id}/items":{"delete":{"tags":["tenant-sources"],"summary":"Push Drop Items","description":"Soft-delete specific items from a user's map.\n\nImplementation: enqueue a synthetic batch where each row has\n``activeCollected: false`` — the watcher's next tick translates\nthat into deletions through the standard pipeline.","operationId":"push_drop_items_tenants__slug__sources__source_type__users__tenant_external_user_id__items_delete","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"source_type","in":"path","required":true,"schema":{"type":"string","title":"Source Type"}},{"name":"tenant_external_user_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant External User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{slug}/sources/{source_type}/users/{tenant_external_user_id}/status":{"get":{"tags":["tenant-sources"],"summary":"Push Status","description":"Inspect a tenant user's dataset state without diving into Datasets API.","operationId":"push_status_tenants__slug__sources__source_type__users__tenant_external_user_id__status_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"source_type","in":"path","required":true,"schema":{"type":"string","title":"Source Type"}},{"name":"tenant_external_user_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant External User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{slug}/settings":{"get":{"tags":["tenant-sources"],"summary":"Return the tenant's default PipelineSettings template","description":"Returns the current ``default_user_settings`` template.\nSecret-flagged fields (provider API keys) are masked to\n``\"...\" + last4`` — same redaction format as\n``/v1/auth/me/settings``. ADR-057: decrypt-then-mask so the\nlast4 reflects the plaintext, not the ciphertext.","operationId":"get_tenant_settings_endpoint_tenants__slug__settings_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["tenant-sources"],"summary":"Update the tenant's default PipelineSettings template","description":"Validates the body against ``PipelineSettings`` (so the same\nallowlist / type rules that apply to per-user settings apply\nhere). Setting a key to ``null`` removes it from the template.\n\nBody is read raw because ``verify_tenant_hmac`` already consumed\nit for signature verification — re-parsing as JSON here is the\ncanonical pattern used by the ingest routes too.","operationId":"patch_tenant_settings_endpoint_tenants__slug__settings_patch","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study-events":{"post":{"summary":"Ingest Study Events","description":"Append a batch of study events to a daily per-participant JSONL file.\n\n`consent_tier == \"none\"` is accepted but discarded server-side so the\nclient need not special-case it.","operationId":"ingest_study_events_study_events_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventBatch"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"tags":["discovery"],"summary":"API root manifest","description":"Lightweight discovery manifest for agents.\n\nReturns the auth scheme, the bootstrap URL for the device-code\nflow, the OpenAPI spec URL, doc links, and a short catalogue of\nthe most-used operations. An agent that knows just the deployment\nURL can fetch this and figure out how to talk to the API.\n\nSee ADR-055 for the design and `docs/agent-quickstart.md` for the\nLLM-targeted recipe.","operationId":"api_root_manifest__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Api Root Manifest  Get"}}}}}}},"/health":{"get":{"summary":"Health Check","description":"Simple health check endpoint to verify backend is up","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dataset":{"get":{"tags":["datasets"],"summary":"List the signed-in user's datasets","description":"Returns datasets owned by the authenticated caller (NextAuth session or personal API key — see ADR-054). Each row includes id, name, slug, status, created_at.","operationId":"get_all_datasets_dataset_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dataset/{id}":{"get":{"tags":["datasets"],"summary":"Get one dataset by id","description":"Returns the dataset row including its current `status`. Agents poll this after upload until status == 'complete'.","operationId":"get_dataset_dataset__id__get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Dataset","description":"Delete a dataset and all its associated data.\nOnly the dataset owner can delete their dataset.\nEntire operation runs in a single DB transaction.","operationId":"delete_dataset_dataset__id__delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/progress":{"get":{"summary":"Get Dataset Progress","description":"Get processing progress for a dataset from the processing server","operationId":"get_dataset_progress_dataset__id__progress_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/slug/{slug}":{"get":{"summary":"Get Dataset By Slug","operationId":"get_dataset_by_slug_dataset_slug__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/data":{"get":{"summary":"Get Dataset Data","operationId":"get_dataset_data_dataset__id__data_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}},{"name":"addl","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"integer"}},{"type":"null"}],"title":"Addl"}},{"name":"reducer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reducer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/append":{"post":{"summary":"Append Items To Dataset","description":"Append new canonical items to an existing dataset (CSV-backed).\nCanonical item fields include: title, text, date, group, image, link\nExtra metadata fields are preserved and merged into the CSV.","operationId":"append_items_to_dataset_dataset__id__append_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppendItemsBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/slug/{slug}/data":{"get":{"summary":"Get Dataset Data By Slug","operationId":"get_dataset_data_by_slug_dataset_slug__slug__data_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"addl","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"integer"}},{"type":"null"}],"title":"Addl"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/reducer":{"get":{"summary":"Get Dataset Reducer","operationId":"get_dataset_reducer_dataset__id__reducer_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/settings":{"get":{"summary":"Get Dataset Settings","operationId":"get_dataset_settings_dataset__id__settings_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["datasets"],"summary":"Update dataset settings","description":"JSON body merges into `dataset.settings`. Supported keys include `clustering_method` ('kmeans'|'hdbscan'), `topic_mode` ('bottom_up'|'top_down'), `rerun_umap_on_new_files` (bool), and per-source overrides.","operationId":"update_dataset_settings_dataset__id__settings_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/visibility":{"patch":{"tags":["datasets"],"summary":"Toggle dataset public/private visibility","description":"Sets `dataset.public`. Only the dataset owner may change visibility. Body: `{\"public\": true|false}`.","operationId":"update_dataset_visibility_dataset__id__visibility_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisibilityUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/reprocess":{"post":{"tags":["datasets"],"summary":"Re-run the processing pipeline","description":"Triggers re-embedding + re-clustering. Use after settings changes (e.g. switching clustering_method) or when adding items via the live-source flow if you want a full refit instead of an incremental UMAP transform.","operationId":"reprocess_dataset_dataset__id__reprocess_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/cluster-labels":{"get":{"summary":"Get Cluster Labels","description":"Get hierarchical cluster labels for a dataset.\n\nWith ``reducer_id``: returns labels scoped to that variant reducer only.\nWithout it: returns labels scoped to the primary reducer (rows with\nreducer_id IS NULL — the legacy/default scope).","operationId":"get_cluster_labels_dataset__id__cluster_labels_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}},{"name":"method","in":"query","required":false,"schema":{"type":"string","title":"Method"}},{"name":"level","in":"query","required":false,"schema":{"type":"integer","title":"Level"}},{"name":"reducer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reducer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/concepts":{"get":{"summary":"List Concepts","description":"List concept projections for a dataset (oldest first).","operationId":"list_concepts_dataset__id__concepts_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Concept","description":"Create a user-defined concept. Returns 409 on embedding-model mismatch.\n\nThe actual projection job runs asynchronously in the processing server;\nthis endpoint just persists a pending row.","operationId":"create_concept_dataset__id__concepts_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConceptCreateBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/concepts/{concept_id}":{"delete":{"summary":"Delete Concept","description":"Delete a concept and all its variants, reducers, and cluster labels.","operationId":"delete_concept_dataset__id__concepts__concept_id__delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}},{"name":"concept_id","in":"path","required":true,"schema":{"type":"integer","title":"Concept Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/concepts/{concept_id}/variants":{"get":{"summary":"List Concept Variants","description":"List variants `(k, reducer_id)` for a concept, ordered by k ascending.","operationId":"list_concept_variants_dataset__id__concepts__concept_id__variants_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}},{"name":"concept_id","in":"path","required":true,"schema":{"type":"integer","title":"Concept Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/concepts/{concept_id}/progress":{"get":{"summary":"Get Concept Progress","description":"Return the concept's current status, error message (if any), and\ncompleted-variant count. Real-time step updates are streamed over the\nprocessing-server WebSocket; this endpoint is a polling fallback.","operationId":"get_concept_progress_dataset__id__concepts__concept_id__progress_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}},{"name":"concept_id","in":"path","required":true,"schema":{"type":"integer","title":"Concept Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/concepts/{concept_id}/similarities":{"get":{"summary":"Get Concept Similarities","description":"Return the cosine similarity between each object's embedding and the\nconcept's direction vector. Used by the client to color points by\nalignment with the concept axis (analogous to the latent-manipulator\nprototype's \"show direction\" toggle).\n\nResponse: ``[{\"object_id\": int, \"similarity\": float}, ...]``","operationId":"get_concept_similarities_dataset__id__concepts__concept_id__similarities_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}},{"name":"concept_id","in":"path","required":true,"schema":{"type":"integer","title":"Concept Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/object/{object_id}":{"get":{"summary":"Get Object Data","operationId":"get_object_data_object__object_id__get","parameters":[{"name":"object_id","in":"path","required":true,"schema":{"type":"integer","title":"Object Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/object-embeddings":{"get":{"summary":"Get Object Embeddings","operationId":"get_object_embeddings_dataset__id__object_embeddings_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}},{"name":"object_ids","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated object IDs","title":"Object Ids"},"description":"Comma-separated object IDs"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/topics":{"get":{"summary":"Get Dataset Topics","operationId":"get_dataset_topics_dataset__id__topics_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/slug/{slug}/topics":{"get":{"summary":"Get Dataset Topics By Slug","operationId":"get_dataset_topics_by_slug_dataset_slug__slug__topics_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/metadata":{"get":{"summary":"Get Dataset Metadata","operationId":"get_dataset_metadata_dataset__id__metadata_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/slug/{slug}/metadata":{"get":{"summary":"Get Dataset Metadata By Slug","operationId":"get_dataset_metadata_by_slug_dataset_slug__slug__metadata_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{dataset_slug}/generate-thumbnails":{"post":{"summary":"Manually Generate Thumbnails","description":"Manually trigger thumbnail generation for a dataset.","operationId":"manually_generate_thumbnails_dataset__dataset_slug__generate_thumbnails_post","parameters":[{"name":"dataset_slug","in":"path","required":true,"schema":{"type":"string","title":"Dataset Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/summarize":{"post":{"summary":"Summarize Data","operationId":"summarize_data_dataset__id__summarize_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/summarizeBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manipulate/{dataset_id}":{"post":{"summary":"Get Embeddings","operationId":"get_embeddings_manipulate__dataset_id__post","parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"integer","title":"Dataset Id"}},{"name":"word_for_x_axis","in":"query","required":false,"schema":{"type":"string","default":"","title":"Word For X Axis"}},{"name":"word_for_y_axis","in":"query","required":false,"schema":{"type":"string","default":"","title":"Word For Y Axis"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/search":{"get":{"tags":["search"],"summary":"Semantic search in a dataset","description":"Returns the top-k nearest neighbours to the query. The embedding model used is whatever the dataset was created with (recorded in `dataset.settings.embedding_model`).","operationId":"get_search_result_dataset__id__search_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}},{"name":"query","in":"query","required":false,"schema":{"type":"string","default":"","title":"Query"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/keyword-search":{"get":{"summary":"Get Keyword Search Result","operationId":"get_keyword_search_result_dataset__id__keyword_search_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}},{"name":"query","in":"query","required":false,"schema":{"type":"string","default":"","title":"Query"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/generate":{"post":{"summary":"Generate Data","operationId":"generate_data_dataset__id__generate_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/upload/sheet/preview":{"get":{"summary":"Get Sheet Preview","operationId":"get_sheet_preview_upload_sheet_preview_get","parameters":[{"name":"url","in":"query","required":false,"schema":{"type":"string","default":"","title":"Url"}},{"name":"sheet_name","in":"query","required":false,"schema":{"type":"string","default":"","title":"Sheet Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/upload/sheet":{"post":{"tags":["uploads"],"summary":"Upload a CSV / Google Sheet to create a dataset","description":"Multipart form upload. Becomes one Object per row; the pipeline infers field types, generates embeddings, runs topic extraction + clustering. Poll GET /dataset/{id} until status == 'complete' before searching.","operationId":"upload_sheet_upload_sheet_post","parameters":[{"name":"notes","in":"query","required":false,"schema":{"title":"Notes"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CSVUploadBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/infer_columns":{"post":{"summary":"Infer Columns Endpoint","operationId":"infer_columns_endpoint_infer_columns_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_infer_columns_endpoint_infer_columns_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/upload/folder":{"post":{"tags":["uploads"],"summary":"Upload a folder of files to create a dataset","description":"Multipart form upload of multiple files (PDF / DOCX / images / code, depending on OCR_PARSING). Each file becomes one Object.","operationId":"upload_folder_upload_folder_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_folder_upload_folder_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/upload/folder_path":{"post":{"summary":"Upload Folder Path","operationId":"upload_folder_path_upload_folder_path_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_upload_folder_path_upload_folder_path_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/qa-search":{"post":{"summary":"Qa Search","operationId":"qa_search_dataset__id__qa_search_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QASearchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/qa-agent":{"post":{"summary":"Qa Agent","description":"Agentic Q&A over a dataset (ADR-061, docs/spec-agentic-qa.md).\n\nThe model lists/searches/reads the dataset's documents over multiple\nturns before answering. Returns `generated_answer` + `cited_object_ids`\n(mirroring /qa-search so the map-highlight path is unchanged) plus the\ntool trace, token usage, and resolved model id.","operationId":"qa_agent_dataset__id__qa_agent_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QASearchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/timeseries/{dataset_id}":{"get":{"summary":"Timeseries Embedding","operationId":"timeseries_embedding_timeseries__dataset_id__get","parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"integer","title":"Dataset Id"}},{"name":"y_axis","in":"query","required":true,"schema":{"type":"string","title":"Y Axis"}},{"name":"time_window","in":"query","required":false,"schema":{"type":"string","default":"years","title":"Time Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/all-topic-project-ids":{"post":{"summary":"Get All Topics Project Ids","operationId":"get_all_topics_project_ids_dataset_all_topic_project_ids_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopicProjectIdsBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/lapjv":{"post":{"summary":"Get Lapjv","operationId":"get_lapjv_dataset__id__lapjv_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LapJVBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/grid-topic-assignment":{"post":{"summary":"Get Grid Topic Assignment","operationId":"get_grid_topic_assignment_dataset__id__grid_topic_assignment_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopicAssignmentBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/email-to-notion":{"post":{"summary":"Submit","operationId":"submit_email_to_notion_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionData"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/live-folders":{"get":{"summary":"Get Available Live Folders","description":"Get list of available folders from the mounted datasets directory.","operationId":"get_available_live_folders_live_folders_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/create-live-dataset":{"post":{"summary":"Create Live Dataset","description":"Create a live dataset that monitors a local folder for changes.","operationId":"create_live_dataset_create_live_dataset_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLiveDatasetRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/live-source-types":{"get":{"summary":"List Live Source Types","description":"Expose registered URL-source adapters so the UI can populate a picker.","operationId":"list_live_source_types_live_source_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/create-live-url-dataset":{"post":{"tags":["uploads"],"summary":"Create a live URL dataset (today: git source)","description":"Creates a dataset whose objects sync from a remote URL. For source_type='git', the processing server clones source_url at source_ref and reflects upstream changes incrementally. See ADR-052.","operationId":"create_live_url_dataset_create_live_url_dataset_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLiveUrlDatasetRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/source":{"get":{"tags":["uploads"],"summary":"Read a dataset's live URL source configuration","description":"Returns the URL-source metadata for a `data_type=live_folder` dataset (source_type, source_url, source_ref, last_synced_at, last_synced_sha, sync_interval_seconds, has_auth_token, webhook_path). The auth token itself and the webhook secret are never returned — both are write-only. Rotate either by PATCHing or via POST /dataset/{id}/source/rotate-webhook-secret.","operationId":"get_dataset_source_dataset__id__source_get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["uploads"],"summary":"Edit a dataset's live URL source configuration","description":"Mutates the live-source fields stored as top-level columns on `dataset` (which `PATCH /dataset/{id}/settings` does not touch). Accepts any subset of `source_ref`, `sync_interval_seconds`, `auth_token`. Changing `source_ref` enqueues an immediate resync so the working tree reflects the new ref. `auth_token` is encrypted at rest; empty string clears it. `source_type` and `source_url` are immutable — recreate the dataset instead.","operationId":"patch_dataset_source_dataset__id__source_patch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchLiveSourceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/sync-now":{"post":{"tags":["uploads"],"summary":"Force an immediate sync for a live URL dataset","description":"Asks the processing server to run the source adapter's `fetch_changes` on the next main-loop tick (~2s) instead of waiting for the dataset's `sync_interval_seconds`. Best-effort: if the processing server is unreachable, the next periodic poll still picks up changes. Owner-only.","operationId":"force_sync_dataset_dataset__id__sync_now_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{id}/source/rotate-webhook-secret":{"post":{"tags":["uploads"],"summary":"Rotate a dataset's webhook HMAC secret","description":"Mints a fresh `webhook_secret`, persists it, and returns it once. The old secret stops verifying immediately — paste the new value into the source's webhook configuration before the next push. Only valid for adapters whose `LiveSourceSpec.supports_webhooks` is True.","operationId":"rotate_webhook_secret_dataset__id__source_rotate_webhook_secret_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/source/{dataset_id}":{"post":{"summary":"Live Source Webhook","description":"Generic webhook receiver for any URL-sourced dataset.\n\nVerifies an HMAC-SHA256 signature against the dataset's\n`webhook_secret` and pings the processing server to sync now.\nAdapters define their own sender-specific event filtering — the\ngit adapter restricts to GitHub `push` events on the configured\nbranch; other adapters can be more permissive.","operationId":"live_source_webhook_webhooks_source__dataset_id__post","parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"integer","title":"Dataset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/git/{dataset_id}":{"post":{"summary":"Github Webhook Compat","operationId":"github_webhook_compat_webhooks_git__dataset_id__post","parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"integer","title":"Dataset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{dataset_id}/file/{object_id}":{"get":{"summary":"Download Live Folder File","description":"Download a file from a live folder dataset","operationId":"download_live_folder_file_dataset__dataset_id__file__object_id__get","parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"integer","title":"Dataset Id"}},{"name":"object_id","in":"path","required":true,"schema":{"type":"integer","title":"Object Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{dataset_slug}/local-file/{path}":{"get":{"summary":"Serve Local File By Path","description":"Serve local files from live folder datasets by relative path","operationId":"serve_local_file_by_path_dataset__dataset_slug__local_file__path__get","parameters":[{"name":"dataset_slug","in":"path","required":true,"schema":{"type":"string","title":"Dataset Slug"}},{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/processing-status":{"get":{"summary":"Get Processing Status","description":"Get the current status of the parallel dataset processor","operationId":"get_processing_status_processing_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/merge_social_media_files_to_sparse_csv":{"post":{"summary":"Merge Social Media Files To Sparse Csv","operationId":"merge_social_media_files_to_sparse_csv_merge_social_media_files_to_sparse_csv_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_merge_social_media_files_to_sparse_csv_merge_social_media_files_to_sparse_csv_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{dataset_slug}/atlas":{"get":{"summary":"Get Dataset Atlas Data","description":"Get atlas data for a dataset - returns atlas URLs and metadata","operationId":"get_dataset_atlas_data_dataset__dataset_slug__atlas_get","parameters":[{"name":"dataset_slug","in":"path","required":true,"schema":{"type":"string","title":"Dataset Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{dataset_slug}/atlas/{atlas_filename}":{"get":{"summary":"Serve Atlas Image","description":"Serve atlas images through the app server","operationId":"serve_atlas_image_dataset__dataset_slug__atlas__atlas_filename__get","parameters":[{"name":"dataset_slug","in":"path","required":true,"schema":{"type":"string","title":"Dataset Slug"}},{"name":"atlas_filename","in":"path","required":true,"schema":{"type":"string","title":"Atlas Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{dataset_slug}/thumbnail/{thumbnail_filename}":{"get":{"summary":"Serve Thumbnail Image","description":"Serve individual thumbnail images through the app server","operationId":"serve_thumbnail_image_dataset__dataset_slug__thumbnail__thumbnail_filename__get","parameters":[{"name":"dataset_slug","in":"path","required":true,"schema":{"type":"string","title":"Dataset Slug"}},{"name":"thumbnail_filename","in":"path","required":true,"schema":{"type":"string","title":"Thumbnail Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{dataset_id}/content/{object_id}":{"get":{"summary":"Serve Object Content","description":"Serve the original content file for an object (PDF, image, etc.).","operationId":"serve_object_content_dataset__dataset_id__content__object_id__get","parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"integer","title":"Dataset Id"}},{"name":"object_id","in":"path","required":true,"schema":{"type":"integer","title":"Object Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/topic/{topic_id}":{"get":{"summary":"Get Topic Data Endpoint","operationId":"get_topic_data_endpoint_topic__topic_id__get","parameters":[{"name":"topic_id","in":"path","required":true,"schema":{"type":"integer","title":"Topic Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/system-settings":{"get":{"summary":"Get System Settings Endpoint","operationId":"get_system_settings_endpoint_system_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"patch":{"summary":"Update System Settings Endpoint","operationId":"update_system_settings_endpoint_system_settings_patch","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/me/settings":{"get":{"tags":["user-settings"],"summary":"Return effective + per-user pipeline settings","description":"Returns both the user's personal `user_settings` overrides (the values they've explicitly set) AND the merged `effective_settings` they'll see at upload-time. Secret-flagged values (API keys) are truncated to prefix-only — the full credential is never returned over the wire. See ADR-056.","operationId":"get_my_settings_v1_auth_me_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"patch":{"tags":["user-settings"],"summary":"Update the caller's per-user pipeline settings","description":"Validates the body against the canonical `PipelineSettings` schema. Fields explicitly set to `null` are deleted from `user.settings` (so they fall through to system defaults). Omitted fields are left unchanged. Provided non-null values replace the current entry. See ADR-056.","operationId":"patch_my_settings_v1_auth_me_settings_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PipelineSettings"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/embedding-models":{"get":{"summary":"Get Embedding Models Endpoint","description":"Return the curated embedding model registry.\n\nThe registry is the source of truth for which models the UI exposes in\nthe AI Settings modal. Each entry declares its primary provider and\nfallback providers, so the frontend can default the provider dropdown\nbased on what the user already has configured.","operationId":"get_embedding_models_endpoint_embedding_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/ollama/models":{"get":{"summary":"Get Ollama Models","operationId":"get_ollama_models_ollama_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/ollama/pull":{"post":{"summary":"Pull Ollama Model","description":"Pull an Ollama model by name.\n\nAccepts any Ollama-resolvable tag, including HuggingFace GGUF references\nlike ``hf.co/<user>/<repo>``. The request blocks until the pull completes\n(or fails), so clients should use a long timeout.","operationId":"pull_ollama_model_ollama_pull_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/vlm-models/catalog":{"get":{"summary":"Get Vlm Models Catalog","description":"Return the curated VLM (image captioner) catalog plus install state.\n\nMirrors ``/chat-models/catalog``: tells the client which recommended\nVLMs (LLaVA variants, Llama 3.2 Vision, GPT-4o mini, …) exist and which\nOllama tags are already pulled, so the AI Settings modal can offer a\n\"Pull\" button for the un-installed ones.","operationId":"get_vlm_models_catalog_vlm_models_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/chat-models/catalog":{"get":{"summary":"Get Chat Models Catalog","description":"Return the curated chat-model catalog plus installation state.\n\n``installed_ollama_tags`` lists which of the recommended Ollama models\nare currently pulled on the local Ollama server. The UI uses this to\nshow a \"Pull\" button for any recommended model that isn't installed\nyet. The field is empty (and ``ollama_available`` is False) when Ollama\nis unreachable — hosted models still show up either way.","operationId":"get_chat_models_catalog_chat_models_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"ApiKeyListItem":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used 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"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","prefix","last_used_at","expires_at","revoked_at","created_at"],"title":"ApiKeyListItem"},"AppendItemsBody":{"properties":{"items":{"items":{"type":"object"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AppendItemsBody"},"ApproveRequest":{"properties":{"user_code":{"type":"string","maxLength":16,"minLength":4,"title":"User Code"},"api_key_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Api Key Name"},"expires_in_days":{"anyOf":[{"type":"integer","maximum":3650.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Days"}},"type":"object","required":["user_code"],"title":"ApproveRequest"},"ApproveResponse":{"properties":{"device_code_id":{"type":"integer","title":"Device Code Id"},"api_key_id":{"type":"integer","title":"Api Key Id"}},"type":"object","required":["device_code_id","api_key_id"],"title":"ApproveResponse"},"Body_infer_columns_endpoint_infer_columns_post":{"properties":{"columns":{"items":{"type":"string"},"type":"array","title":"Columns"},"rows":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Rows"}},"type":"object","required":["columns","rows"],"title":"Body_infer_columns_endpoint_infer_columns_post"},"Body_merge_social_media_files_to_sparse_csv_merge_social_media_files_to_sparse_csv_post":{"properties":{"slug":{"type":"string","title":"Slug"},"youtube":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Youtube"},"tiktok":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Tiktok"},"netflix":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Netflix"},"max_tiktok_upload":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tiktok Upload","default":2000},"max_youtube_upload":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Youtube Upload"},"max_netflix_upload":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Netflix Upload"}},"type":"object","required":["slug"],"title":"Body_merge_social_media_files_to_sparse_csv_merge_social_media_files_to_sparse_csv_post"},"Body_upload_folder_path_upload_folder_path_post":{"properties":{"folder_path":{"type":"string","title":"Folder Path"},"topics":{"items":{},"type":"array","title":"Topics"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"description":{"type":"string","title":"Description"},"public":{"type":"string","title":"Public"}},"type":"object","required":["folder_path","topics","name","slug","description","public"],"title":"Body_upload_folder_path_upload_folder_path_post"},"Body_upload_folder_upload_folder_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"},"creation_dates":{"items":{"type":"integer"},"type":"array","title":"Creation Dates"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"public":{"type":"boolean","title":"Public"},"settings_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Settings Json"}},"type":"object","required":["files","creation_dates","slug","name","description","public"],"title":"Body_upload_folder_upload_folder_post"},"CSVUploadBody":{"properties":{"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"description":{"type":"string","title":"Description"},"public":{"type":"boolean","title":"Public"},"topics":{"items":{},"type":"array","title":"Topics"},"csv_string":{"type":"string","title":"Csv String"},"field_map":{"type":"object","title":"Field Map"},"settings":{"anyOf":[{"$ref":"#/components/schemas/PipelineSettings"},{"type":"null"}]}},"type":"object","required":["name","slug","description","public","topics","csv_string","field_map"],"title":"CSVUploadBody"},"ChatTurn":{"properties":{"query":{"type":"string","title":"Query"},"answer":{"type":"string","title":"Answer"}},"type":"object","required":["query","answer"],"title":"ChatTurn"},"ConceptCreateBody":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"k_values":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"K Values"}},"type":"object","required":["name","description"],"title":"ConceptCreateBody"},"CreateApiKeyRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"expires_in_days":{"anyOf":[{"type":"integer","maximum":3650.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Days"}},"type":"object","required":["name"],"title":"CreateApiKeyRequest"},"CreateApiKeyResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"key":{"type":"string","title":"Key"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","prefix","key","expires_at","created_at"],"title":"CreateApiKeyResponse"},"CreateLiveDatasetRequest":{"properties":{"folder_name":{"type":"string","title":"Folder Name"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"description":{"type":"string","title":"Description","default":""},"public":{"type":"boolean","title":"Public","default":false}},"type":"object","required":["folder_name","name","slug"],"title":"CreateLiveDatasetRequest"},"CreateLiveUrlDatasetRequest":{"properties":{"name":{"type":"string","title":"Name"},"source_url":{"type":"string","title":"Source Url"},"source_type":{"type":"string","title":"Source Type","default":"git"},"source_ref":{"type":"string","title":"Source Ref","default":"main"},"description":{"type":"string","title":"Description","default":""},"public":{"type":"boolean","title":"Public","default":false},"auth_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Token"},"sync_interval_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sync Interval Seconds"},"settings":{"anyOf":[{"$ref":"#/components/schemas/PipelineSettings"},{"type":"null"}]}},"type":"object","required":["name","source_url"],"title":"CreateLiveUrlDatasetRequest"},"EmailVerificationRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"EmailVerificationRequest"},"EventBatch":{"properties":{"participant_id":{"type":"string","title":"Participant Id"},"dataset_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dataset Id"},"study_mode":{"type":"string","enum":["chat","full"],"title":"Study Mode"},"consent_tier":{"type":"string","enum":["counts","counts_text","none"],"title":"Consent Tier"},"events":{"items":{"$ref":"#/components/schemas/StudyEvent"},"type":"array","maxItems":200,"title":"Events"},"app_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Version"}},"type":"object","required":["participant_id","study_mode","consent_tier","events"],"title":"EventBatch"},"GenerateBody":{"properties":{"prompt":{"type":"string","title":"Prompt"}},"type":"object","required":["prompt"],"title":"GenerateBody"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InfoResponse":{"properties":{"user_code":{"type":"string","title":"User Code"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"requested_at":{"type":"string","format":"date-time","title":"Requested At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"status":{"type":"string","title":"Status"}},"type":"object","required":["user_code","client_name","requested_at","expires_at","status"],"title":"InfoResponse"},"LapJVBody":{"properties":{"curr_positions":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Curr Positions"},"n":{"type":"integer","title":"N"},"old_x_center":{"type":"number","title":"Old X Center"},"old_y_center":{"type":"number","title":"Old Y Center"}},"type":"object","required":["curr_positions","n","old_x_center","old_y_center"],"title":"LapJVBody"},"LoginCredentials":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginCredentials","description":"Schema for login credentials"},"OAuthUserData":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"provider":{"type":"string","title":"Provider"},"provider_account_id":{"type":"string","title":"Provider Account Id"},"provider_profile":{"type":"object","title":"Provider Profile","default":{}},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"}},"type":"object","required":["email","provider","provider_account_id"],"title":"OAuthUserData","description":"OAuth user data for account creation or login"},"PasswordChangeRequest":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["current_password","new_password"],"title":"PasswordChangeRequest"},"PasswordResetComplete":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"token":{"type":"string","title":"Token"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["email","token","new_password"],"title":"PasswordResetComplete"},"PasswordResetRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"PasswordResetRequest"},"PatchLiveSourceRequest":{"properties":{"source_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Ref"},"sync_interval_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sync Interval Seconds"},"auth_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Token"},"sync_paused":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sync Paused"},"exclude_extensions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Exclude Extensions"}},"type":"object","title":"PatchLiveSourceRequest"},"PipelineSettings":{"properties":{"chat_provider":{"anyOf":[{"type":"string","enum":["openai","azure-openai","anthropic","gemini","cohere","ollama"]},{"type":"null"}],"title":"Chat Provider"},"embedding_provider":{"anyOf":[{"type":"string","enum":["openai","azure-openai","gemini","cohere","ollama","huggingface"]},{"type":"null"}],"title":"Embedding Provider"},"vision_provider":{"anyOf":[{"type":"string","enum":["openai","ollama"]},{"type":"null"}],"title":"Vision Provider"},"image_provider":{"anyOf":[{"type":"string","enum":["openai","azure-openai"]},{"type":"null"}],"title":"Image Provider"},"chat_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Model"},"embedding_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Embedding Model"},"vision_embedding_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vision Embedding Model"},"vlm_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vlm Model"},"openai_image_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Openai Image Model"},"azure_openai_image_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Openai Image Model"},"openai_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Openai Api Key","secret":true},"azure_openai_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Openai Api Key","secret":true},"azure_openai_base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Openai Base Url"},"azure_openai_api_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Azure Openai Api Version"},"anthropic_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anthropic Api Key","secret":true},"gemini_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gemini Api Key","secret":true},"cohere_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cohere Api Key","secret":true},"huggingface_api_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Huggingface Api Token","secret":true},"topic_mode":{"anyOf":[{"type":"string","enum":["bottom_up","top_down"]},{"type":"null"}],"title":"Topic Mode"},"clustering_method":{"anyOf":[{"type":"string","enum":["kmeans","hdbscan"]},{"type":"null"}],"title":"Clustering Method"},"hdbscan_min_cluster_size_pct":{"anyOf":[{"type":"number","maximum":0.5,"minimum":0.001},{"type":"null"}],"title":"Hdbscan Min Cluster Size Pct"},"hdbscan_min_samples":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":1.0},{"type":"null"}],"title":"Hdbscan Min Samples"},"cluster_selection_method":{"anyOf":[{"type":"string","enum":["eom","leaf"]},{"type":"null"}],"title":"Cluster Selection Method"},"topdown_sample_size":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":1.0},{"type":"null"}],"title":"Topdown Sample Size"},"include_images":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Images"},"image_embedding_method":{"anyOf":[{"type":"string","enum":["caption","vision"]},{"type":"null"}],"title":"Image Embedding Method"},"context_enriched_captions":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Context Enriched Captions"},"huggingface_endpoint_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Huggingface Endpoint Url"},"clustering_methods":{"anyOf":[{"items":{"type":"string","enum":["kmeans","hdbscan"]},"type":"array"},{"type":"null"}],"title":"Clustering Methods"},"topic_methods":{"anyOf":[{"items":{"type":"string","enum":["bottom_up","top_down"]},"type":"array"},{"type":"null"}],"title":"Topic Methods"},"kmeans_k":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kmeans K"},"topdown_hierarchy_depth":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":1.0},{"type":"null"}],"title":"Topdown Hierarchy Depth"},"topdown_min_subcluster_size":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":2.0},{"type":"null"}],"title":"Topdown Min Subcluster Size"},"concept_seeding_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Concept Seeding Enabled"},"concept_seeding_count":{"anyOf":[{"type":"integer","maximum":500.0,"minimum":1.0},{"type":"null"}],"title":"Concept Seeding Count"},"code_chunking_method":{"anyOf":[{"type":"string","enum":["none","author"]},{"type":"null"}],"title":"Code Chunking Method"},"code_chunking_min_region_lines":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":1.0},{"type":"null"}],"title":"Code Chunking Min Region Lines"},"code_chunking_ignore_whitespace":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Code Chunking Ignore Whitespace"},"exclude_extensions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Exclude Extensions"},"gdrive_export_native":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Gdrive Export Native"}},"additionalProperties":false,"type":"object","title":"PipelineSettings","description":"Per-user / per-call pipeline settings.\n\nAll fields optional — omitted keys fall through to the next\ntier in the resolution chain (request > dataset > user >\ntenant > system > env, per ADR-056).\n\n``extra='forbid'`` means unknown keys raise a 422 on the wire,\nso a typo fails loud rather than silently no-op'ing.\n\nSecret-flagged fields (provider API keys) are accepted on\nwrite and redacted to prefix-only on read by the Phase B\n``GET /v1/auth/me/settings`` handler."},"PollRequest":{"properties":{"device_code":{"type":"string","maxLength":128,"minLength":8,"title":"Device Code"}},"type":"object","required":["device_code"],"title":"PollRequest"},"PollResponse":{"properties":{"status":{"type":"string","title":"Status"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"api_key_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Prefix"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["status"],"title":"PollResponse"},"QASearchRequest":{"properties":{"query":{"type":"string","title":"Query"},"chat_history":{"items":{"$ref":"#/components/schemas/ChatTurn"},"type":"array","title":"Chat History","default":[]}},"type":"object","required":["query"],"title":"QASearchRequest"},"RevokeApiKeyResponse":{"properties":{"id":{"type":"integer","title":"Id"},"revoked_at":{"type":"string","format":"date-time","title":"Revoked At"}},"type":"object","required":["id","revoked_at"],"title":"RevokeApiKeyResponse"},"StartRequest":{"properties":{"client_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Client Name","description":"Optional human label shown on the approval page (e.g. 'Claude Desktop')."}},"type":"object","title":"StartRequest"},"StartResponse":{"properties":{"device_code":{"type":"string","title":"Device Code"},"user_code":{"type":"string","title":"User Code"},"verification_url":{"type":"string","title":"Verification Url"},"expires_in":{"type":"integer","title":"Expires In"},"interval":{"type":"integer","title":"Interval"}},"type":"object","required":["device_code","user_code","verification_url","expires_in","interval"],"title":"StartResponse"},"StudyEvent":{"properties":{"ts":{"type":"string","title":"Ts","description":"ISO-8601 client timestamp"},"name":{"type":"string","maxLength":64,"title":"Name"},"payload":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Payload"}},"type":"object","required":["ts","name"],"title":"StudyEvent"},"SubmissionData":{"properties":{"email":{"type":"string","title":"Email"},"time":{"type":"string","title":"Time"},"timezone":{"type":"string","title":"Timezone"}},"type":"object","required":["email","time","timezone"],"title":"SubmissionData"},"TenantExchangeRequest":{"properties":{"tenant_slug":{"type":"string","title":"Tenant Slug"},"tenant_jwt":{"type":"string","title":"Tenant Jwt"}},"type":"object","required":["tenant_slug","tenant_jwt"],"title":"TenantExchangeRequest"},"TenantExchangeResponse":{"properties":{"jwt":{"type":"string","title":"Jwt"},"user_id":{"type":"integer","title":"User Id"},"email":{"type":"string","title":"Email"}},"type":"object","required":["jwt","user_id","email"],"title":"TenantExchangeResponse"},"TokenVerificationRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"token":{"type":"string","title":"Token"}},"type":"object","required":["email","token"],"title":"TokenVerificationRequest"},"TopicAssignmentBody":{"properties":{"dataset_ids":{"items":{"type":"integer"},"type":"array","title":"Dataset Ids"},"branching_factor":{"type":"integer","title":"Branching Factor"},"leaves_depth":{"type":"integer","title":"Leaves Depth"},"target_dataset_id":{"type":"integer","title":"Target Dataset Id"},"removed_topics":{"items":{"type":"string"},"type":"array","title":"Removed Topics"},"added_topics":{"type":"object","title":"Added Topics"}},"type":"object","required":["dataset_ids","branching_factor","leaves_depth","target_dataset_id","removed_topics","added_topics"],"title":"TopicAssignmentBody"},"TopicProjectIdsBody":{"properties":{"topic_ids":{"items":{"type":"integer"},"type":"array","title":"Topic Ids"}},"type":"object","required":["topic_ids"],"title":"TopicProjectIdsBody"},"UserCreate":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"password":{"type":"string","minLength":8,"title":"Password"}},"type":"object","required":["email","password"],"title":"UserCreate","description":"Schema for creating a new user"},"UserResponse":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"id":{"type":"integer","title":"Id"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image"},"email_verified":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Email Verified"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"is_active":{"type":"boolean","title":"Is Active"},"role":{"type":"string","title":"Role","default":"user"},"tenant_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tenant Id"},"tenant_external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant External Id"},"tenant_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Slug"}},"type":"object","required":["email","id","created_at","is_active"],"title":"UserResponse","description":"Schema for user response"},"UserUpdate":{"properties":{"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"UserUpdate","description":"Schema for updating a user"},"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"},"VisibilityUpdate":{"properties":{"public":{"type":"boolean","title":"Public"}},"type":"object","required":["public"],"title":"VisibilityUpdate"},"summarizeBody":{"properties":{"ids":{"items":{},"type":"array","title":"Ids"}},"type":"object","required":["ids"],"title":"summarizeBody"}}}}