{"openapi":"3.1.0","info":{"title":"CA Agentic AI RAG","description":"Agentic multi-RAG POC for Chartered Accountant workflows.","version":"0.1.0"},"paths":{"/api/v1/auth/request-otp":{"post":{"summary":"Request Otp","operationId":"request_otp_api_v1_auth_request_otp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OTPRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Request Otp Api V1 Auth Request Otp Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/register-email":{"post":{"summary":"Register Email","operationId":"register_email_api_v1_auth_register_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OTPRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Register Email Api V1 Auth Register Email Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/verify-otp":{"post":{"summary":"Verify Otp","operationId":"verify_otp_api_v1_auth_verify_otp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OTPVerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Verify Otp Api V1 Auth Verify Otp Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/me":{"get":{"summary":"Auth Me","operationId":"auth_me_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Auth Me Api V1 Auth Me Get"}}}}}}},"/api/v1/auth/logout":{"post":{"summary":"Auth Logout","operationId":"auth_logout_api_v1_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Auth Logout Api V1 Auth Logout Post"}}}}}}},"/api/v1/tasks/analyze-text":{"post":{"summary":"Analyze Text","operationId":"analyze_text_api_v1_tasks_analyze_text_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextAnalysisRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tasks/analyze-file":{"post":{"summary":"Analyze File","operationId":"analyze_file_api_v1_tasks_analyze_file_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_analyze_file_api_v1_tasks_analyze_file_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/artifacts/{artifact_id}/download":{"get":{"summary":"Download Artifact","operationId":"download_artifact_api_v1_artifacts__artifact_id__download_get","parameters":[{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string","title":"Artifact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/rag/search":{"get":{"summary":"Rag Search","operationId":"rag_search_api_v1_rag_search_get","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","title":"Query"}},{"name":"collections","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collections"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rag Search Api V1 Rag Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}}},"components":{"schemas":{"Body_analyze_file_api_v1_tasks_analyze_file_post":{"properties":{"query":{"type":"string","title":"Query"},"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"learning_consent":{"type":"boolean","title":"Learning Consent","default":false},"approve_learning":{"type":"boolean","title":"Approve Learning","default":false},"output_formats":{"type":"string","title":"Output Formats","default":""}},"type":"object","required":["query","file"],"title":"Body_analyze_file_api_v1_tasks_analyze_file_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"OTPRequest":{"properties":{"email":{"type":"string","maxLength":254,"minLength":5,"title":"Email"}},"type":"object","required":["email"],"title":"OTPRequest"},"OTPVerifyRequest":{"properties":{"email":{"type":"string","maxLength":254,"minLength":5,"title":"Email"},"otp":{"type":"string","maxLength":12,"minLength":4,"title":"Otp"}},"type":"object","required":["email","otp"],"title":"OTPVerifyRequest"},"TextAnalysisRequest":{"properties":{"query":{"type":"string","minLength":3,"title":"Query","examples":["Analyze this bank statement"]},"text":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"minLength":1,"title":"Text","description":"Document text as one string, or as a list of lines for easier JSON entry.","examples":[["2026-04-03 Cash Deposit 0 150000 400000","2026-04-07 Vendor Payment 85000 0 315000","2026-04-11 Interest Credit 0 3500 318500"]]},"tenant_id":{"type":"string","maxLength":64,"minLength":1,"title":"Tenant Id","description":"Client or engagement identifier used to scope learned RAG notes.","default":"default"},"learning_consent":{"type":"boolean","title":"Learning Consent","description":"Set true only when the client/engagement has opted into RAG learning.","default":false},"approve_learning":{"type":"boolean","title":"Approve Learning","description":"Set true only after CA approval. Approved notes become retrievable RAG context.","default":false},"output_formats":{"items":{"type":"string","enum":["pdf","docx","xlsx"]},"type":"array","title":"Output Formats","description":"Optional response document formats. Formats mentioned in the query are also detected automatically."}},"type":"object","required":["query","text"],"title":"TextAnalysisRequest","examples":[{"approve_learning":false,"learning_consent":true,"query":"Analyze this bank statement","tenant_id":"demo-client","text":["2026-04-03 Cash Deposit 0 150000 400000","2026-04-07 Vendor Payment 85000 0 315000","2026-04-11 Interest Credit 0 3500 318500","2026-04-15 Loan EMI 45000 0 273500","2026-04-20 High Value Receipt 0 250000 523500"]},{"query":"Analyze this GST show cause notice and draft a reply","text":"Show Cause Notice under section 73 of the CGST Act.\nIt is alleged that input tax credit of INR 250000 was wrongly availed."}]},"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"}}}}