> ## 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.

# Extractions API

> Extract structured data from documents using AI

The Extractions API allows you to upload documents and extract structured data using AI-powered templates. TableFlow supports various document types including PDFs, images, spreadsheets, and more.

## Key Features

* **Multi-format support**: Extract from PDFs, images (PNG, JPG), spreadsheets (CSV, Excel), and documents
* **Template-based extraction**: Use pre-configured templates to define what data to extract
* **Automatic template selection**: Let TableFlow choose the best template for your document
* **Table detection**: Automatically detect and extract tables from documents
* **Field validation**: Built-in validation for extracted data

## Common Use Cases

* Invoice processing
* Purchase order extraction
* Form data extraction
* Spreadsheet data transformation
* Document digitization

## Extraction Workflow

<Steps>
  <Step title="Upload Document">
    Upload your document using the [upload endpoint](/api-reference/upload-file)
  </Step>

  <Step title="Processing">
    TableFlow processes your document using the specified template
  </Step>

  <Step title="Retrieve Data">
    Get the extracted data using the [extraction endpoint](/api-reference/get-extraction)
  </Step>

  <Step title="Access Tables">
    Retrieve table data using the [table rows endpoint](/api-reference/get-extraction-table-rows)
  </Step>
</Steps>

## Extraction Status

Extractions go through several status states:

* `processing` - The document is being processed
* `completed` - Extraction completed successfully
* `failed` - Extraction failed (check the error field)

## Webhooks

You can receive real-time notifications when extractions complete or fail. The webhook events are:

* `extraction.status.completed` - Fired when extraction completes successfully
* `extraction.status.failed` - Fired when extraction fails

Learn more in the [webhooks documentation](/webhooks).

## Next Steps

* [Upload a file](/api-reference/upload-file) to start extracting data
* [Get extraction details](/api-reference/get-extraction) to retrieve extracted fields
* [Download table data](/api-reference/download-table-data) as CSV
