{"openapi":"3.1.0","info":{"title":"Purple8 Document Intelligence","description":"Ingest any document format (PDF, DOCX, XLSX, PPTX, images, HTML, email…) and extract a structured knowledge graph ready for Purple8 Graph.","version":"0.12.5"},"paths":{"/lcnc/login":{"get":{"tags":["LCNC Admin Console"],"summary":"Login Page","operationId":"login_page_lcnc_login_get","parameters":[{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["LCNC Admin Console"],"summary":"Login Submit","operationId":"login_submit_lcnc_login_post","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_submit_lcnc_login_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lcnc/logout":{"get":{"tags":["LCNC Admin Console"],"summary":"Logout","operationId":"logout_lcnc_logout_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/lcnc/":{"get":{"tags":["LCNC Admin Console"],"summary":"Dashboard","operationId":"dashboard_lcnc__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/lcnc/jobs":{"get":{"tags":["LCNC Admin Console"],"summary":"Jobs Page","operationId":"jobs_page_lcnc_jobs_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/lcnc/jobs/_fragment":{"get":{"tags":["LCNC Admin Console"],"summary":"Jobs Fragment","description":"HTMX fragment — job rows only, polled every 5 s.","operationId":"jobs_fragment_lcnc_jobs__fragment_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/lcnc/jobs/{job_id}":{"delete":{"tags":["LCNC Admin Console"],"summary":"Delete Job","operationId":"delete_job_lcnc_jobs__job_id__delete","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lcnc/upload":{"get":{"tags":["LCNC Admin Console"],"summary":"Upload Page","operationId":"upload_page_lcnc_upload_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/lcnc/upload/submit":{"post":{"tags":["LCNC Admin Console"],"summary":"Upload Submit","operationId":"upload_submit_lcnc_upload_submit_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_submit_lcnc_upload_submit_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lcnc/history":{"get":{"tags":["LCNC Admin Console"],"summary":"History Page","operationId":"history_page_lcnc_history_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string","default":"","title":"Search"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lcnc/connectors":{"get":{"tags":["LCNC Admin Console"],"summary":"Connectors Page","operationId":"connectors_page_lcnc_connectors_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/lcnc/connectors/trigger/{connector}":{"post":{"tags":["LCNC Admin Console"],"summary":"Connector Trigger","operationId":"connector_trigger_lcnc_connectors_trigger__connector__post","parameters":[{"name":"connector","in":"path","required":true,"schema":{"type":"string","title":"Connector"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lcnc/settings":{"get":{"tags":["LCNC Admin Console"],"summary":"Settings Page","operationId":"settings_page_lcnc_settings_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/lcnc/settings/llm":{"post":{"tags":["LCNC Admin Console"],"summary":"Save Llm Settings","description":"Save DocIntel LLM provider settings into the running process environment.","operationId":"save_llm_settings_lcnc_settings_llm_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_save_llm_settings_lcnc_settings_llm_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lcnc/settings/aps":{"post":{"tags":["LCNC Admin Console"],"summary":"Save Aps Settings","description":"Save Autodesk Platform Services credentials for Revit / Navisworks ingestion.\n\nCredentials are BYOK — they map to the customer's Autodesk account.\nWritten to the running process environment so the APSParser can pick them\nup immediately without a restart.  Persist to .env / Docker for durability.","operationId":"save_aps_settings_lcnc_settings_aps_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_save_aps_settings_lcnc_settings_aps_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp":{"post":{"tags":["MCP"],"summary":"Model Context Protocol (Streamable HTTP)","operationId":"mcp_post_mcp_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/.well-known/agent-card.json":{"get":{"tags":["A2A"],"summary":"A2A Agent Card","operationId":"agent_card__well_known_agent_card_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/mcp.json":{"get":{"tags":["A2A"],"summary":"MCP Server Discovery Card","operationId":"mcp_discovery_card__well_known_mcp_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/a2a":{"post":{"tags":["A2A"],"summary":"A2A JSON-RPC endpoint","operationId":"a2a_jsonrpc_a2a_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/workspace/auth/{provider}/start":{"get":{"summary":"Oauth Start","operationId":"oauth_start_workspace_auth__provider__start_get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"view","in":"query","required":false,"schema":{"enum":["playground","connections","api","billing","account"],"type":"string","default":"playground","title":"View"}},{"name":"theme","in":"query","required":false,"schema":{"anyOf":[{"enum":["day","night"],"type":"string"},{"type":"null"}],"title":"Theme"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspace/auth/{provider}/callback":{"get":{"summary":"Oauth Callback","operationId":"oauth_callback_workspace_auth__provider__callback_get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Oauth Callback","operationId":"oauth_callback_workspace_auth__provider__callback_get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspace/{path}":{"get":{"summary":"Workspace Api","operationId":"workspace_api_workspace__path__get","parameters":[{"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"}}}}}},"post":{"summary":"Workspace Api","operationId":"workspace_api_workspace__path__get","parameters":[{"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"}}}}}}},"/process":{"post":{"tags":["Processing"],"summary":"Upload and process a document","description":"Upload a file for async document intelligence processing.\n\nAccepted formats: PDF, DOCX, DOC, XLSX, XLS, PPTX, PPT,\nPNG, JPG, JPEG, TIFF, BMP, WEBP, HTML, TXT, MD, RST, CSV,\nTSV, JSON, XML, EML, MSG, RTF, ODT, ODS, ODP, EPUB.\n\nReturns a ``job_id`` immediately.  Poll ``GET /jobs/{job_id}``\nfor status and results.","operationId":"process_file_process_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"graph_base_url","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Override Purple8 Graph endpoint","title":"Graph Base Url"},"description":"Override Purple8 Graph endpoint"},{"name":"graph_api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Override Purple8 Graph API key","title":"Graph Api Key"},"description":"Override Purple8 Graph API key"},{"name":"auto_commit","in":"query","required":false,"schema":{"type":"boolean","description":"Auto-commit to graph (false = preview only)","default":true,"title":"Auto Commit"},"description":"Auto-commit to graph (false = preview only)"},{"name":"source_app","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Upstream app id, e.g. 'p8-ai-architect'","title":"Source App"},"description":"Upstream app id, e.g. 'p8-ai-architect'"},{"name":"profile_hint","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Force an extraction profile, e.g. 'aec'","title":"Profile Hint"},"description":"Force an extraction profile, e.g. 'aec'"},{"name":"browser_ner","in":"query","required":false,"schema":{"type":"boolean","description":"Turbo mode: find entities in the caller's browser (POST /jobs/{id}/entities). Falls back to the server if nothing arrives in time.","default":false,"title":"Browser Ner"},"description":"Turbo mode: find entities in the caller's browser (POST /jobs/{id}/entities). Falls back to the server if nothing arrives in time."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_process_file_process_post"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Process File Process Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/process/url":{"post":{"tags":["Processing"],"summary":"Submit a URL for processing","description":"Download and process a document from a URL.\n\nRequest body (JSON):\n```json\n{\n  \"url\": \"https://example.com/report.pdf\",\n  \"graph_base_url\": \"http://purple8-graph:8100\",\n  \"graph_api_key\": \"...\",\n  \"auto_commit\": true,\n  \"source_app\": \"p8-ai-architect\",\n  \"profile_hint\": \"aec\"\n}\n```","operationId":"process_url_process_url_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Process Url Process Url Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/jobs":{"get":{"tags":["Jobs"],"summary":"List all processing jobs","description":"List jobs with optional status filter and pagination.","operationId":"list_jobs_jobs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/JobStatus"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Jobs Jobs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}":{"get":{"tags":["Jobs"],"summary":"Get job status and result","description":"Return the full job record including extraction result when done.\n\nIf this replica did not run the job, the status is read from the\n``DocIntelJob`` node in Purple8 Graph (status only; no result payload).","operationId":"get_job_status_jobs__job_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Job Status Jobs  Job Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Jobs"],"summary":"Remove a job record","description":"Remove a completed or failed job from the in-memory store.","operationId":"delete_job_jobs__job_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/markdown":{"get":{"tags":["Jobs"],"summary":"Get the full document as Markdown","description":"Return the whole document as Markdown (headings, pages, tables).\n\nReady for embeddings, chatbots and RAG. Same visibility rules as\n``GET /jobs/{job_id}``. 409 while the job is still running; 410 once a\nsandbox session has ended and the content has been deleted.","operationId":"get_job_markdown_jobs__job_id__markdown_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/markdown":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/emit":{"post":{"tags":["Jobs"],"summary":"Retry sending a job's result to Purple8 Graph","description":"Re-send the exact payload of a job whose graph commit failed.\n\nOnly valid for jobs in ``emit_failed``. The graph commit is\nall-or-nothing with deterministic IDs, so re-sending is always safe. The\ntarget is the graph the job was originally sent to (never caller-supplied\n— no SSRF). Pass ``X-Graph-API-Key`` if the job used a per-request key;\notherwise the server's configured graph key is used.\n\nReturns the updated job on success; 502 with the failure reason otherwise.","operationId":"retry_job_emit_jobs__job_id__emit_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-Graph-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Graph-Api-Key"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ExtractionReview"},{"type":"null"}],"title":"Review"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Retry Job Emit Jobs  Job Id  Emit Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/send-to-graph":{"post":{"tags":["Jobs"],"summary":"Send a sandbox result to your Hyper Graph sandbox","description":"Move this result's DATA into the customer's Hyper Graph project.\n\nKeys stay product-specific: Command Center resolves the caller's DocIntel\nsandbox key to their Customer record and returns their Hyper Graph\nproject(s) — endpoint + Graph key (issuing one if they have none). The\nresult is committed with the Graph key. A DocIntel key never reaches Graph.\nSeveral projects → the response lists them (``choose``) and the UI re-posts\nwith ``project_id``. Explicit, per-result consent; the only target host is\n``GRAPH__SANDBOX_URL`` (no SSRF). Safe to repeat (deterministic ids).","operationId":"send_job_to_graph_sandbox_jobs__job_id__send_to_graph_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SendToGraphRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Send Job To Graph Sandbox Jobs  Job Id  Send To Graph Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/entities":{"post":{"tags":["Jobs"],"summary":"Turbo mode: send entities found in the browser","description":"Deliver entities for a job in ``awaiting_entities``.\n\nBody: ``{\"windows\": [{\"chunk_id\": \"...\", \"entities\": [{\"text\", \"label\",\n\"score\"}]}]}`` — one entry per window from ``browser_ner_task``. Spans are\nchecked against the document: the label must be one that was requested\nand the text must occur in that window; anything else is dropped.\n\n409 if the job is not waiting (already finished, or the server already\nfound the entities itself after the wait expired).","operationId":"submit_browser_entities_jobs__job_id__entities_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Submit Browser Entities Jobs  Job Id  Entities Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/stream":{"get":{"tags":["Jobs"],"summary":"Stream partial extraction results via Server-Sent Events","description":"Open a Server-Sent Events (SSE) stream for a job.\n\nLogic Flow:\n    1. Validate the job exists.\n    2. If the job is already DONE or FAILED, emit the final result immediately\n       and close the stream.\n    3. Otherwise register a queue in ``_SSE_QUEUES`` and yield events as\n       they arrive.  Each event is a JSON-encoded partial ``ExtractionResult``\n       or job status update.\n    4. Send a ``data: [DONE]`` sentinel when the job finishes, matching the\n       OpenAI streaming convention so clients can use the same parser.\n\nEvent format::\n\n    data: {\"job_id\": \"...\", \"status\": \"processing\", \"entities\": [...]}\n\n    data: [DONE]\n\nRequires ``sse-starlette`` — install via ``pip install purple8-docintel[streaming]``.","operationId":"stream_job_jobs__job_id__stream_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Stream Job Jobs  Job Id  Stream Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/connectors/webhook":{"post":{"tags":["Connectors"],"summary":"Generic document webhook receiver","description":"Receive a generic Purple8 DocIntel webhook payload.\n\nPayload schema:\n```json\n{ \"source_name\": \"report.pdf\", \"download_url\": \"https://...\", \"metadata\": {} }\n```\nOr provide ``content_base64`` for inline document bytes.","operationId":"webhook_generic_connectors_webhook_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"auto_commit","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Auto Commit"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Webhook Generic Connectors Webhook Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/connectors/webhook/confluence":{"post":{"tags":["Connectors"],"summary":"Confluence publish webhook","description":"Receive a Confluence page_created / page_updated webhook.\n\nConfigure in Confluence: Space Settings → Webhooks → URL = this endpoint.\n\nPass credentials as HTTP headers (NOT query params) to keep them out of logs:\n  X-Confluence-Base-Url: https://yourcompany.atlassian.net/wiki\n  X-Confluence-Username: you@yourcompany.com\n  X-Confluence-Api-Token: <your-api-token>\n\nOptionally set the ``WEBHOOK__CONFLUENCE_SECRET`` env var to the shared\nsecret configured in Confluence.  When set, the ``X-Hub-Signature-256``\nheader on every inbound request is verified using HMAC-SHA256.  Requests\nwith a missing or invalid signature are rejected with HTTP 401.","operationId":"webhook_confluence_connectors_webhook_confluence_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"auto_commit","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Auto Commit"}},{"name":"x-confluence-base-url","in":"header","required":true,"schema":{"type":"string","description":"Your Confluence base URL","title":"X-Confluence-Base-Url"},"description":"Your Confluence base URL"},{"name":"x-confluence-username","in":"header","required":true,"schema":{"type":"string","description":"Confluence username / email","title":"X-Confluence-Username"},"description":"Confluence username / email"},{"name":"x-confluence-api-token","in":"header","required":true,"schema":{"type":"string","description":"Confluence API token","title":"X-Confluence-Api-Token"},"description":"Confluence API token"}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Webhook Confluence Connectors Webhook Confluence Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/connectors/webhook/sharepoint":{"post":{"tags":["Connectors"],"summary":"SharePoint change notification webhook","description":"Receive a Microsoft Graph change notification for SharePoint.\n\nSharePoint first sends a GET validation request with a ``validationToken``\nquery parameter — this endpoint echoes it back as required.\n\nFor actual change notifications, pass Azure AD credentials as headers so\nDocIntel can resolve the Graph API download URL immediately:\n  X-Sharepoint-Tenant-Id: <tenant-id>\n  X-Sharepoint-Client-Id: <client-id>\n  X-Sharepoint-Client-Secret: <client-secret>\n  X-Sharepoint-Site-Url: <https://tenant.sharepoint.com/sites/name>","operationId":"webhook_sharepoint_connectors_webhook_sharepoint_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"auto_commit","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Auto Commit"}},{"name":"x-sharepoint-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Azure AD tenant ID","title":"X-Sharepoint-Tenant-Id"},"description":"Azure AD tenant ID"},{"name":"x-sharepoint-client-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Azure AD app client ID","title":"X-Sharepoint-Client-Id"},"description":"Azure AD app client ID"},{"name":"x-sharepoint-client-secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Azure AD app client secret","title":"X-Sharepoint-Client-Secret"},"description":"Azure AD app client secret"},{"name":"x-sharepoint-site-url","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"SharePoint site URL","title":"X-Sharepoint-Site-Url"},"description":"SharePoint site URL"}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Webhook Sharepoint Connectors Webhook Sharepoint Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/connectors/sync/sharepoint":{"post":{"tags":["Connectors"],"summary":"Trigger a full SharePoint library pull","description":"Pull all documents from a SharePoint document library and process each one.\n\nRequest body (JSON):\n```json\n{\n  \"tenant_id\": \"...\",\n  \"client_id\": \"...\",\n  \"client_secret\": \"...\",\n  \"site_url\": \"https://tenant.sharepoint.com/sites/name\",\n  \"library_name\": \"Documents\",\n  \"recursive\": true\n}\n```\nReturns a list of job IDs — one per document found.","operationId":"sync_sharepoint_connectors_sync_sharepoint_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"auto_commit","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Auto Commit"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Sync Sharepoint Connectors Sync Sharepoint Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/connectors/sync/confluence":{"post":{"tags":["Connectors"],"summary":"Trigger a full Confluence space pull","description":"Pull all pages (and optionally attachments) from one or more Confluence spaces.\n\nRequest body (JSON):\n```json\n{\n  \"base_url\": \"https://yourcompany.atlassian.net/wiki\",\n  \"username\": \"you@example.com\",\n  \"api_token\": \"...\",\n  \"space_keys\": [\"ENG\", \"PRODUCT\"],\n  \"include_attachments\": true\n}\n```","operationId":"sync_confluence_connectors_sync_confluence_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"auto_commit","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Auto Commit"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Sync Confluence Connectors Sync Confluence Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/connectors/sync/s3":{"post":{"tags":["Connectors"],"summary":"Trigger a full S3 bucket pull","description":"Pull all objects from an S3 bucket (filtered by prefix) and process each one.\n\nRequest body (JSON):\n```json\n{\n  \"bucket\": \"my-docs-bucket\",\n  \"prefix\": \"reports/2026/\",\n  \"region\": \"us-east-1\",\n  \"aws_access_key_id\": \"...\",\n  \"aws_secret_access_key\": \"...\"\n}\n```\nOmit ``aws_access_key_id`` / ``aws_secret_access_key`` to use the instance\nIAM role or environment credentials.","operationId":"sync_s3_connectors_sync_s3_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"auto_commit","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Auto Commit"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Sync S3 Connectors Sync S3 Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/history":{"get":{"tags":["History"],"summary":"List processed document history","description":"Return a paginated list of all documents ever processed by this service,\nstored as DocIntelRecord nodes in Purple8 Graph.\n\n**Date filtering:** ``processed_after`` and ``processed_before`` accept\nISO 8601 strings (e.g. ``2026-01-01T00:00:00Z``) and are applied\nclient-side against the ``processed_at`` property of each node.\n\nRequires GRAPH__BASE_URL and GRAPH__API_KEY to be configured.\nReturns an empty list gracefully if Graph is not connected — the\n``X-History-Source`` header will be ``not_configured`` or\n``graph_unreachable`` so lightweight callers (curl, health-checkers) can\ndetect the condition without deserialising the body.\n\n**Filtering accuracy note:** ``search``, ``processed_after``, and\n``processed_before`` are applied client-side against the page returned by\nGraph (bounded by ``limit``/``offset``). Results are best-effort over the\nrequested page window. Server-side filtering requires Purple8 Graph ≥ v1.4.","operationId":"get_history_history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"processed_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processed After"}},{"name":"processed_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processed Before"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get History History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/formats":{"get":{"tags":["Info"],"summary":"List supported document formats","description":"Return all document formats this service can parse.","operationId":"list_formats_formats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Formats Formats Get"}}}}}}},"/health":{"get":{"tags":["Info"],"summary":"Liveness probe","description":"Returns 200 OK if the process is alive.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/license":{"get":{"tags":["Info"],"summary":"License status","description":"Return the current license status and quota usage.","operationId":"license_status_license_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response License Status License Get"}}}}}}},"/ready":{"get":{"tags":["Info"],"summary":"Readiness probe","description":"Returns 200 if the service is ready to accept requests.\nChecks: LLM reachability (if API key configured) and Purple8 Graph (if configured).","operationId":"ready_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Ready Ready Get"}}}}}}}},"components":{"schemas":{"Body_login_submit_lcnc_login_post":{"properties":{"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["api_key"],"title":"Body_login_submit_lcnc_login_post"},"Body_process_file_process_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_process_file_process_post"},"Body_save_aps_settings_lcnc_settings_aps_post":{"properties":{"aps_client_id":{"type":"string","title":"Aps Client Id","default":""},"aps_client_secret":{"type":"string","title":"Aps Client Secret","default":""},"aps_region":{"type":"string","title":"Aps Region","default":"US"},"aps_bucket":{"type":"string","title":"Aps Bucket","default":"purple8-docintel"},"aps_poll_interval_s":{"type":"integer","title":"Aps Poll Interval S","default":5},"aps_poll_timeout_s":{"type":"integer","title":"Aps Poll Timeout S","default":300}},"type":"object","title":"Body_save_aps_settings_lcnc_settings_aps_post"},"Body_save_llm_settings_lcnc_settings_llm_post":{"properties":{"llm_provider":{"type":"string","title":"Llm Provider","default":"openai"},"llm_api_key":{"type":"string","title":"Llm Api Key","default":""},"llm_base_url":{"type":"string","title":"Llm Base Url","default":""},"llm_concurrency":{"type":"integer","title":"Llm Concurrency","default":8}},"type":"object","title":"Body_save_llm_settings_lcnc_settings_llm_post"},"Body_upload_submit_lcnc_upload_submit_post":{"properties":{"profile_hint":{"type":"string","title":"Profile Hint","default":"general"},"auto_commit":{"type":"string","title":"Auto Commit","default":"false"},"source_url":{"type":"string","title":"Source Url","default":""},"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File"}},"type":"object","title":"Body_upload_submit_lcnc_upload_submit_post"},"ExtractedEntity":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"name":{"type":"string","title":"Name"},"properties":{"additionalProperties":true,"type":"object","title":"Properties"},"source_chunk_ids":{"items":{"type":"string"},"type":"array","title":"Source Chunk Ids"},"confidence":{"type":"number","title":"Confidence","default":1.0},"include":{"type":"boolean","title":"Include","default":true},"identity":{"additionalProperties":{"type":"string"},"type":"object","title":"Identity"},"identity_resolution":{"type":"string","enum":["check","link_existing"],"title":"Identity Resolution","default":"check"},"spans":{"items":{"prefixItems":[{"type":"integer"},{"type":"integer"}],"type":"array","maxItems":2,"minItems":2},"type":"array","title":"Spans"}},"type":"object","required":["id","type","name"],"title":"ExtractedEntity","description":"A single entity extracted by the LLM or NER model."},"ExtractedRelationship":{"properties":{"source":{"type":"string","title":"Source"},"target":{"type":"string","title":"Target"},"type":{"type":"string","title":"Type"},"properties":{"additionalProperties":true,"type":"object","title":"Properties"},"source_chunk_ids":{"items":{"type":"string"},"type":"array","title":"Source Chunk Ids"},"confidence":{"type":"number","title":"Confidence","default":1.0},"include":{"type":"boolean","title":"Include","default":true}},"type":"object","required":["source","target","type"],"title":"ExtractedRelationship","description":"A directed relationship between two extracted entities."},"ExtractionReview":{"properties":{"entities":{"items":{"$ref":"#/components/schemas/ExtractedEntity"},"type":"array","title":"Entities"},"relationships":{"items":{"$ref":"#/components/schemas/ExtractedRelationship"},"type":"array","title":"Relationships"}},"additionalProperties":false,"type":"object","required":["entities","relationships"],"title":"ExtractionReview","description":"An explicit correction overlay; original extraction and source stay unchanged."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JobStatus":{"type":"string","enum":["queued","parsing","extracting","awaiting_entities","emitting","done","failed","cancelled","emit_failed"],"title":"JobStatus","description":"Lifecycle state of an async processing job."},"SendToGraphRequest":{"properties":{"project_id":{"type":"string","maxLength":120,"title":"Project Id","default":""},"review":{"anyOf":[{"$ref":"#/components/schemas/ExtractionReview"},{"type":"null"}]}},"type":"object","title":"SendToGraphRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}