From 41836cc443d1698bc075db297caf737646669fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Traf=C3=AD=20Ruiz?= <47148479+miqueltrafi@users.noreply.github.com> Date: Tue, 16 Sep 2025 21:20:16 +0200 Subject: [PATCH] Update openapi.json --- api-reference/openapi.json | 2110 +++++++++++++++++++++++++++++++++++- 1 file changed, 2109 insertions(+), 1 deletion(-) diff --git a/api-reference/openapi.json b/api-reference/openapi.json index ab4003d..b6b5a90 100644 --- a/api-reference/openapi.json +++ b/api-reference/openapi.json @@ -1 +1,2109 @@ -{"openapi":"3.1.0","info":{"title":"Captide REST API","description":"API for accessing financial disclosures and AI-powered financial document analysis.","version":"1.1.0"},"servers":[{"url":"https://rest-api.captide.co","description":"Production server"}],"paths":{"/api/v1/companies/list":{"get":{"tags":["Companies"],"summary":"List companies","description":"Retrieves a list of companies from the Captide database that match user-specified parameters. The response includes key company information such as name, ticker symbol(s) with exchange suffixes, country of domicile, SEC filing status, and the unique company ID assigned by Captide.","operationId":"list_companies_api_v1_companies_list_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"tickers","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of company tickers (supports both base tickers like 'ITX' and suffixed tickers like 'ITX.MC')","title":"Tickers"},"description":"Comma-separated list of company tickers (supports both base tickers like 'ITX' and suffixed tickers like 'ITX.MC')","example":"STO.AX,ASML.AS"},{"name":"countries","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of companies' country of domicile (ISO 3166-1 alpha-2)","title":"Countries"},"description":"Comma-separated list of companies' country of domicile (ISO 3166-1 alpha-2)","example":"AU,NL"},{"name":"filesWithSec","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether the companies file reports with the SEC","title":"Fileswithsec"},"description":"Whether the companies file reports with the SEC","example":false},{"name":"ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of unique company IDs","title":"Ids"},"description":"Comma-separated list of unique company IDs","example":"77848abe-a215-41b7-8950-86e89ea1fadc,91f6c6da-478f-4161-b451-aa5177cc7fb9"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Maximum number of records to return. Required range: 1 <= x <= 1000","default":100,"title":"Limit"},"description":"Maximum number of records to return. Required range: 1 <= x <= 1000","example":100}],"responses":{"200":{"description":"Successful list results","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompanyListResponse"},"title":"Response List Companies Api V1 Companies List Get"},"example":[{"id":"77848abe-a215-41b7-8950-86e89ea1fadc","name":"Santos","tickers":["STO.AX"],"countries":["AU"],"filesWithSec":false}]}}},"400":{"description":"Invalid filter parameters"},"401":{"description":"Invalid or missing API key"},"500":{"description":"Internal server error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/companies/{id}":{"get":{"tags":["Companies"],"summary":"Get company by ID","description":"Retrieves a single company from the Captide database by its unique ID. The response includes key company information such as name, ticker symbol(s) with exchange suffixes, country of domicile, and SEC filing status.","operationId":"get_company_api_v1_companies__id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}}],"responses":{"200":{"description":"Successful company retrieval","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyListResponse"},"example":{"id":"77848abe-a215-41b7-8950-86e89ea1fadc","name":"Santos","tickers":["STO.AX"],"countries":["AU"],"filesWithSec":false}}}},"404":{"description":"Company not found"},"401":{"description":"Invalid or missing API key"},"500":{"description":"Internal server error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/list":{"get":{"tags":["Documents"],"summary":"List documents","description":"Retrieves a list of financial and corporate disclosures available in Captide that match user-specified parameters. The response includes key document metadata such as the associated company's ticker symbol(s), document type, release date, fiscal year and quarter, the Captide-assigned document ID, and the associated company ID.","operationId":"list_documents_api_v1_documents_list_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"tickers","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of tickers of the companies filing the documents (supports both base tickers like 'ITX' and suffixed tickers like 'ITX.MC')","title":"Tickers"},"description":"Comma-separated list of tickers of the companies filing the documents (supports both base tickers like 'ITX' and suffixed tickers like 'ITX.MC')","example":"STO.AX,ASML.AS"},{"name":"documentCategories","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of document categories. Supported categories are: annual-report, interim-report, supplemental-financial-information, earnings-release, current-report, shareholder-meetings-notice, earnings-call-transcript, earnings-call-slides, special-events-slides, sustainability-report, initial-registration-statement. For detailed descriptions, please refer to [this page](/coverage)","title":"Documentcategories"},"description":"Comma-separated list of document categories. Supported categories are: annual-report, interim-report, supplemental-financial-information, earnings-release, current-report, shareholder-meetings-notice, earnings-call-transcript, earnings-call-slides, special-events-slides, sustainability-report, initial-registration-statement. For detailed descriptions, please refer to [this page](/coverage)","example":"annual-report,interim-report"},{"name":"formTypes","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of SEC form types to retrieve. Supported form types are: 10-K, 10-Q, 8-K, 20-F, 40-F, 6-K, DEF14A, DEFM14A, DEF14C, DEFM14C, S-1, F-1. This parameter is only applicable to companies that file with the SEC. To check if a company files with the SEC, use the filesWithSec field from the /api/v1/companies/list endpoint","title":"Formtypes"},"description":"Comma-separated list of SEC form types to retrieve. Supported form types are: 10-K, 10-Q, 8-K, 20-F, 40-F, 6-K, DEF14A, DEFM14A, DEF14C, DEFM14C, S-1, F-1. This parameter is only applicable to companies that file with the SEC. To check if a company files with the SEC, use the filesWithSec field from the /api/v1/companies/list endpoint","example":"10-K,10-Q"},{"name":"startDate","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date for filtering documents (ISO 8601 format)","title":"Startdate"},"description":"Start date for filtering documents (ISO 8601 format)","example":"2025-01-01"},{"name":"endDate","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date for filtering documents (ISO 8601 format)","title":"Enddate"},"description":"End date for filtering documents (ISO 8601 format)","example":"2025-12-31"},{"name":"companyIds","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of unique IDs of the companies filing the documents. Use /api/v1/companies/list to find the company ID","title":"Companyids"},"description":"Comma-separated list of unique IDs of the companies filing the documents. Use /api/v1/companies/list to find the company ID","example":"77848abe-a215-41b7-8950-86e89ea1fadc,91f6c6da-478f-4161-b451-aa5177cc7fb9"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Maximum number of records to return. Required range: 1 <= x <= 1000","default":100,"title":"Limit"},"description":"Maximum number of records to return. Required range: 1 <= x <= 1000","example":100}],"responses":{"200":{"description":"Document list retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentListResponse"},"title":"Response List Documents Api V1 Documents List Get"},"example":[{"id":"98381fbb-8d8c-4b47-b31c-819f8aca0690","documentCategory":"interim-report","tickers":["STO.AX"],"companyName":"Santos","date":"2025-04-17","fiscalQuarter":1,"fiscalYear":2025,"title":"First Quarter Report for period ending 31 March 2025","description":"This document is the First Quarter Report of Santos Limited for the period ending 31 March 2025. It provides a detailed overview of the company's operational and financial performance, including production volumes, sales, revenue, capital expenditure, project updates, and guidance for 2025."}]}}},"400":{"description":"Invalid filter parameters"},"401":{"description":"Invalid or missing API key"},"500":{"description":"Internal server error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/{id}":{"get":{"tags":["Documents"],"summary":"Get document by ID","description":"Fetch a document by its ID from the database, including company and ticker info.\n \n This endpoint returns complete document details including metadata, file URLs,\n and associated company information.","operationId":"get_document_by_id_api_v1_documents__id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Document ID","title":"Id"},"description":"Document ID","example":"123e4567-e89b-12d3-a456-426614174000"}],"responses":{"200":{"description":"Document found successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"},"example":{"id":"98381fbb-8d8c-4b47-b31c-819f8aca0690","documentCategory":"interim-report","tickers":["STO.AX"],"companyName":"Santos","date":"2025-04-17","fiscalQuarter":1,"fiscalYear":2025,"title":"First Quarter Report for period ending 31 March 2025","description":"This document is the First Quarter Report of Santos Limited for the period ending 31 March 2025. It provides a detailed overview of the company's operational and financial performance, including production volumes, sales, revenue, capital expenditure, project updates, and guidance for 2025.","originalFileUrl":"https://files.captide.co/original-docs/77848abe-a215-41b7-8950-86e89ea1fadc/2025-Santos-First-Quarter-Report.pdf?se=2025-07-28T17%3A33%3A51Z&sp=r&sv=2025-07-05&sr=b&sig=B6JuHmW4Yoif5tMJItatav/Vwe9IzOoqSaHs%2BZEwbDk%3D","markdownFileUrl":"https://files.captide.co/markdown-docs/77848abe-a215-41b7-8950-86e89ea1fadc/2025-Santos-First-Quarter-Report.md?se=2025-07-28T17%3A33%3A51Z&sp=r&sv=2025-07-05&sr=b&sig=umdy9HFMwQykzafdb62ZQAXF/4OXJHKM9Py0dfd2wuA%3D"}}}},"404":{"description":"Document not found"},"401":{"description":"Invalid or missing API key"},"500":{"description":"Internal server error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/rag/chunks":{"post":{"tags":["Retrieval Augmented Generation"],"summary":"Search document chunks","description":"Search for relevant document chunks based on a query. Under the hood, Captide's RAG system uses a combination of LLMs and vector databases to find the most relevant chunks of text from corporate disclosures that are most relevant to the query.\n This endpoint returns chunks of text from corporate disclosures that are most relevant to the query, along with metadata about their source documents. This endpoint is useful for building search interfaces or retrieving specific content from documents.","operationId":"search_chunks_api_v1_rag_chunks_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","description":"The natural language query","title":"Query"},"description":"The natural language query","example":"What is Zscaler's net dollar retention rate?"}],"responses":{"200":{"description":"Chunks found successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChunksResponse"},"example":{"relevantChunks":[{"content":"# Comprehensive Income\n\n| USGAAP | Unnamed: 1 | Unnamed: 2 | Unnamed: 3 |\n| --- | --- | --- | --- |\n| Please note: The content of this file is qualified in its entirety by reference to the electronic version of the ASML 2024 Annual Report based on US GAAP and therefore: (i) your local (browser and/or mobile device) settings can influence the way this table and its content is being displayed and (ii) (foot)notes have been deleted for reader's convenience. | nan | nan | nan |\n| nan | nan | nan | nan |\n| Always refer to the electronic version of the ASML 2024 Annual Report based on US GAAP for the full and official financial information. | nan | nan | nan |\n| nan | nan | nan | nan |\n| Consolidated Statements of Comprehensive Income for the years ended December 31, 2022, 2023 and 2024 | nan | nan | nan |\n| nan | nan | nan | nan |\n| Year ended December 31 (€, in millions) | 2022.0 | 2023.0 | 2024.0 |\n| Net income | 5624.2 | 7839.0 | 7571.6 |\n| nan | nan | nan | nan |\n| Other comprehensive income (OCI): | nan | nan | nan |\n| Proportionate share of OCI from equity method investments | 37.7 | 0.2 | -12.1 |\n| nan | nan | nan | nan |\n| Foreign currency translation, net of taxes: | nan | nan | nan |\n| Gain (loss) on foreign currency translation | 66.0 | -68.3 | 91.9 |\n| nan | nan | nan | nan |\n| Financial instruments, net of taxes: | nan | nan | nan |\n| Gain (loss) on derivative financial instruments | 57.6 | -15.8 | 38.2 |\n| Transfers to net income | -66.5 | 0.6 | -8.9 |\n| Other comprehensive income, net of taxes | 94.8 | -83.3 | 109.1 |\n| nan | nan | nan | nan |\n| Total comprehensive income, net of taxes | 5719.0 | 7755.7 | 7680.7 |\n| Attributable to equity holders | 5719.0 | 7755.7 | 7680.7 |","pageNumber":2,"documentMetadata":{"id":"2dfd0c2a-fb6d-486a-ad62-3b1830eb30bf","documentCategory":"annual-report","date":"2024-12-31","description":"This document contains the consolidated financial statements of ASML for the years ended December 31, 2022, 2023, and 2024, including statements of operations, comprehensive income, balance sheets, shareholders' equity, and cash flow statements prepared under US GAAP.","fiscalQuarter":4,"fiscalYear":2024,"companyName":"ASML HOLDING NV","tickers":["ASML","ASML.AS"]}}]}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/rag/agent-response":{"post":{"tags":["Retrieval Augmented Generation"],"summary":"Get agent response","description":"Returns cited Markdown responses, sourced exclusively from corporate disclosures, in response to natural language queries.\n This endpoint provides AI-generated answers with proper citations to source documents, making it ideal for building Q&A interfaces or research tools.\n \n **Response Behavior:**\n - When relevant documents are found: Returns an AI-generated response with citations in the `sourceMap` field\n - When no relevant documents are found: Returns an informative message explaining why no documents were found, with an empty `sourceMap` field (HTTP 200 status)","operationId":"agent_response_api_v1_rag_agent_response_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","description":"The natural language query","title":"Query"},"description":"The natural language query","example":"What is Zscaler's net dollar retention rate?"}],"responses":{"200":{"description":"Agent response generated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"},"examples":{"with_sources":{"summary":"Response with found documents","value":{"content":"Zscaler's net dollar retention rates for the last two quarters are as follows:\n\n- Q3 2025 (trailing 12 months ended April 30, 2025): **114%** \n- Q2 2025 (trailing 12 months ended January 31, 2025): **115%** \n\nThese figures reflect Zscaler's ability to retain and expand recurring revenue from existing customers over the respective periods [#eaf60040].","sourceMap":{"#eaf60040":{"content":"### We calculate our dollar-based net retention rate as follows:\n\nTable of Contents\nInvesting in Business Growth\nSince our founding, we have invested significantly in growing our business. We intend to continue (i) investing in our\nresearch and development organization and our development efforts to offer new solutions on our cloud platform and (ii)\ndedicating resources to update and upgrade our existing solutions. In addition, we expect our general and administrative expenses\nto increase in absolute dollars in the foreseeable future, as we continue to operate as a public company, and address any legal\nmatters and related accruals, as further described in Note 10, Commitments and Contingencies, of the unaudited condensed\nconsolidated financial statements included elsewhere in this Quarterly Report on Form 10-Q.\nWe also intend to continue to invest significantly in sales and marketing to grow and train our sales force, broaden our brand\nawareness and expand and deepen our channel partner relationships. While these planned investments will increase our operating\nexpenses in the short term, we believe that over the long term these investments will help us to expand our customer base and\ngrow our business. We also are investing in programs to increase recognition of our brand and solutions, including joint marketing\nactivities with our channel partners and strategic partners.\nWhile we expect our operating expenses to increase in absolute dollars in the foreseeable future as a result of these\nactivities, we intend to balance these investments in future growth with a continued focus on managing our results of operations\nand investing judiciously. In the long term we anticipate that these investments will positively impact our business and results of\noperations.\nKey Business Metrics and Other Financial Measures\nWe review a number of operating and financial metrics, including the following key metrics, to measure our performance,\nidentify trends, formulate business plans and make strategic decisions.\nDollar-Based Net Retention Rate\nWe believe that dollar-based net retention rate is an indicator to measure the long-term value of our customer relationships\nbecause it is driven by our ability to retain and expand the recurring revenue generated from our existing customers. Our dollar-\nbased net retention rate compares the recurring revenue from a set of customers against the same metric for the prior 12-month\nperiod on a trailing basis. Because our customers have repeat buying patterns and the average term of our contracts is more than\n12 months, we measure this metric over a set of customers who were with us as of the last day of the same reporting period in the\nprior fiscal year. For the trailing 12 months ended January 31, 2025 and 2024, the dollar-based net retention rate was 115% and\n117%, respectively.\nWe calculate our dollar-based net retention rate as follows:\nDenominator: To calculate our dollar-based net retention rate as of the end of a reporting period, we first establish the ARR\nfrom all active subscriptions as of the last day of the same reporting period in the prior fiscal year. This effectively represents\nrecurring dollars that we expect in the next 12-month period from the cohort of customers that existed on the last day of the same\nreporting period in the prior fiscal year.\nNumerator: We measure the ARR for that same cohort of customers representing all subscriptions based on confirmed\ncustomer orders booked by us as of the end of the reporting period.\nDollar-based net retention rate is obtained by dividing the numerator by the denominator.","pageNumber":41,"excerpt":"For the trailing 12 months ended January 31, 2025 and 2024, the dollar-based net retention rate was 115% and 117%, respectively.","documentMetadata":{"id":"eaf63939-0da6-4fc7-ba06-adbd46e546a9","documentCategory":"interim-report","date":"2025-03-10","description":"This document is the Form 10-Q quarterly report filed by Zscaler, Inc. for the second fiscal quarter ended January 31, 2025. It includes unaudited condensed consolidated financial statements such as balance sheets, statements of operations, comprehensive loss, stockholders' equity, and cash flows. The report also contains management's discussion and analysis of financial condition and results of operations, quantitative and qualitative disclosures about market risk, controls and procedures, legal proceedings, risk factors, unregistered sales of equity securities, use of proceeds, and exhibits. The filing provides detailed financial data, forward-looking statements, and regulatory compliance information for the quarter.","fiscalQuarter":2,"fiscalYear":2025,"companyName":"Zscaler, Inc.","tickers":["ZS"]}}}}},"no_sources":{"summary":"Response when no documents found","value":{"content":"I couldn't find any relevant documents in our database to answer your query. This could be because:\n\n- The company or topic you're asking about isn't covered in our document collection\n- The specific information you're looking for isn't mentioned in the available documents\n- Your query might need to be more specific or use different terminology\n\nTry rephrasing your question or asking about a different company or topic that might be covered in our financial disclosure database.","sourceMap":{}}}}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/rag/agent-response-stream":{"post":{"tags":["Retrieval Augmented Generation"],"summary":"Stream agent response","description":"Streams cited Markdown responses, sourced exclusively from corporate disclosures, as server-sent events in response to natural language queries. This endpoint provides real-time streaming of AI-generated answers, making it ideal for interactive chat interfaces where users can see responses as they're generated.\n \n **Server-Sent Events (SSE) Structure:**\n \n - **`event: thinking`** - Agent's thinking process with stage information\n - `data: {\"type\": \"message\", \"role\": \"assistant\", \"content\": \"...\", \"stage\": \"search\"}`\n \n - **`event: message`** - Content chunks and warnings\n - `data: {\"type\": \"message\", \"role\": \"assistant\", \"content\": \"...\"}` - Response content chunks\n - `data: {\"type\": \"warning\", \"message\": \"...\"}` - Warning when no documents found\n \n - **`event: message/partial`** - Partial response content (streaming)\n - `data: {\"type\": \"message\", \"role\": \"assistant\", \"content\": \"...\"}`\n \n - **`event: metadata`** - Source document information\n - `data: {\"type\": \"sources\", \"content\": {\"#ref_id\": {\"content\": \"...\", \"pageNumber\": 123, \"excerpt\": \"...\", \"documentMetadata\": {\"id\": \"...\", \"documentCategory\": \"...\", \"formType\": \"...\", \"tickers\": [\"...\"], \"companyName\": \"...\", \"date\": \"...\", \"fiscalQuarter\": 1, \"fiscalYear\": 2025}}}}}` - Document sources and citations\n \n - **`event: done`** - Stream completion\n - `data: {}`","operationId":"agent_response_stream_api_v1_rag_agent_response_stream_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","description":"The natural language query","title":"Query"},"description":"The natural language query","example":"What is Zscaler's net dollar retention rate?"}],"responses":{"200":{"description":"Stream started successfully","content":{"application/json":{"schema":{}},"text/event-stream":{"examples":{"with_sources":{"summary":"Stream with found documents","value":"event: thinking\ndata: {\"type\": \"message\", \"role\": \"assistant\", \"content\": \"I'm going to look through 3 documents from NVIDIA CORP...\", \"stage\": \"search\"}\n\nevent: thinking\ndata: {\"type\": \"message\", \"role\": \"assistant\", \"content\": \"I found 13 relevant pages from NVIDIA CORP\", \"stage\": \"analyzing\"}\n\nevent: message\ndata: {\"type\": \"message\", \"role\": \"assistant\", \"content\": \"N\"}\n\nevent: message\ndata: {\"type\": \"message\", \"role\": \"assistant\", \"content\": \"VIDIA\"}\n\nevent: message\ndata: {\"type\": \"message\", \"role\": \"assistant\", \"content\": \"'s revenue for the fiscal year 2023 was **$26.97 billion**.\"}\n\nevent: metadata\ndata: {\"type\": \"sources\", \"content\": {\"#7bcd0078\": {\"content\": \"### Revenue (Tables)\\n3 Months Ended Dec. 28, 2024...\", \"pageNumber\": 79, \"excerpt\": \"Total net sales $ 124,300\", \"documentMetadata\": {\"id\": \"7bcdbd06-6b2a-460d-9596-626b6bfded3a\", \"documentCategory\": \"interim-report\", \"formType\": \"10-Q\", \"tickers\": [\"AAPL\"], \"companyName\": \"Apple Inc.\", \"date\": \"2025-01-31\", \"fiscalQuarter\": 1, \"fiscalYear\": 2025}}}}}}\n\nevent: done\ndata: {}\n\n"},"no_sources":{"summary":"Stream when no documents found","value":"event: thinking\ndata: {\"type\": \"message\", \"role\": \"assistant\", \"content\": \"I'm going to look through 3 documents from Apple Inc.: Net dollar retention (NDR) is a metric typically discussed in the context of SaaS or subscription businesses, and may not be a standard metric reported by Apple Inc. However, if Apple does report or discuss NDR, it would most likely be found in their most recent interim (10-Q) or annual (10-K) reports, as these contain detailed financial and operational metrics. The most recent 10-Qs and the latest 10-K are the best sources to check for any mention or calculation of net dollar retention or related metrics. If not explicitly stated, these documents will provide the necessary revenue and segment data to potentially calculate or estimate NDR if applicable.\", \"stage\": \"search\"}\n\nevent: thinking\ndata: {\"type\": \"message\", \"role\": \"assistant\", \"content\": \"I'm now analyzing 3 documents to find the most relevant information...\", \"stage\": \"document_inspection\"}\n\nevent: message\ndata: {\"type\": \"warning\", \"message\": \"I couldn't find any relevant information in the selected documents to answer your question.\"}\n\nevent: done\ndata: {}\n\n"}}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document":{"get":{"tags":["Documents"],"summary":"Get Document","description":"**DEPRECATED**: This endpoint is deprecated and should not be used directly.\n\nRetrieves a source document for display in the frontend.\n\nNOTE: Consuming applications should NOT use this endpoint directly. Instead, they should \nuse the `sourceLink` URLs returned by other endpoints (like `/rag/agent-query-stream` or `/rag/chunks`).\nThis endpoint is documented here purely for reference purposes.\n\nThis endpoint is designed to be called when a consuming application has received\na response containing a `sourceLink` from other endpoints (like `/rag/agent-query-stream` \nor `/rag/chunks`). It returns the full HTML content and metadata of the referenced \ndocument for display and highlighting in the frontend.\n\nSupported document types:\n- SEC filings (10-K, 10-Q)\n- International SEC filings (20-F, 40-F, 6-K)\n- 8-K documents (with embedded images)\n- Earnings call transcripts\n- Proxy statements (DEF 14A, DEFM14A, DEF 14C, etc.)\n- Investor relations (IR) documents (PDF and XLSX files)","operationId":"get_document_api_v1_document_get","deprecated":true,"security":[{"APIKeyHeader":[]}],"parameters":[{"name":"sourceType","in":"query","required":true,"schema":{"type":"string","description":"Type of document (10-K, 10-Q, 8-K, 20-F, 40-F, 6-K, transcript, DEF 14A, DEFM14A, DEF 14C, S-1, ir)","title":"Sourcetype"},"description":"Type of document (10-K, 10-Q, 8-K, 20-F, 40-F, 6-K, transcript, DEF 14A, DEFM14A, DEF 14C, S-1, ir)"},{"name":"documentId","in":"query","required":true,"schema":{"type":"string","description":"UUID of the document","title":"Documentid"},"description":"UUID of the document"},{"name":"fileType","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"For IR documents: file type (pdf, xlsx) - optional, will be retrieved from database if not provided","title":"Filetype"},"description":"For IR documents: file type (pdf, xlsx) - optional, will be retrieved from database if not provided"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/HTMLDocumentResponse"},{"$ref":"#/components/schemas/BlobDocumentResponse"}],"title":"Response Get Document Api V1 Document Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/rag/agent-query-stream":{"post":{"tags":["Retrieval Augmented Generation"],"summary":"Agent Query Stream","description":"Stream a response to a query in a simple markdown format.\n\nThis endpoint provides a simplified streaming response:\n1. First, it streams the ID mapping for source linking\n2. Then it streams raw markdown content as it comes from the LLM\n\nThe client only needs to concatenate the markdown chunks to get the full document,\nand can use the ID mapping to resolve citations to their sources.\n\nRequest body:\n- **query**: The query to ask the agent (required)\n- **tickers**: Optional list of ticker symbols to filter documents by\n- **sourceType**: Optional source type(s) to include (available options: '10-K', '10-Q', '8-K', '20-F', '40-F', '6-K', 'transcript', 'DEF 14A', etc.).\n Can be a single string or a list of strings.\n- **startDate**: Optional start date for document filtering (format: YYYY-MM-DD)\n- **endDate**: Optional end date for document filtering (format: YYYY-MM-DD)\n- **sourceLink**: Optional source link(s) to search within. Can be a single string or a list of strings.\n No other documents will be queried by the agent but these. Use to \n restrict the search to user-selected documents.\n\nReturns a streaming response with these event types:\n- 'id_mapping': A mapping of IDs to source links for citation resolution\n ```\n {\n \"type\": \"id_mapping\",\n \"mapping\": {\n \"#uuid1234\": {\n \"sourceLink\": \"http://rest-api.captide.co/document?id=12345678\",\n \"sourceMetadata\": {\n \"sourceType\": \"10-K\",\n \"ticker\": \"AAPL\",\n \"date\": \"2024-01-01\",\n \"fiscalPeriod\": \"FY 2023\",\n \"documentId\": \"12345678\"\n }\n }\n }\n }\n ```\n\n- 'markdown_chunk': A chunk of markdown text\n ```\n {\n \"type\": \"markdown_chunk\",\n \"content\": \"This is a part of the markdown response with a citation [#uuid1234].\"\n }\n ```\n\n- 'warning': Notification when requested information is not found\n ```\n {\n \"type\": \"warning\",\n \"message\": \"Could not find information about X in the provided documents.\"\n }\n ```\n\n- 'done': Signals the end of the stream\n ```\n {\n \"type\": \"done\"\n }\n ```\n\n- 'error': Error information if something goes wrong\n ```\n {\n \"type\": \"error\",\n \"detail\": \"An error occurred while processing the request.\"\n }\n ```\n\nClient implementation recommendations:\n1. First process the 'id_mapping' event to obtain source information for citations\n2. Then accumulate all 'markdown_chunk' events to build the complete response\n3. Display warnings to the user when 'warning' events are received\n4. When a 'done' event is received, the response is complete\n5. Use the ID mapping to create clickable citations in the rendered markdown\n\nIntegration with document search:\nThe 'sourceLink' parameter can be used in conjunction with the document search endpoint to:\n1. Let users search and select specific documents they want to analyze\n2. Then pass those document IDs to this endpoint to ensure the AI only references those selected documents\n3. This creates a more user-controlled research experience where they can direct the AI to specific filings","operationId":"agent_query_stream_api_v1_rag_agent_query_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true,"security":[{"APIKeyHeader":[]}]}},"/":{"get":{"tags":["Health"],"summary":"Root","description":"Health check endpoint.","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/redis":{"get":{"tags":["Health"],"summary":"Redis Health","description":"Redis health check endpoint.","operationId":"redis_health_health_redis_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AgentRequest":{"properties":{"query":{"type":"string","title":"Query","description":"The natural language query"},"tickers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tickers","description":"List of ticker symbols to filter by"},"startDate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Startdate","description":"Start date for filtering (YYYY-MM-DD)"},"endDate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enddate","description":"End date for filtering (YYYY-MM-DD)"},"sourceTypes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Sourcetypes","description":"List of source types to filter by"},"sourceLinks":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Sourcelinks","description":"List of specific source links to use"},"secOnly":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Seconly","description":"Whether to use only SEC documents","default":false}},"type":"object","required":["query"],"title":"AgentRequest","description":"Request model for agent queries."},"AgentResponse":{"properties":{"content":{"type":"string","title":"Content","description":"The agent's response in markdown format"},"sourceMap":{"additionalProperties":{"$ref":"#/components/schemas/Chunk"},"type":"object","title":"Sourcemap","description":"Mapping of citation reference IDs to chunk metadata. Empty when no relevant documents are found."}},"type":"object","required":["content","sourceMap"],"title":"AgentResponse","description":"Response model for agent queries."},"BlobDocumentResponse":{"properties":{"ticker":{"type":"string","title":"Ticker","description":"Company ticker symbol"},"companyName":{"type":"string","title":"Companyname","description":"Name of the company"},"metadata":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Metadata","description":"Additional document metadata"},"sourceType":{"$ref":"#/components/schemas/BlobDocumentType","description":"Type of blob document"},"sasUrl":{"type":"string","title":"Sasurl","description":"SAS URL for direct access to the document in blob storage"},"fileType":{"$ref":"#/components/schemas/IRFileType","description":"File type (pdf, xlsx)"},"fileName":{"type":"string","title":"Filename","description":"File name of the document"},"contentType":{"type":"string","title":"Contenttype","description":"MIME type of the document"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date","description":"Document date (filing date or transcript date)"},"fiscalPeriod":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fiscalperiod","description":"Fiscal period of the document"}},"type":"object","required":["ticker","companyName","sourceType","sasUrl","fileType","fileName","contentType"],"title":"BlobDocumentResponse","description":"Response model for blob storage documents (PDFs, XLSX files, etc.)."},"BlobDocumentType":{"type":"string","enum":["ir"],"title":"BlobDocumentType"},"Chunk":{"properties":{"content":{"type":"string","title":"Content","description":"Plain text content of the entire chunk"},"pageNumber":{"type":"integer","title":"Pagenumber","description":"Page number in the document"},"excerpt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Excerpt","description":"Specific part of the chunk that the agent used to answer the user's question. Used for source linking and highlighting."},"documentMetadata":{"$ref":"#/components/schemas/SourceDocument","description":"Metadata for the chunk's document"}},"type":"object","required":["content","pageNumber","documentMetadata"],"title":"Chunk","description":"A chunk of document content with metadata."},"ChunksResponse":{"properties":{"relevantChunks":{"items":{"$ref":"#/components/schemas/Chunk"},"type":"array","title":"Relevantchunks","description":"List of relevant document chunks"}},"type":"object","required":["relevantChunks"],"title":"ChunksResponse","description":"Response model for chunk search results."},"CompanyListResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique company ID"},"name":{"type":"string","title":"Name","description":"Company name"},"tickers":{"items":{"type":"string"},"type":"array","title":"Tickers","description":"List of ticker symbols with exchange suffixes (e.g., 'ASML', 'ASML.AS')"},"countries":{"items":{"type":"string"},"type":"array","title":"Countries","description":"Company's country of domicile (ISO 3166-1 alpha-2)"},"filesWithSec":{"type":"boolean","title":"Fileswithsec","description":"Whether the company files reports with the SEC"}},"type":"object","required":["id","name","tickers","countries","filesWithSec"],"title":"CompanyListResponse","description":"Response model for company list results."},"DocumentCategory":{"type":"string","enum":["annual-report","interim-report","supplemental-financial-information","earnings-release","current-report","shareholder-meetings-notice","earnings-call-slides","special-events-slides","earnings-call-transcript","sustainability-report","initial-registration-statement","follow-on-registration-statement","merger-registration-statement","compensation-registration-statement","tender-offer-statement","going-private-statement","insider-shares-transactions","other"],"title":"DocumentCategory","description":"Enum for document categories with their descriptions."},"DocumentListResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique document ID"},"documentCategory":{"$ref":"#/components/schemas/DocumentCategory","description":"Document categories. For detailed category descriptions, please refer to [this page](/coverage)."},"formType":{"anyOf":[{"$ref":"#/components/schemas/FormType"},{"type":"null"}],"description":"Document SEC form type (only applicable if the company files with the SEC)"},"tickers":{"items":{"type":"string"},"type":"array","title":"Tickers","description":"Tickers of the company filing the document"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Companyname","description":"Name of the company filing the document"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date","description":"Date the document relates to (e.g., the press release date for a current report, or the fiscal period end date for annual and interim reports)"},"fiscalQuarter":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fiscalquarter","description":"Fiscal quarter the document relates to (from 1 to 4)"},"fiscalYear":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fiscalyear","description":"Fiscal year the document relates to (e.g., 2024)"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Captide-generated document title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Captide-generated document description"}},"type":"object","required":["id","documentCategory","tickers"],"title":"DocumentListResponse","description":"Response model for document list results."},"DocumentResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique document ID"},"documentCategory":{"$ref":"#/components/schemas/DocumentCategory","description":"Document categories. For detailed category descriptions, please refer to [this page](/coverage)."},"formType":{"anyOf":[{"$ref":"#/components/schemas/FormType"},{"type":"null"}],"description":"Document SEC form type (only applicable if the company files with the SEC)"},"tickers":{"items":{"type":"string"},"type":"array","title":"Tickers","description":"Tickers of the company filing the document"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Companyname","description":"Name of the company filing the document"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date","description":"Date the document relates to (e.g., the press release date for a current report, or the fiscal period end date for annual and interim reports)"},"fiscalQuarter":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fiscalquarter","description":"Fiscal quarter the document relates to (from 1 to 4)"},"fiscalYear":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fiscalyear","description":"Fiscal year the document relates to (e.g., 2024)"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Captide-generated document title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Captide-generated document description"},"originalFileUrl":{"type":"string","title":"Originalfileurl","description":"Secure and temporary URL providing access to the original document file"},"markdownFileUrl":{"type":"string","title":"Markdownfileurl","description":"Secure and temporary URL providing access to the pre-processed, machine-readable document file"}},"type":"object","required":["id","documentCategory","tickers","originalFileUrl","markdownFileUrl"],"title":"DocumentResponse","description":"Response model for document retrieval by ID."},"ErrorResponse":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"ErrorResponse","description":"Standard error response model for all API endpoints."},"FormType":{"type":"string","enum":["10-K","10-Q","8-K","6-K","20-F","40-F","S-1","F-1","S-3","F-3","S-4","F-4","S-8","F-8","DEF 14A","DEFA14A","DEFM14A","DEF 14C","DEFM14C","DEFA14C"],"title":"FormType"},"HTMLDocumentResponse":{"properties":{"ticker":{"type":"string","title":"Ticker","description":"Company ticker symbol"},"companyName":{"type":"string","title":"Companyname","description":"Name of the company"},"metadata":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Metadata","description":"Additional document metadata"},"sourceType":{"$ref":"#/components/schemas/HTMLDocumentType","description":"Type of HTML document"},"htmlContent":{"type":"string","title":"Htmlcontent","description":"HTML content of the document for display"},"date":{"type":"string","title":"Date","description":"Document date (filing date or transcript date)"},"fiscalPeriod":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fiscalperiod","description":"Fiscal period of the document"}},"type":"object","required":["ticker","companyName","sourceType","htmlContent","date"],"title":"HTMLDocumentResponse","description":"Response model for HTML-based documents (SEC filings, transcripts, etc.)."},"HTMLDocumentType":{"type":"string","enum":["10-K","10-Q","8-K","20-F","40-F","6-K","S-1","DEF 14A","DEFM14A","DEF 14C","DEFM14C","transcript"],"title":"HTMLDocumentType"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IRFileType":{"type":"string","enum":["pdf","xlsx"],"title":"IRFileType"},"SourceDocument":{"properties":{"id":{"type":"string","title":"Id","description":"Unique document ID"},"documentCategory":{"$ref":"#/components/schemas/DocumentCategory","description":"Document categories. For detailed category descriptions, please refer to [this page](/coverage)"},"formType":{"anyOf":[{"$ref":"#/components/schemas/FormType"},{"type":"null"}],"description":"Document SEC form type (only applicable if the company files with the SEC)"},"date":{"type":"string","title":"Date","description":"Date the document relates to (e.g., the press release date for a current report, or the fiscal period end date for annual and interim reports)"},"description":{"type":"string","title":"Description","description":"Captide-generated document description"},"fiscalQuarter":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fiscalquarter","description":"Fiscal quarter the document relates to (from 1 to 4)"},"fiscalYear":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fiscalyear","description":"Fiscal year the document relates to (e.g., 2024)"},"companyName":{"type":"string","title":"Companyname","description":"Name of the company filing the document"},"tickers":{"items":{"type":"string"},"type":"array","title":"Tickers","description":"Tickers of the company filing the document"},"metadata":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Metadata","description":"Additional metadata for the document"}},"type":"object","required":["id","documentCategory","date","description","companyName","tickers"],"title":"SourceDocument","description":"Source document metadata model."},"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"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"}}}} \ No newline at end of file +{ + "openapi": "3.1.0", + "info": { + "title": "Captide REST API", + "description": "API for accessing financial disclosures and AI-powered financial document analysis.", + "version": "1.2.0" + }, + "servers": [ + { + "url": "https://rest-api.captide.co", + "description": "Prod server" + } + ], + "paths": { + "/api/v1/companies/list": { + "get": { + "tags": [ + "Companies" + ], + "summary": "List companies", + "description": "Retrieves a list of companies from the Captide database that match user-specified parameters. The response includes key company information such as name, ticker symbol(s) with exchange suffixes, country of domicile, SEC filing status, and the unique company ID assigned by Captide.", + "operationId": "list_companies_api_v1_companies_list_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "tickers", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Comma-separated list of company tickers (supports both base tickers like 'ITX' and suffixed tickers like 'ITX.MC')", + "examples": [ + "STO.AX,ASML.AS" + ], + "title": "Tickers" + }, + "description": "Comma-separated list of company tickers (supports both base tickers like 'ITX' and suffixed tickers like 'ITX.MC')" + }, + { + "name": "countries", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Comma-separated list of companies' country of domicile (ISO 3166-1 alpha-2)", + "examples": [ + "AU,NL" + ], + "title": "Countries" + }, + "description": "Comma-separated list of companies' country of domicile (ISO 3166-1 alpha-2)" + }, + { + "name": "filesWithSec", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether the companies file reports with the SEC", + "examples": [false], + "title": "Fileswithsec" + }, + "description": "Whether the companies file reports with the SEC" + }, + { + "name": "ids", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Comma-separated list of unique company IDs", + "examples": [ + "77848abe-a215-41b7-8950-86e89ea1fadc,91f6c6da-478f-4161-b451-aa5177cc7fb9" + ], + "title": "Ids" + }, + "description": "Comma-separated list of unique company IDs" + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer", + "maximum": 1000, + "minimum": 1 + }, + { + "type": "null" + } + ], + "description": "Maximum number of records to return. Required range: 1 \u003C= x \u003C= 1000", + "examples": [100], + "default": 100, + "title": "Limit" + }, + "description": "Maximum number of records to return. Required range: 1 \u003C= x \u003C= 1000" + } + ], + "responses": { + "200": { + "description": "List of companies matching the filter criteria", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CompanyListResponse" + } + } + } + }, + "400": { + "description": "Invalid request parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "Invalid or missing API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "429": { + "description": "Rate limit exceeded", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/v1/companies/{id}": { + "get": { + "tags": [ + "Companies" + ], + "summary": "Get company by ID", + "description": "Retrieves a single company from the Captide database by its unique ID. The response includes key company information such as name, ticker symbol(s) with exchange suffixes, country of domicile, and SEC filing status.", + "operationId": "get_company_api_v1_companies__id__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Id" + } + } + ], + "responses": { + "200": { + "description": "Company information for the specified ID", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CompanyResponse" + } + } + } + }, + "400": { + "description": "Invalid request parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "Invalid or missing API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "429": { + "description": "Rate limit exceeded", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "422": { + "description": "Validation error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/v1/documents/list": { + "get": { + "tags": [ + "Documents" + ], + "summary": "List documents", + "description": "Retrieves a list of financial and corporate disclosures available in Captide that match user-specified parameters. The response includes key document metadata such as the associated company's ticker symbol(s), document type, release date, fiscal year and quarter, the Captide-assigned document ID, and the associated company ID.", + "operationId": "list_documents_api_v1_documents_list_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "tickers", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Comma-separated list of tickers of the companies filing the documents (supports both base tickers like 'ITX' and suffixed tickers like 'ITX.MC')", + "examples": [ + "STO.AX,ASML.AS" + ], + "title": "Tickers" + }, + "description": "Comma-separated list of tickers of the companies filing the documents (supports both base tickers like 'ITX' and suffixed tickers like 'ITX.MC')" + }, + { + "name": "documentCategories", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Comma-separated list of document categories. Supported categories are: annual-report, interim-report, supplemental-financial-information, earnings-release, current-report, shareholder-meetings-notice, earnings-call-transcript, earnings-call-slides, special-events-slides, sustainability-report, initial-registration-statement. For detailed descriptions, please refer to [this page](/coverage)", + "examples": [ + "annual-report,interim-report" + ], + "title": "Documentcategories" + }, + "description": "Comma-separated list of document categories. Supported categories are: annual-report, interim-report, supplemental-financial-information, earnings-release, current-report, shareholder-meetings-notice, earnings-call-transcript, earnings-call-slides, special-events-slides, sustainability-report, initial-registration-statement. For detailed descriptions, please refer to [this page](/coverage)" + }, + { + "name": "formTypes", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Comma-separated list of SEC form types to retrieve. This parameter is only applicable to companies that file with the SEC. To check if a company files with the SEC, use the filesWithSec field from the /api/v1/companies/list endpoint", + "examples": [ + "10-K,10-Q" + ], + "title": "Formtypes" + }, + "description": "Comma-separated list of SEC form types to retrieve. This parameter is only applicable to companies that file with the SEC. To check if a company files with the SEC, use the filesWithSec field from the /api/v1/companies/list endpoint" + }, + { + "name": "startDate", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Start date for filtering documents (ISO 8601 format)", + "examples": [ + "2025-01-01" + ], + "title": "Startdate" + }, + "description": "Start date for filtering documents (ISO 8601 format)" + }, + { + "name": "endDate", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "End date for filtering documents (ISO 8601 format)", + "examples": [ + "2025-12-31" + ], + "title": "Enddate" + }, + "description": "End date for filtering documents (ISO 8601 format)" + }, + { + "name": "companyIds", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Comma-separated list of unique IDs of the companies filing the documents. Use /api/v1/companies/list to find the company ID", + "examples": [ + "77848abe-a215-41b7-8950-86e89ea1fadc,91f6c6da-478f-4161-b451-aa5177cc7fb9" + ], + "title": "Companyids" + }, + "description": "Comma-separated list of unique IDs of the companies filing the documents. Use /api/v1/companies/list to find the company ID" + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer", + "maximum": 1000, + "minimum": 1 + }, + { + "type": "null" + } + ], + "description": "Maximum number of records to return. Required range: 1 \u003C= x \u003C= 1000", + "examples": [100], + "default": 100, + "title": "Limit" + }, + "description": "Maximum number of records to return. Required range: 1 \u003C= x \u003C= 1000" + } + ], + "responses": { + "200": { + "description": "Document list retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DocumentListResponse" + }, + "title": "Response List Documents Api V1 Documents List Get" + }, + "examples": { + "documents": { + "summary": "Example documents list", + "value": [ + { + "id": "98381fbb-8d8c-4b47-b31c-819f8aca0690", + "documentCategory": "interim-report", + "tickers": [ + "STO.AX" + ], + "companyName": "Santos", + "date": "2025-04-17", + "fiscalQuarter": 1, + "fiscalYear": 2025, + "title": "First Quarter Report for period ending 31 March 2025", + "description": "This document is the First Quarter Report of Santos Limited for the period ending 31 March 2025. It provides a detailed overview of the company's operational and financial performance, including production volumes, sales, revenue, capital expenditure, project updates, and guidance for 2025." + } + ] + } + } + } + } + }, + "400": { + "description": "Invalid request parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "Invalid or missing API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "429": { + "description": "Rate limit exceeded", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/v1/documents/{id}": { + "get": { + "tags": [ + "Documents" + ], + "summary": "Get document by ID", + "description": "Fetch a document by its ID from the database, including company and ticker info.\n \n This endpoint returns complete document details including metadata, file URLs,\n and associated company information.", + "operationId": "get_document_by_id_api_v1_documents__id__get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Document ID", + "examples": [ + "123e4567-e89b-12d3-a456-426614174000" + ], + "title": "Id" + }, + "description": "Document ID" + } + ], + "responses": { + "200": { + "description": "Document found successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentResponse" + }, + "examples": { + "document": { + "summary": "Example document response", + "value": { + "id": "98381fbb-8d8c-4b47-b31c-819f8aca0690", + "documentCategory": "interim-report", + "tickers": [ + "STO.AX" + ], + "companyName": "Santos", + "date": "2025-04-17", + "fiscalQuarter": 1, + "fiscalYear": 2025, + "title": "First Quarter Report for period ending 31 March 2025", + "description": "This document is the First Quarter Report of Santos Limited for the period ending 31 March 2025. It provides a detailed overview of the company's operational and financial performance, including production volumes, sales, revenue, capital expenditure, project updates, and guidance for 2025.", + "originalFileUrl": "https://files.captide.co/original-docs/77848abe-a215-41b7-8950-86e89ea1fadc/2025-Santos-First-Quarter-Report.pdf?se=2025-07-28T17%3A33%3A51Z&sp=r&sv=2025-07-05&sr=b&sig=B6JuHmW4Yoif5tMJItatav/Vwe9IzOoqSaHs%2BZEwbDk%3D", + "markdownFileUrl": "https://files.captide.co/markdown-docs/77848abe-a215-41b7-8950-86e89ea1fadc/2025-Santos-First-Quarter-Report.md?se=2025-07-28T17%3A33%3A51Z&sp=r&sv=2025-07-05&sr=b&sig=umdy9HFMwQykzafdb62ZQAXF/4OXJHKM9Py0dfd2wuA%3D" + } + } + } + } + } + }, + "400": { + "description": "Invalid request parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "Invalid or missing API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "429": { + "description": "Rate limit exceeded", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "422": { + "description": "Validation error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/v1/rag/chunks": { + "get": { + "tags": [ + "Retrieval Augmented Generation" + ], + "summary": "Search document chunks", + "description": "Search for relevant document chunks based on a query. Under the hood, Captide's RAG system uses a combination of LLMs and vector databases to find the most relevant chunks of text from corporate disclosures that are most relevant to the query.\n This endpoint returns chunks of text from corporate disclosures that are most relevant to the query, along with metadata about their source documents. This endpoint is useful for building search interfaces or retrieving specific content from documents.", + "operationId": "search_chunks_api_v1_rag_chunks_get", + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "query", + "in": "query", + "required": true, + "schema": { + "type": "string", + "minLength": 1, + "description": "The natural language query", + "examples": [ + "What is Zscaler's net dollar retention rate?" + ], + "title": "Query" + }, + "description": "The natural language query" + } + ], + "responses": { + "200": { + "description": "Chunks found successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChunksResponse" + }, + "example": { + "relevantChunks": [ + { + "content": "# Comprehensive Income\n\n| USGAAP | Unnamed: 1 | Unnamed: 2 | Unnamed: 3 |\n| --- | --- | --- | --- |\n| Please note: The content of this file is qualified in its entirety by reference to the electronic version of the ASML 2024 Annual Report based on US GAAP and therefore: (i) your local (browser and/or mobile device) settings can influence the way this table and its content is being displayed and (ii) (foot)notes have been deleted for reader's convenience. | nan | nan | nan |\n| nan | nan | nan | nan |\n| Always refer to the electronic version of the ASML 2024 Annual Report based on US GAAP for the full and official financial information. | nan | nan | nan |\n| nan | nan | nan | nan |\n| Consolidated Statements of Comprehensive Income for the years ended December 31, 2022, 2023 and 2024 | nan | nan | nan |\n| nan | nan | nan | nan |\n| Year ended December 31 (€, in millions) | 2022.0 | 2023.0 | 2024.0 |\n| Net income | 5624.2 | 7839.0 | 7571.6 |\n| nan | nan | nan | nan |\n| Other comprehensive income (OCI): | nan | nan | nan |\n| Proportionate share of OCI from equity method investments | 37.7 | 0.2 | -12.1 |\n| nan | nan | nan | nan |\n| Foreign currency translation, net of taxes: | nan | nan | nan |\n| Gain (loss) on foreign currency translation | 66.0 | -68.3 | 91.9 |\n| nan | nan | nan | nan |\n| Financial instruments, net of taxes: | nan | nan | nan |\n| Gain (loss) on derivative financial instruments | 57.6 | -15.8 | 38.2 |\n| Transfers to net income | -66.5 | 0.6 | -8.9 |\n| Other comprehensive income, net of taxes | 94.8 | -83.3 | 109.1 |\n| nan | nan | nan | nan |\n| Total comprehensive income, net of taxes | 5719.0 | 7755.7 | 7680.7 |\n| Attributable to equity holders | 5719.0 | 7755.7 | 7680.7 |", + "pageNumber": 2, + "documentMetadata": { + "id": "2dfd0c2a-fb6d-486a-ad62-3b1830eb30bf", + "documentCategory": "annual-report", + "date": "2024-12-31", + "description": "This document contains the consolidated financial statements of ASML for the years ended December 31, 2022, 2023, and 2024, including statements of operations, comprehensive income, balance sheets, shareholders' equity, and cash flow statements prepared under US GAAP.", + "fiscalQuarter": 4, + "fiscalYear": 2024, + "companyName": "ASML HOLDING NV", + "tickers": [ + "ASML", + "ASML.AS" + ] + } + } + ] + } + } + } + }, + "400": { + "description": "Invalid request parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "Invalid or missing API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "429": { + "description": "Rate limit exceeded", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "422": { + "description": "Validation error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/v1/rag/agent-response": { + "post": { + "tags": [ + "Retrieval Augmented Generation" + ], + "summary": "Get agent response", + "description": "Returns cited Markdown responses, sourced exclusively from corporate disclosures, in response to natural language queries.\n This endpoint provides AI-generated answers with proper citations to source documents, making it ideal for building Q&A interfaces or research tools.\n \n **Response Behavior:**\n - When relevant documents are found: Returns an AI-generated response with citations in the `sourceMap` field\n - When no relevant documents are found: Returns an informative message explaining why no documents were found, with an empty `sourceMap` field (HTTP 200 status)", + "operationId": "agent_response_api_v1_rag_agent_response_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/app__schemas__rag__AgentRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Agent response generated successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentResponse" + }, + "examples": { + "with_sources": { + "summary": "Response with found documents", + "value": { + "content": "Zscaler's net dollar retention rates for the last two quarters are as follows:\n\n- Q3 2025 (trailing 12 months ended April 30, 2025): **114%** \n- Q2 2025 (trailing 12 months ended January 31, 2025): **115%** \n\nThese figures reflect Zscaler's ability to retain and expand recurring revenue from existing customers over the respective periods [#eaf60040].", + "sourceMap": { + "#eaf60040": { + "content": "### We calculate our dollar-based net retention rate as follows:\n\nTable of Contents\nInvesting in Business Growth\nSince our founding, we have invested significantly in growing our business. We intend to continue (i) investing in our\nresearch and development organization and our development efforts to offer new solutions on our cloud platform and (ii)\ndedicating resources to update and upgrade our existing solutions. In addition, we expect our general and administrative expenses\nto increase in absolute dollars in the foreseeable future, as we continue to operate as a public company, and address any legal\nmatters and related accruals, as further described in Note 10, Commitments and Contingencies, of the unaudited condensed\nconsolidated financial statements included elsewhere in this Quarterly Report on Form 10-Q.\nWe also intend to continue to invest significantly in sales and marketing to grow and train our sales force, broaden our brand\nawareness and expand and deepen our channel partner relationships. While these planned investments will increase our operating\nexpenses in the short term, we believe that over the long term these investments will help us to expand our customer base and\ngrow our business. We also are investing in programs to increase recognition of our brand and solutions, including joint marketing\nactivities with our channel partners and strategic partners.\nWhile we expect our operating expenses to increase in absolute dollars in the foreseeable future as a result of these\nactivities, we intend to balance these investments in future growth with a continued focus on managing our results of operations\nand investing judiciously. In the long term we anticipate that these investments will positively impact our business and results of\noperations.\nKey Business Metrics and Other Financial Measures\nWe review a number of operating and financial metrics, including the following key metrics, to measure our performance,\nidentify trends, formulate business plans and make strategic decisions.\nDollar-Based Net Retention Rate\nWe believe that dollar-based net retention rate is an indicator to measure the long-term value of our customer relationships\nbecause it is driven by our ability to retain and expand the recurring revenue generated from our existing customers. Our dollar-\nbased net retention rate compares the recurring revenue from a set of customers against the same metric for the prior 12-month\nperiod on a trailing basis. Because our customers have repeat buying patterns and the average term of our contracts is more than\n12 months, we measure this metric over a set of customers who were with us as of the last day of the same reporting period in the\nprior fiscal year. For the trailing 12 months ended January 31, 2025 and 2024, the dollar-based net retention rate was 115% and\n117%, respectively.\nWe calculate our dollar-based net retention rate as follows:\nDenominator: To calculate our dollar-based net retention rate as of the end of a reporting period, we first establish the ARR\nfrom all active subscriptions as of the last day of the same reporting period in the prior fiscal year. This effectively represents\nrecurring dollars that we expect in the next 12-month period from the cohort of customers that existed on the last day of the same\nreporting period in the prior fiscal year.\nNumerator: We measure the ARR for that same cohort of customers representing all subscriptions based on confirmed\ncustomer orders booked by us as of the end of the reporting period.\nDollar-based net retention rate is obtained by dividing the numerator by the denominator.", + "pageNumber": 41, + "excerpt": "For the trailing 12 months ended January 31, 2025 and 2024, the dollar-based net retention rate was 115% and 117%, respectively.", + "documentMetadata": { + "id": "eaf63939-0da6-4fc7-ba06-adbd46e546a9", + "documentCategory": "interim-report", + "date": "2025-03-10", + "description": "This document is the Form 10-Q quarterly report filed by Zscaler, Inc. for the second fiscal quarter ended January 31, 2025. It includes unaudited condensed consolidated financial statements such as balance sheets, statements of operations, comprehensive loss, stockholders' equity, and cash flows. The report also contains management's discussion and analysis of financial condition and results of operations, quantitative and qualitative disclosures about market risk, controls and procedures, legal proceedings, risk factors, unregistered sales of equity securities, use of proceeds, and exhibits. The filing provides detailed financial data, forward-looking statements, and regulatory compliance information for the quarter.", + "fiscalQuarter": 2, + "fiscalYear": 2025, + "companyName": "Zscaler, Inc.", + "tickers": [ + "ZS" + ] + } + } + } + } + }, + "no_sources": { + "summary": "Response when no documents found", + "value": { + "content": "I couldn't find any relevant documents in our database to answer your query. This could be because:\n\n- The company or topic you're asking about isn't covered in our document collection\n- The specific information you're looking for isn't mentioned in the available documents\n- Your query might need to be more specific or use different terminology\n\nTry rephrasing your question or asking about a different company or topic that might be covered in our financial disclosure database.", + "sourceMap": { + + } + } + } + } + } + } + }, + "400": { + "description": "Invalid request parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "Invalid or missing API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "429": { + "description": "Rate limit exceeded", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "422": { + "description": "Validation error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/api/v1/rag/agent-response-stream": { + "post": { + "tags": [ + "Retrieval Augmented Generation" + ], + "summary": "Stream agent response", + "description": "Streams cited Markdown responses, sourced exclusively from corporate disclosures, as server-sent events in response to natural language queries. This endpoint provides real-time streaming of AI-generated answers, making it ideal for interactive chat interfaces where users can see responses as they're generated.\n \n **Server-Sent Events (SSE) Structure:**\n \n - **`data: {\"type\": \"thinking\", ...}`** - Agent's thinking process with stage information\n - `data: {\"type\": \"thinking\", \"role\": \"assistant\", \"content\": \"...\", \"stage\": \"search\"}`\n \n - **`data: {\"type\": \"message\", ...}`** - Response content chunks\n - `data: {\"type\": \"message\", \"role\": \"assistant\", \"content\": \"...\"}`\n \n - **`data: {\"type\": \"warning\", ...}`** - Warning when no documents found\n - `data: {\"type\": \"warning\", \"message\": \"...\"}`\n \n - **`data: {\"type\": \"sources\", ...}`** - Source document information\n - `data: {\"type\": \"sources\", \"content\": {\"#ref_id\": {\"content\": \"...\", \"pageNumber\": 123, \"excerpt\": \"...\", \"documentMetadata\": {\"id\": \"...\", \"documentCategory\": \"...\", \"formType\": \"...\", \"tickers\": [\"...\"], \"companyName\": \"...\", \"date\": \"...\", \"fiscalQuarter\": 1, \"fiscalYear\": 2025}}}}}` - Document sources and citations\n \n - **`data: {\"type\": \"done\"}`** - Stream completion\n - `data: {\"type\": \"done\"}`", + "operationId": "agent_response_stream_api_v1_rag_agent_response_stream_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/app__schemas__rag__AgentRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Stream started successfully", + "content": { + "application/json": { + "schema": { + + } + }, + "text/event-stream": { + "examples": { + "with_sources": { + "summary": "Stream with found documents", + "value": "data: {\"type\": \"thinking\", \"role\": \"assistant\", \"content\": \"I'm going to look through 3 documents from NVIDIA CORP...\", \"stage\": \"search\"}\n\ndata: {\"type\": \"thinking\", \"role\": \"assistant\", \"content\": \"I found 13 relevant pages from NVIDIA CORP\", \"stage\": \"analyzing\"}\n\ndata: {\"type\": \"message\", \"role\": \"assistant\", \"content\": \"N\"}\n\ndata: {\"type\": \"message\", \"role\": \"assistant\", \"content\": \"VIDIA\"}\n\ndata: {\"type\": \"message\", \"role\": \"assistant\", \"content\": \"'s revenue for the fiscal year 2023 was **$26.97 billion**.\"}\n\ndata: {\"type\": \"sources\", \"content\": {\"#7bcd0078\": {\"content\": \"### Revenue (Tables)\\n3 Months Ended Dec. 28, 2024...\", \"pageNumber\": 79, \"excerpt\": \"Total net sales $ 124,300\", \"documentMetadata\": {\"id\": \"7bcdbd06-6b2a-460d-9596-626b6bfded3a\", \"documentCategory\": \"interim-report\", \"formType\": \"10-Q\", \"tickers\": [\"AAPL\"], \"companyName\": \"Apple Inc.\", \"date\": \"2025-01-31\", \"fiscalQuarter\": 1, \"fiscalYear\": 2025}}}}}}\n\ndata: {\"type\": \"done\"}\n\n" + }, + "no_sources": { + "summary": "Stream when no documents found", + "value": "data: {\"type\": \"thinking\", \"role\": \"assistant\", \"content\": \"I'm going to look through 3 documents from Apple Inc.: Net dollar retention (NDR) is a metric typically discussed in the context of SaaS or subscription businesses, and may not be a standard metric reported by Apple Inc. However, if Apple does report or discuss NDR, it would most likely be found in their most recent interim (10-Q) or annual (10-K) reports, as these contain detailed financial and operational metrics. The most recent 10-Qs and the latest 10-K are the best sources to check for any mention or calculation of net dollar retention or related metrics. If not explicitly stated, these documents will provide the necessary revenue and segment data to potentially calculate or estimate NDR if applicable.\", \"stage\": \"search\"}\n\ndata: {\"type\": \"thinking\", \"role\": \"assistant\", \"content\": \"I'm now analyzing 3 documents to find the most relevant information...\", \"stage\": \"document_inspection\"}\n\ndata: {\"type\": \"warning\", \"message\": \"I couldn't find any relevant information in the selected documents to answer your question.\"}\n\ndata: {\"type\": \"done\"}\n\n" + } + } + } + } + }, + "400": { + "description": "Invalid request parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "Invalid or missing API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "429": { + "description": "Rate limit exceeded", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "422": { + "description": "Validation error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/api/v1/document": { + "get": { + "tags": [ + "Documents" + ], + "summary": "Get Document", + "description": "**DEPRECATED**: This endpoint is deprecated and should not be used directly.\n\nRetrieves a source document for display in the frontend.\n\nNOTE: Consuming applications should NOT use this endpoint directly. Instead, they should \nuse the `sourceLink` URLs returned by other endpoints (like `/rag/agent-query-stream` or `/rag/chunks`).\nThis endpoint is documented here purely for reference purposes.\n\nThis endpoint is designed to be called when a consuming application has received\na response containing a `sourceLink` from other endpoints (like `/rag/agent-query-stream` \nor `/rag/chunks`). It returns the full HTML content and metadata of the referenced \ndocument for display and highlighting in the frontend.\n\nSupported document types:\n- SEC filings (10-K, 10-Q)\n- International SEC filings (20-F, 40-F, 6-K)\n- 8-K documents (with embedded images)\n- Earnings call transcripts\n- Proxy statements (DEF 14A, DEFM14A, DEF 14C, etc.)\n- Investor relations (IR) documents (PDF and XLSX files)", + "operationId": "get_document_api_v1_document_get", + "deprecated": true, + "security": [ + { + "APIKeyHeader": [] + } + ], + "parameters": [ + { + "name": "sourceType", + "in": "query", + "required": true, + "schema": { + "type": "string", + "description": "Type of document (10-K, 10-Q, 8-K, 20-F, 40-F, 6-K, transcript, DEF 14A, DEFM14A, DEF 14C, S-1, ir)", + "title": "Sourcetype" + }, + "description": "Type of document (10-K, 10-Q, 8-K, 20-F, 40-F, 6-K, transcript, DEF 14A, DEFM14A, DEF 14C, S-1, ir)" + }, + { + "name": "documentId", + "in": "query", + "required": true, + "schema": { + "type": "string", + "description": "UUID of the document", + "title": "Documentid" + }, + "description": "UUID of the document" + }, + { + "name": "fileType", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For IR documents: file type (pdf, xlsx) - optional, will be retrieved from database if not provided", + "title": "Filetype" + }, + "description": "For IR documents: file type (pdf, xlsx) - optional, will be retrieved from database if not provided" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/HTMLDocumentResponse" + }, + { + "$ref": "#/components/schemas/BlobDocumentResponse" + } + ], + "title": "Response Get Document Api V1 Document Get" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/v1/rag/agent-query-stream": { + "post": { + "tags": [ + "Retrieval Augmented Generation" + ], + "summary": "Agent Query Stream", + "description": "Stream a response to a query in a simple markdown format.\n\nThis endpoint provides a simplified streaming response:\n1. First, it streams the ID mapping for source linking\n2. Then it streams raw markdown content as it comes from the LLM\n\nThe client only needs to concatenate the markdown chunks to get the full document,\nand can use the ID mapping to resolve citations to their sources.\n\nRequest body:\n- **query**: The query to ask the agent (required)\n- **tickers**: Optional list of ticker symbols to filter documents by\n- **sourceType**: Optional source type(s) to include (available options: '10-K', '10-Q', '8-K', '20-F', '40-F', '6-K', 'transcript', 'DEF 14A', etc.).\n Can be a single string or a list of strings.\n- **startDate**: Optional start date for document filtering (format: YYYY-MM-DD)\n- **endDate**: Optional end date for document filtering (format: YYYY-MM-DD)\n- **sourceLink**: Optional source link(s) to search within. Can be a single string or a list of strings.\n No other documents will be queried by the agent but these. Use to \n restrict the search to user-selected documents.\n\nReturns a streaming response with these event types:\n- 'id_mapping': A mapping of IDs to source links for citation resolution\n ```\n {\n \"type\": \"id_mapping\",\n \"mapping\": {\n \"#uuid1234\": {\n \"sourceLink\": \"http://rest-api-new.captide.co/document?id=12345678\",\n \"sourceMetadata\": {\n \"sourceType\": \"10-K\",\n \"ticker\": \"AAPL\",\n \"date\": \"2024-01-01\",\n \"fiscalPeriod\": \"FY 2023\",\n \"documentId\": \"12345678\"\n }\n }\n }\n }\n ```\n\n- 'markdown_chunk': A chunk of markdown text\n ```\n {\n \"type\": \"markdown_chunk\",\n \"content\": \"This is a part of the markdown response with a citation [#uuid1234].\"\n }\n ```\n\n- 'warning': Notification when requested information is not found\n ```\n {\n \"type\": \"warning\",\n \"message\": \"Could not find information about X in the provided documents.\"\n }\n ```\n\n- 'done': Signals the end of the stream\n ```\n {\n \"type\": \"done\"\n }\n ```\n\n- 'error': Error information if something goes wrong\n ```\n {\n \"type\": \"error\",\n \"detail\": \"An error occurred while processing the request.\"\n }\n ```\n\nClient implementation recommendations:\n1. First process the 'id_mapping' event to obtain source information for citations\n2. Then accumulate all 'markdown_chunk' events to build the complete response\n3. Display warnings to the user when 'warning' events are received\n4. When a 'done' event is received, the response is complete\n5. Use the ID mapping to create clickable citations in the rendered markdown\n\nIntegration with document search:\nThe 'sourceLink' parameter can be used in conjunction with the document search endpoint to:\n1. Let users search and select specific documents they want to analyze\n2. Then pass those document IDs to this endpoint to ensure the AI only references those selected documents\n3. This creates a more user-controlled research experience where they can direct the AI to specific filings", + "operationId": "agent_query_stream_api_v1_rag_agent_query_stream_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/app__schemas__legacy__rag__AgentRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "deprecated": true, + "security": [ + { + "APIKeyHeader": [] + } + ] + } + }, + "/": { + "get": { + "tags": [ + "Health" + ], + "summary": "Root", + "description": "Health check endpoint.", + "operationId": "root__get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + + } + } + } + } + } + } + }, + "/health": { + "get": { + "tags": [ + "Health" + ], + "summary": "Health", + "description": "Simple health check endpoint for Kubernetes probes.", + "operationId": "health_health_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + + } + } + } + } + } + } + }, + "/health/redis": { + "get": { + "tags": [ + "Health" + ], + "summary": "Redis Health", + "description": "Redis health check endpoint.", + "operationId": "redis_health_health_redis_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AgentResponse": { + "properties": { + "content": { + "type": "string", + "title": "Content", + "description": "The agent's response in markdown format" + }, + "sourceMap": { + "additionalProperties": { + "$ref": "#/components/schemas/Chunk" + }, + "type": "object", + "title": "Sourcemap", + "description": "Mapping of citation reference IDs to chunk metadata. Empty when no relevant documents are found." + } + }, + "type": "object", + "required": [ + "content", + "sourceMap" + ], + "title": "AgentResponse", + "description": "Response model for agent queries." + }, + "BlobDocumentResponse": { + "properties": { + "ticker": { + "type": "string", + "title": "Ticker", + "description": "Company ticker symbol" + }, + "companyName": { + "type": "string", + "title": "Companyname", + "description": "Name of the company" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata", + "description": "Additional document metadata" + }, + "sourceType": { + "$ref": "#/components/schemas/BlobDocumentType", + "description": "Type of blob document" + }, + "sasUrl": { + "type": "string", + "title": "Sasurl", + "description": "SAS URL for direct access to the document in blob storage" + }, + "fileType": { + "$ref": "#/components/schemas/IRFileType", + "description": "File type (pdf, xlsx)" + }, + "fileName": { + "type": "string", + "title": "Filename", + "description": "File name of the document" + }, + "contentType": { + "type": "string", + "title": "Contenttype", + "description": "MIME type of the document" + }, + "date": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Date", + "description": "Document date (filing date or transcript date)" + }, + "fiscalPeriod": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Fiscalperiod", + "description": "Fiscal period of the document" + } + }, + "type": "object", + "required": [ + "ticker", + "companyName", + "sourceType", + "sasUrl", + "fileType", + "fileName", + "contentType" + ], + "title": "BlobDocumentResponse", + "description": "Response model for blob storage documents (PDFs, XLSX files, etc.)." + }, + "BlobDocumentType": { + "type": "string", + "enum": [ + "ir" + ], + "title": "BlobDocumentType" + }, + "Chunk": { + "properties": { + "content": { + "type": "string", + "title": "Content", + "description": "Plain text content of the entire chunk" + }, + "pageNumber": { + "type": "integer", + "title": "Pagenumber", + "description": "Page number in the document" + }, + "excerpt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Excerpt", + "description": "Specific part of the chunk that the agent used to answer the user's question. Used for source linking and highlighting." + }, + "documentMetadata": { + "$ref": "#/components/schemas/SourceDocument", + "description": "Metadata for the chunk's document" + } + }, + "type": "object", + "required": [ + "content", + "pageNumber", + "documentMetadata" + ], + "title": "Chunk", + "description": "A chunk of document content with metadata." + }, + "ChunksResponse": { + "properties": { + "relevantChunks": { + "items": { + "$ref": "#/components/schemas/Chunk" + }, + "type": "array", + "title": "Relevantchunks", + "description": "List of relevant document chunks" + } + }, + "type": "object", + "required": [ + "relevantChunks" + ], + "title": "ChunksResponse", + "description": "Response model for chunk search results." + }, + "CompanyListResponse": { + "properties": { + "companies": { + "items": { + "$ref": "#/components/schemas/CompanyResponse" + }, + "type": "array", + "title": "Companies", + "description": "List of companies matching the filter criteria" + } + }, + "type": "object", + "required": [ + "companies" + ], + "title": "CompanyListResponse", + "description": "Response model for company list results." + }, + "CompanyResponse": { + "properties": { + "id": { + "type": "string", + "title": "Id", + "description": "Unique company ID" + }, + "name": { + "type": "string", + "title": "Name", + "description": "Company name" + }, + "tickers": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Tickers", + "description": "List of ticker symbols with exchange suffixes (e.g., 'ASML', 'ASML.AS')" + }, + "countries": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Countries", + "description": "Company's country of domicile (ISO 3166-1 alpha-2)" + }, + "filesWithSec": { + "type": "boolean", + "title": "Fileswithsec", + "description": "Whether the company files reports with the SEC" + } + }, + "type": "object", + "required": [ + "id", + "name", + "tickers", + "countries", + "filesWithSec" + ], + "title": "CompanyResponse", + "description": "Response model for single company retrieval." + }, + "DocumentCategory": { + "type": "string", + "enum": [ + "annual-report", + "interim-report", + "supplemental-financial-information", + "earnings-release", + "current-report", + "shareholder-meetings-notice", + "earnings-call-slides", + "special-events-slides", + "earnings-call-transcript", + "sustainability-report", + "initial-registration-statement", + "follow-on-registration-statement", + "merger-registration-statement", + "compensation-registration-statement", + "tender-offer-statement", + "going-private-statement", + "insider-shares-transactions", + "other" + ], + "title": "DocumentCategory", + "description": "Enum for document categories with their descriptions." + }, + "DocumentListResponse": { + "properties": { + "id": { + "type": "string", + "title": "Id", + "description": "Unique document ID" + }, + "documentCategory": { + "$ref": "#/components/schemas/DocumentCategory", + "description": "Document categories. For detailed category descriptions, please refer to [this page](/coverage)." + }, + "formType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Formtype", + "description": "Document SEC form type (only applicable if the company files with the SEC)" + }, + "tickers": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Tickers", + "description": "Tickers of the company filing the document" + }, + "companyName": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Companyname", + "description": "Name of the company filing the document" + }, + "date": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Date", + "description": "Date the document relates to (e.g., the press release date for a current report, or the fiscal period end date for annual and interim reports)" + }, + "fiscalQuarter": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Fiscalquarter", + "description": "Fiscal quarter the document relates to (from 1 to 4)" + }, + "fiscalYear": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Fiscalyear", + "description": "Fiscal year the document relates to (e.g., 2024)" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Title", + "description": "Captide-generated document title" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description", + "description": "Captide-generated document description" + } + }, + "type": "object", + "required": [ + "id", + "documentCategory", + "tickers" + ], + "title": "DocumentListResponse", + "description": "Response model for document list results." + }, + "DocumentResponse": { + "properties": { + "id": { + "type": "string", + "title": "Id", + "description": "Unique document ID" + }, + "documentCategory": { + "$ref": "#/components/schemas/DocumentCategory", + "description": "Document categories. For detailed category descriptions, please refer to [this page](/coverage)." + }, + "formType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Formtype", + "description": "Document SEC form type (only applicable if the company files with the SEC)" + }, + "tickers": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Tickers", + "description": "Tickers of the company filing the document" + }, + "companyName": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Companyname", + "description": "Name of the company filing the document" + }, + "date": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Date", + "description": "Date the document relates to (e.g., the press release date for a current report, or the fiscal period end date for annual and interim reports)" + }, + "fiscalQuarter": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Fiscalquarter", + "description": "Fiscal quarter the document relates to (from 1 to 4)" + }, + "fiscalYear": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Fiscalyear", + "description": "Fiscal year the document relates to (e.g., 2024)" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Title", + "description": "Captide-generated document title" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description", + "description": "Captide-generated document description" + }, + "originalFileUrl": { + "type": "string", + "title": "Originalfileurl", + "description": "Secure and temporary URL providing access to the original document file" + }, + "markdownFileUrl": { + "type": "string", + "title": "Markdownfileurl", + "description": "Secure and temporary URL providing access to the pre-processed, machine-readable document file" + } + }, + "type": "object", + "required": [ + "id", + "documentCategory", + "tickers", + "originalFileUrl", + "markdownFileUrl" + ], + "title": "DocumentResponse", + "description": "Response model for document retrieval by ID." + }, + "ErrorResponse": { + "properties": { + "detail": { + "type": "string", + "title": "Detail" + } + }, + "type": "object", + "required": [ + "detail" + ], + "title": "ErrorResponse", + "description": "Standard error response model for all API endpoints." + }, + "HTMLDocumentResponse": { + "properties": { + "ticker": { + "type": "string", + "title": "Ticker", + "description": "Company ticker symbol" + }, + "companyName": { + "type": "string", + "title": "Companyname", + "description": "Name of the company" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata", + "description": "Additional document metadata" + }, + "sourceType": { + "$ref": "#/components/schemas/HTMLDocumentType", + "description": "Type of HTML document" + }, + "htmlContent": { + "type": "string", + "title": "Htmlcontent", + "description": "HTML content of the document for display" + }, + "date": { + "type": "string", + "title": "Date", + "description": "Document date (filing date or transcript date)" + }, + "fiscalPeriod": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Fiscalperiod", + "description": "Fiscal period of the document" + } + }, + "type": "object", + "required": [ + "ticker", + "companyName", + "sourceType", + "htmlContent", + "date" + ], + "title": "HTMLDocumentResponse", + "description": "Response model for HTML-based documents (SEC filings, transcripts, etc.)." + }, + "HTMLDocumentType": { + "type": "string", + "enum": [ + "10-K", + "10-Q", + "8-K", + "20-F", + "40-F", + "6-K", + "S-1", + "DEF 14A", + "DEFM14A", + "DEF 14C", + "DEFM14C", + "transcript" + ], + "title": "HTMLDocumentType" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "type": "array", + "title": "Detail" + } + }, + "type": "object", + "title": "HTTPValidationError" + }, + "IRFileType": { + "type": "string", + "enum": [ + "pdf", + "xlsx" + ], + "title": "IRFileType" + }, + "SourceDocument": { + "properties": { + "id": { + "type": "string", + "title": "Id", + "description": "Unique document ID" + }, + "documentCategory": { + "$ref": "#/components/schemas/DocumentCategory", + "description": "Document categories. For detailed category descriptions, please refer to [this page](/coverage)" + }, + "formType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Formtype", + "description": "Document SEC form type (only applicable if the company files with the SEC)" + }, + "date": { + "type": "string", + "title": "Date", + "description": "Date the document relates to (e.g., the press release date for a current report, or the fiscal period end date for annual and interim reports)" + }, + "description": { + "type": "string", + "title": "Description", + "description": "Captide-generated document description" + }, + "fiscalQuarter": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Fiscalquarter", + "description": "Fiscal quarter the document relates to (from 1 to 4)" + }, + "fiscalYear": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Fiscalyear", + "description": "Fiscal year the document relates to (e.g., 2024)" + }, + "companyName": { + "type": "string", + "title": "Companyname", + "description": "Name of the company filing the document" + }, + "tickers": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Tickers", + "description": "Tickers of the company filing the document" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata", + "description": "Additional metadata for the document" + } + }, + "type": "object", + "required": [ + "id", + "documentCategory", + "date", + "description", + "companyName", + "tickers" + ], + "title": "SourceDocument", + "description": "Source document metadata model." + }, + "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" + }, + "app__schemas__legacy__rag__AgentRequest": { + "properties": { + "query": { + "type": "string", + "title": "Query", + "description": "The natural language query" + }, + "tickers": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Tickers", + "description": "List of ticker symbols to filter by" + }, + "startDate": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Startdate", + "description": "Start date for filtering (YYYY-MM-DD)" + }, + "endDate": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Enddate", + "description": "End date for filtering (YYYY-MM-DD)" + }, + "sourceTypes": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Sourcetypes", + "description": "List of source types to filter by" + }, + "sourceLinks": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Sourcelinks", + "description": "List of specific source links to use" + }, + "secOnly": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Seconly", + "description": "Whether to use only SEC documents", + "default": false + } + }, + "type": "object", + "required": [ + "query" + ], + "title": "AgentRequest", + "description": "Legacy request model for agent queries with advanced filtering options." + }, + "app__schemas__rag__AgentRequest": { + "properties": { + "query": { + "type": "string", + "minLength": 1, + "title": "Query", + "description": "The natural language query" + } + }, + "type": "object", + "required": [ + "query" + ], + "title": "AgentRequest", + "description": "Request model for agent queries." + } + }, + "securitySchemes": { + "APIKeyHeader": { + "type": "apiKey", + "in": "header", + "name": "X-API-Key" + } + } + } +}