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

# List Extractions

> Get a paginated list of extractions in your workspace

Retrieves a paginated list of extractions in your workspace. Returns a summary of each extraction including status, template, and file information.

## Usage Notes

* Results are ordered by creation date (newest first)
* Use `template_id` to filter extractions by a specific template
* For full extraction data including fields and tables, use the [Get Extraction](/api-reference/get-extraction) endpoint

## Request

<ParamField query="template_id" type="string">
  Filter extractions by a specific template ID.
</ParamField>

<ParamField query="limit" type="integer" default="100">
  Maximum number of extractions to return. Maximum value is 1000.
</ParamField>

<ParamField query="offset" type="integer" default="0">
  Number of extractions to skip for pagination.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.tableflow.com/v2/extractions?limit=50&offset=0" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const axios = require("axios");

  async function getExtractions(options = {}) {
    try {
      const response = await axios.get(
        "https://api.tableflow.com/v2/extractions",
        {
          params: {
            template_id: options.templateId,
            limit: options.limit || 100,
            offset: options.offset || 0,
          },
          headers: {
            Authorization: "Bearer YOUR_API_KEY",
          },
        }
      );
      return response.data;
    } catch (error) {
      console.error(error);
      throw error;
    }
  }

  // Example: list recent extractions
  getExtractions({ limit: 50 }).then((result) => {
    console.log(`Found ${result.total} extractions`);
    result.extractions.forEach((ext) => {
      console.log(`${ext.id} - ${ext.status} - ${ext.file_info.file_name}`);
    });
  });
  ```

  ```python Python theme={null}
  import requests

  def get_extractions(template_id=None, limit=100, offset=0):
      url = "https://api.tableflow.com/v2/extractions"
      headers = {
          "Authorization": "Bearer YOUR_API_KEY"
      }
      params = {
          "limit": limit,
          "offset": offset
      }
      if template_id:
          params["template_id"] = template_id

      response = requests.get(url, headers=headers, params=params)
      response.raise_for_status()

      return response.json()

  # Example: list recent extractions
  result = get_extractions(limit=50)
  print(f"Found {result['total']} extractions")

  for ext in result["extractions"]:
      print(f"{ext['id']} - {ext['status']} - {ext['file_info']['file_name']}")
  ```
</RequestExample>

## Response

<ResponseField name="extractions" type="array">
  Array of extraction summary objects.

  <Expandable title="extraction">
    <ResponseField name="id" type="string">
      The unique identifier for the extraction.
    </ResponseField>

    <ResponseField name="status" type="string">
      The current status of the extraction (`processing`, `completed`, or `failed`).
    </ResponseField>

    <ResponseField name="template_id" type="string">
      The ID of the template used for the extraction.
    </ResponseField>

    <ResponseField name="metadata" type="object">
      Custom metadata associated with the extraction.
    </ResponseField>

    <ResponseField name="created_at" type="integer">
      Unix timestamp when the extraction was created.
    </ResponseField>

    <ResponseField name="updated_at" type="integer">
      Unix timestamp when the extraction was last updated.
    </ResponseField>

    <ResponseField name="file_info" type="object">
      Basic information about the uploaded file.

      <Expandable title="file_info">
        <ResponseField name="file_name" type="string">
          The name of the uploaded file.
        </ResponseField>

        <ResponseField name="file_type" type="string">
          The file type key (e.g., `pdf`, `csv`, `xlsx`).
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of extractions matching the query.
</ResponseField>

<ResponseField name="limit" type="integer">
  The limit applied to this request.
</ResponseField>

<ResponseField name="offset" type="integer">
  The offset applied to this request.
</ResponseField>

<ResponseExample>
  ```json theme={null}
  {
    "extractions": [
      {
        "id": "uT2bJNWN75YPU95r",
        "status": "completed",
        "template_id": "JlLZVabDjYWzu7C9",
        "metadata": {
          "user_id": "123",
          "reference": "INV-2023-04-15"
        },
        "created_at": 1682366228,
        "updated_at": 1682366240,
        "file_info": {
          "file_name": "acme-invoice-apr2023.pdf",
          "file_type": "pdf"
        }
      },
      {
        "id": "xK9mPqR3vW7nB2cD",
        "status": "processing",
        "template_id": "JlLZVabDjYWzu7C9",
        "metadata": null,
        "created_at": 1682366300,
        "updated_at": 1682366300,
        "file_info": {
          "file_name": "quarterly-report.xlsx",
          "file_type": "xlsx"
        }
      }
    ],
    "total": 47,
    "limit": 100,
    "offset": 0
  }
  ```
</ResponseExample>
