This guide will help you get started with Captide quickly, showing you how to set up both the REST API and the Document Auditing JavaScript SDK to embed corporate disclosure intelligence into your systems.
Before you begin, make sure you request a Captide test API key.

Using the REST API

Authentication

All API requests require authentication using your API key in the header:
curl --request GET \
  --url 'https://rest-api.captide.co/api/v1/companies/list' \
  --header 'X-API-Key: YOUR_API_KEY'

Example 1: Retrieve Company Information

Use the /companies/list endpoint when you want to search companies in Captide and retrieve their company id to use as parameter in other endpoints.
curl --request GET \
  --url 'https://rest-api.captide.co/api/v1/companies/list?limit=100&tickers=STO.AX' \
  --header 'X-API-Key: YOUR_API_KEY'
Use the response to retrieve company information and use the id to retrieve company docs:
[
  {
    "id": "77848abe-a215-41b7-8950-86e89ea1fadc",
    "name": "Santos",
    "tickers": ["STO.AX"],
    "countries": ["AU"],
    "filesWithSec": false
  }
]

Example 2: Retrieve Company Documents

Use the /documents/list endpoint to search for company documents by applying filters such as documentCategories, formTypes, or by specifying a company’s tickers or id. This allows you to retrieve the metadata of the latest corporate disclosures of publicly listed companies.
In the example below, we use the id of Santos to retrieve its latest interim-reports:
curl --request GET \
  --url 'https://rest-api.captide.co/api/v1/documents/list?limit=100&companyIds=77848abe-a215-41b7-8950-86e89ea1fadc&documentCategories=interim-report' \
  --header 'X-API-Key: YOUR_API_KEY'
The response below contains metadata for each document. The document id is particularly important, as it is used to retrieve the document file and its formatted Markdown version.
[
  {
    "id": "98381fbb-8d8c-4b47-b31c-819f8aca0690",
    "documentCategory": "interim-report",
    "formType": null,
    "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."
  },
  {
    "id": "095d866c-c6df-4799-bce3-61b60a5d62ea",
    "documentCategory": "interim-report",
    "formType": null,
    "tickers": [
      "STO.AX"
    ],
    "companyName": "Santos",
    "date": "2025-01-23",
    "fiscalQuarter": 4,
    "fiscalYear": 2024,
    "title": "Fourth Quarter Report for period ending 31 December 2024",
    "description": "This document is the Fourth Quarter Report of Santos Limited for the period ending 31 December 2024. It provides a detailed overview of the company's financial and operational performance, including sales revenue, production volumes, capital expenditure, project updates, and carbon capture and storage activities."
  },
  ...
]
Once target documents are identified, we can use their id with the /documents/ endpoint to retrieve the URLs for the document files.
curl --request GET \
  --url https://rest-api.captide.co/api/v1/documents/98381fbb-8d8c-4b47-b31c-819f8aca0690 \
  --header 'X-API-Key: YOUR_API_KEY'
{
  "id": "98381fbb-8d8c-4b47-b31c-819f8aca0690",
  "documentCategory": "interim-report",
  "formType": null,
  "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"
}
The response includes two additional fields: originalFileUrl and markdownFileUrl. These provide temporary access to the original document file and its formatted Markdown version, which is optimized for downstream analysis and LLM ingestion.

Example 3: Prompt-Based Chunk Retrieval

With Captide, you can create RAG-based applications and tools without the need to collect, preprocess, chunk, or store document excerpts yourself. Simply use the /rag/chunk-retrieval endpoint to send natural language requests, and you’ll receive relevant document excerpts from our database containing all the information needed to fulfill your query.
curl --request POST \
  --url 'https://rest-api.captide.co/api/v1/rag/chunks?query=Provide%20the%20net%20dollar%20retention%20of%20ZScaler%20for%20the%20last%20two%20quarters' \
  --header 'X-API-Key: YOUR_API_KEY'
The response includes a list of relevant document chunks from the Captide database, along with their associated metadata.
{
  "relevantChunks": [
    {
      "content": "## 34\n\n### 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 11, 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 April 30, 2025 and 2024, the dollar-based net retention rate was 114% and\n116%, 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. Our dollar-based net retention rate\nmay fluctuate due to a number of factors, including the performance of our cloud platform, our success in selling bigger deals,\nincluding deals for all employees with our higher-end bundles, selling multiple-pillars from the start of our contract with new\ncustomers, faster upsells within a year, the timing and the rate of ARR expansion of our existing\n34",
      "pageNumber": 45,
      "excerpt": null,
      "documentMetadata": {
        "id": "207db5da-c2bb-42b8-a0d3-1a5d508e723c",
        "documentCategory": "interim-report",
        "formType": null,
        "date": "2025-05-29",
        "description": "This document is the Form 10-Q quarterly report filed by Zscaler, Inc. for the third fiscal quarter ended April 30, 2025. It includes unaudited condensed consolidated financial statements such as balance sheets, statements of operations, comprehensive income, 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 other information relevant to the quarter. The filing provides detailed financial data, forward-looking statements, and regulatory compliance information for investors and the SEC.",
        "fiscalQuarter": 3,
        "fiscalYear": 2025,
        "companyName": "Zscaler, Inc.",
        "tickers": [
          "ZS"
        ],
        "metadata": null
      }
    },
    {
      "content": "## 31\n\n### 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. Our dollar-based net retention rate\nmay fluctuate due to a number of factors, including the performance of our cloud platform, our success in selling bigger deals,\nincluding deals for all employees with our higher-end bundles, selling multiple-pillars from the start of our contract with new\ncustomers, faster upsells within a year, the timing and the rate of ARR expansion of our existing\n31",
      "pageNumber": 41,
      "excerpt": null,
      "documentMetadata": {
        "id": "eaf63939-0da6-4fc7-ba06-adbd46e546a9",
        "documentCategory": "interim-report",
        "formType": null,
        "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"
        ],
        "metadata": null
      }
    }
  ]
}
You can then use the relevant chunks as context for AI-generated responses, and even combine them with context from other sources—such as internal data or structured databases.

Example 4: AI Agent Response

Captide enables you to get answers to any question grounded in information from corporate disclosures with full traceability. This allows you to instantly extract insights and metrics from millions of financial filings, or to build multi-agent systems that accelerate and enhance investment research. Below is an example query submitted to Captide’s AI agent.
curl --request POST \
  --url 'https://rest-api.captide.co/api/v1/rag/agent-response?query=Provide%20the%20net%20dollar%20retention%20of%20ZScaler%20for%20the%20last%20two%20quarters' \
  --header 'X-API-Key: YOUR_API_KEY'
The response includes the final answer in the content field, along with source identifiers (formatted as #abcd1234) embedded within the text. These identifiers link to the sourceMap, allowing each part of the answer to be traced back to the original document excerpts used.
{
  "content": "Zscaler's dollar-based net retention rate for the last two quarters was as follows:\n\n- Q3 2025 (trailing 12 months ended April 30, 2025): **114%** [#207d0044]\n- Q2 2025 (trailing 12 months ended January 31, 2025): **115%** [#eaf60040]\n\nThis indicates a slight sequential decrease in net dollar retention over the past two quarters.",
  "sourceMap": {
    "#eaf60040": {
      "content": "## 31\n\n### 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. Our dollar-based net retention rate\nmay fluctuate due to a number of factors, including the performance of our cloud platform, our success in selling bigger deals,\nincluding deals for all employees with our higher-end bundles, selling multiple-pillars from the start of our contract with new\ncustomers, faster upsells within a year, the timing and the rate of ARR expansion of our existing\n31",
      "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",
        "formType": null,
        "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"
        ],
        "metadata": null
      }
    },
    "#207d0044": {
      "content": "## 34\n\n### 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 11, 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 April 30, 2025 and 2024, the dollar-based net retention rate was 114% and\n116%, 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. Our dollar-based net retention rate\nmay fluctuate due to a number of factors, including the performance of our cloud platform, our success in selling bigger deals,\nincluding deals for all employees with our higher-end bundles, selling multiple-pillars from the start of our contract with new\ncustomers, faster upsells within a year, the timing and the rate of ARR expansion of our existing\n34",
      "pageNumber": 45,
      "excerpt": "For the trailing 12 months ended April 30, 2025 and 2024, the dollar-based net retention rate was 114% and 116%, respectively.",
      "documentMetadata": {
        "id": "207db5da-c2bb-42b8-a0d3-1a5d508e723c",
        "documentCategory": "interim-report",
        "formType": null,
        "date": "2025-05-29",
        "description": "This document is the Form 10-Q quarterly report filed by Zscaler, Inc. for the third fiscal quarter ended April 30, 2025. It includes unaudited condensed consolidated financial statements such as balance sheets, statements of operations, comprehensive income, 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 other information relevant to the quarter. The filing provides detailed financial data, forward-looking statements, and regulatory compliance information for investors and the SEC.",
        "fiscalQuarter": 3,
        "fiscalYear": 2025,
        "companyName": "Zscaler, Inc.",
        "tickers": [
          "ZS"
        ],
        "metadata": null
      }
    }
  }
}
The sourceMap can be integrated with Captide’s Document Auditing SDK to render relevant content chunks in frontend applications, enabling accurate source auditing.

Example 5: Streaming AI Agent Response

The /rag/agent-response-stream endpoint streams Captide’s AI agent responses in real time using Server-Sent Events (SSE). It’s useful in chat interfaces where you want to show the agent’s reasoning steps and display the response as it’s being generated, rather than waiting for the full message.
curl --request POST \
  --url 'https://rest-api.captide.co/api/v1/rag/agent-response?query=Provide%20the%20net%20dollar%20retention%20of%20ZScaler%20for%20the%20last%20two%20quarters' \
  --header 'X-API-Key: YOUR_API_KEY'
The SSE stream response contains the following event types:
  • thinking events – Indicate the agent’s internal progress and reasoning stages (e.g., searching, analyzing).
  • message/partial events – Stream the response incrementally, sending words or phrases as they’re generated.
  • metadata event – Provides associated document metadata, source links, and citations.
event: thinking
data: {"type": "message", "role": "assistant", "content": "I'm going to look through 2 documents from Zscaler, Inc.: To find the net dollar retention for the last two quarters, I need to look at the most recent interim (quarterly) reports, as these typically contain key financial metrics such as net dollar retention. The two most recent interim reports are from May 29, 2025, and March 10, 2025, which correspond to the last two reported quarters. These documents are the most likely to contain the requested information.", "stage": "search"}

event: thinking
data: {"type": "message", "role": "assistant", "content": "I'm now analyzing 2 documents to find the most relevant information...", "stage": "document_inspection"}

event: thinking
data: {"type": "message", "role": "assistant", "content": "I found 2 relevant pages from Zscaler, Inc.", "stage": "document_inspection"}

event: message/partial
data: {"type": "message", "role": "assistant", "content": "Z"}

event: message/partial
data: {"type": "message", "role": "assistant", "content": "sc"}

event: message/partial
data: {"type": "message", "role": "assistant", "content": "aler"}

event: message/partial
data: {"type": "message", "role": "assistant", "content": "'s"}

...

event: message/partial
data: {"type": "message", "role": "assistant", "content": "."}

event: metadata
data: {"type": "sources", "content": {"#207d0044": {"content": "## 34\n\n### 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 11, 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 April 30, 2025 and 2024, the dollar-based net retention rate was 114% and\n116%, 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. Our dollar-based net retention rate\nmay fluctuate due to a number of factors, including the performance of our cloud platform, our success in selling bigger deals,\nincluding deals for all employees with our higher-end bundles, selling multiple-pillars from the start of our contract with new\ncustomers, faster upsells within a year, the timing and the rate of ARR expansion of our existing\n34", "pageNumber": 45, "excerpt": "For the trailing 12 months ended April 30, 2025 and 2024, the dollar-based net retention rate was 114% and 116%, respectively.", "documentMetadata": {"id": "207db5da-c2bb-42b8-a0d3-1a5d508e723c", "documentCategory": "interim-report", "formType": null, "date": "2025-05-29", "description": "This document is the Form 10-Q quarterly report filed by Zscaler, Inc. for the third fiscal quarter ended April 30, 2025. It includes unaudited condensed consolidated financial statements such as balance sheets, statements of operations, comprehensive income, 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 other information relevant to the quarter. The filing provides detailed financial data, forward-looking statements, and regulatory compliance information for investors and the SEC.", "fiscalQuarter": 3, "fiscalYear": 2025, "companyName": "Zscaler, Inc.", "tickers": ["ZS"], "metadata": null}}, "#eaf60040": {"content": "## 31\n\n### 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. Our dollar-based net retention rate\nmay fluctuate due to a number of factors, including the performance of our cloud platform, our success in selling bigger deals,\nincluding deals for all employees with our higher-end bundles, selling multiple-pillars from the start of our contract with new\ncustomers, faster upsells within a year, the timing and the rate of ARR expansion of our existing\n31", "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", "formType": null, "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"], "metadata": null}}}}
All message/partial events can be combined to reconstruct the full response and, as with the /rag/agent-response endpoint, the final metadata event can be used with Captide’s Document Auditing SDK to display relevant content chunks in frontend applications, enabling accurate source traceability and auditing.

Using the Document Auditing JavaScript SDK

Installation

Install the Captide SDK in your project:
npm install captide
# or
yarn add captide

Integration Example

Here’s how to integrate the document viewer into your React application:
import React from 'react';
import { DocumentViewer, DocumentViewerProvider, useDocumentViewer } from 'captide';

// Function to fetch document content from your backend that calls our API
const fetchDocument = async (sourceLink) => {
  const response = await fetch('/your-backend/document', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ source_link: sourceLink })
  });
  
  return response.json();
};

// Example component using the DocumentViewer
function App() {
  return (
    <DocumentViewerProvider fetchDocumentFn={fetchDocument}>
      <DocumentViewerDemo />
    </DocumentViewerProvider>
  );
}

function DocumentViewerDemo() {
  const { loadDocument } = useDocumentViewer();
  
  // IMPORTANT: sourceLink and elementId come from your API response
  // - sourceLink: The 'sourceLink' field from the id_mapping in the streaming response
  //   or the 'source_link' field in the chunks response
  // - elementId: The element ID reference (like '#a060daba') from either the streaming 
  //   or chunks response that you want to highlight
  const handleSourceLinkClick = async (sourceLink, elementId) => {
    // Load document and highlight specific element
    await loadDocument(sourceLink, elementId);
  };
  
  return (
    <div>
      <button 
        onClick={() => handleSourceLinkClick(
          'https://rest-api.captide.co/api/v1/document?source_type=10-Q&document_id=69443120-e3a3-4ebb-91b1-a55ff2afe141',
          '#ab12ef34'
        )}
      >
        View Source
      </button>
      
      <div style={{ height: '600px', width: '100%', border: '1px solid #ccc' }}>
        <DocumentViewer />
      </div>
    </div>
  );
}

export default App;
For a live example of Captide in action, visit app.captide.co/chat.

Next Steps