> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://ibkrcampus.com/docs/web-api/flex-web-service/using-flex-web-service/llms.txt. # Using Flex Web Service ## Docs - [Generate a Report](https://ibkrcampus.com/docs/web-api/flex-web-service/using-flex-web-service/generate-the-report.md) - [Retrieve the Report](https://ibkrcampus.com/docs/web-api/flex-web-service/using-flex-web-service/retrieve-the-report.md) > **Note:** This page contains both a page directory (above) and the landing page content (below). The page directory is generated for agent use and does not appear on the landing page. > For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://ibkrcampus.com/docs/web-api/flex-web-service/using-flex-web-service/llms.txt. # Introduction The Flex Web Service API consists of two endpoints. Obtaining Flex Query reports via the Flex Web Service API is a two-step workflow involving requests to both endpoints in sequence. First, you will make a request to trigger IB's backend to generate an instance of your report, which will populate your Flex Query template with the available data. In response, you'll receive a reference code identifying this particular instance of the report. Next, you'll make a request to fetch the generated report using the reference code. Note that all requests must include a User-Agent header.