> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensorlake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration Guide

> End-to-end guide to integrating Tensorlake Document Ingestion with your existing workflows via the HTTP APIs — upload, parse, and retrieve results.

You can integrate Tensorlake Document Ingestion with your existing workflows by using the HTTP APIs.

<Steps>
  <Step title="Call the parse endpoint">
    The [parse](/api-reference/v2/parse/parse) endpoint will create a parse job with the following request payload:

    * A file source, which can be:
      * A `file_id` returned from [uploading a file to Tensorlake Cloud](/api-reference/v2/files/upload).
      * A `file_url` that points to a publicly accessible file.
    * Options for parsing. See the [parse settings below](/document-ingestion/parsing/read#explore-main-configuration-options).
    * `page_range`: The range of pages to parse, ex: `1-2` or `1,3,5`. By default, all pages will be parsed.
    * `labels`: Metadata to identify the parse request. The labels are returned along with the parse response.

    The endpoint will return:

    * `parse_id`: The unique ID Tensorlake uses to reference the specific parsing job. This ID can be used to get the output when the parsing job is completed and re-visit previously used settings.
  </Step>

  <Step title="Query the status of the parsing job">
    The [`/parse/{parse_id}`](/api-reference/v2/parse/get) endpoint will return:

    * `status`: The status of the parsing job. This can be `failure`, `pending`, `processing`, or `successful`.
    * If the parsing job is `pending` or `processing`, you should wait a few seconds and then check again by re-calling the endpoint.
  </Step>

  <Step title="Retrieve the parsed result">
    When the parsing job is `successful`, you can retrieve the parsed result by calling the [`/parse/{parse_id}`](/api-reference/v2/parse/get) endpoint.
    The response payload will include an [`Response` object](/api-reference/v2/parse/get):

    * `chunks`: An array of objects that contain a chunk number (specified by the chunk strategy) and the markdown content for that chunk.
    * `pages`: A JSON representation of each page’s visual structure, including page dimensions, bounding boxes for each element (text, tables, figures, signatures), and the reading order.
    * `labels`: Labels associated with the parse job.
  </Step>
</Steps>

<img src="https://mintcdn.com/tensorlake-35e9e726/fVE8-oNRlpqs-U2A/images/document-ingestion/upload-and-parse-simplified.png?fit=max&auto=format&n=fVE8-oNRlpqs-U2A&q=85&s=a617cfadf05d3a3f6fcf1f7adf14d432" alt="The complete upload, parse, and get results flow" width="1440" height="860" data-path="images/document-ingestion/upload-and-parse-simplified.png" />

The APIs to support this workflow are:

<Columns cols={2}>
  <Card title="Files" href="/document-ingestion/file-management/overview">
    File Management endpoints to upload, list, and delete files.
  </Card>

  <Card title="Parse" href="/document-ingestion/parsing/read">
    Parse endpoints to parse uploaded Documents or any remote file.
  </Card>
</Columns>

## Webhooks

You can also use the [Webhooks API](/webhooks/overview) to receive
notifications when a parse job is completed. This is an alternative to polling for parse responses.
