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

**1. Upload Document**

Upload your document using the [upload endpoint](https://docs.tableflow.com/api-reference/upload-file.md)

**2. Processing**

TableFlow processes your document using the specified template

**3. Retrieve Data**

Get the extracted data using the [extraction endpoint](https://docs.tableflow.com/api-reference/get-extraction.md)

**4. Access Tables**

Retrieve table data using the [table rows endpoint](https://docs.tableflow.com/api-reference/get-extraction-table-rows.md)

## 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](https://docs.tableflow.com/webhooks.md).

## Next Steps

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.