{"openapi":"3.1.0","info":{"title":"DataFlex RAG Chat API","description":"AI-powered chat interface for DataFlex documentation","version":"1.0.0"},"paths":{"/health":{"get":{"summary":"Health Check","description":"Health check endpoint.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/chat":{"post":{"summary":"Chat","description":"Non-streaming chat endpoint.","operationId":"chat_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/stream":{"post":{"summary":"Chat Stream","description":"Streaming chat endpoint using Server-Sent Events.","operationId":"chat_stream_chat_stream_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/{session_id}":{"delete":{"summary":"Clear Session","description":"Clear a conversation session.","operationId":"clear_session_session__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/highlight":{"post":{"summary":"Highlight Code","description":"Syntax highlight code using Pygments.\n\nSupports DataFlex and many other languages.\nReturns HTML with CSS classes for styling.","operationId":"highlight_code_highlight_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HighlightRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HighlightResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/feedback":{"post":{"summary":"Submit Feedback","description":"Submit feedback for a query response (upserts: replaces existing feedback).","operationId":"submit_feedback_feedback_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Feedback","description":"Delete feedback for a query response (undo).","operationId":"delete_feedback_feedback_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackDeleteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/access":{"get":{"summary":"Auth Access","description":"Tell the frontend whether the caller can use AI Chat. Single source of truth\nfor the gate; the frontend uses this to decide whether to show the Ask AI button\nand how to render the chat page itself.","operationId":"auth_access_auth_access_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/{session_id}/consent":{"post":{"summary":"Update Consent","description":"Update consent status for a session.","operationId":"update_consent_session__session_id__consent_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/{session_id}/data":{"delete":{"summary":"Delete Session Data","description":"Delete all analytics data for a session (GDPR right to erasure).","operationId":"delete_session_data_session__session_id__data_delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ChatRequest":{"properties":{"message":{"type":"string","maxLength":5000,"minLength":1,"title":"Message"},"session_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Session Id"},"n_results":{"type":"integer","maximum":30.0,"minimum":1.0,"title":"N Results","default":15},"platform_filter":{"anyOf":[{"$ref":"#/components/schemas/PlatformFilter"},{"type":"null"}]},"content_type_filter":{"anyOf":[{"$ref":"#/components/schemas/ContentTypeFilter"},{"type":"null"}]},"section_type_filter":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Section Type Filter"},"consent":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Consent"}},"type":"object","required":["message"],"title":"ChatRequest","description":"Request model for chat endpoint."},"ConsentRequest":{"properties":{"consent":{"type":"boolean","title":"Consent"}},"type":"object","required":["consent"],"title":"ConsentRequest","description":"Request model for consent endpoint."},"ContentTypeFilter":{"type":"string","enum":["reference","guide","tutorial","manual"],"title":"ContentTypeFilter","description":"Valid content type filter values."},"FeedbackDeleteRequest":{"properties":{"response_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Response Id"},"session_id":{"type":"string","maxLength":100,"minLength":1,"title":"Session Id"}},"type":"object","required":["response_id","session_id"],"title":"FeedbackDeleteRequest","description":"Request model for feedback deletion (undo)."},"FeedbackRequest":{"properties":{"response_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Response Id"},"session_id":{"type":"string","maxLength":100,"minLength":1,"title":"Session Id"},"rating":{"type":"integer","title":"Rating"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","required":["response_id","session_id","rating"],"title":"FeedbackRequest","description":"Request model for feedback endpoint."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HighlightRequest":{"properties":{"code":{"type":"string","maxLength":20000,"minLength":1,"title":"Code"},"language":{"type":"string","maxLength":30,"title":"Language","default":"dataflex"}},"type":"object","required":["code"],"title":"HighlightRequest","description":"Request model for syntax highlighting endpoint."},"HighlightResponse":{"properties":{"html":{"type":"string","title":"Html"},"language":{"type":"string","title":"Language"}},"type":"object","required":["html","language"],"title":"HighlightResponse","description":"Response model for syntax highlighting endpoint."},"PlatformFilter":{"type":"string","enum":["Web","Windows","WebAndWindows"],"title":"PlatformFilter","description":"Valid platform filter values."},"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"}}}}