The TableFlow API enables you to integrate AI-powered document extraction with your applications and systems. This section covers the key endpoints, authentication, and usage patterns.

Base URL

All API requests should be made to:

https://api.tableflow.com/v2

Authentication

TableFlow uses API keys for authentication. You can generate API keys in your workspace settings.

All API requests must include an Authorization header with your API key:

curl -X GET https://api.tableflow.com/v2/extractions \
  -H "Authorization: Bearer YOUR_API_KEY"

Content Types

The API accepts and returns JSON for most endpoints. For file uploads, use multipart/form-data.

  • For JSON requests: Content-Type: application/json
  • For file uploads: Content-Type: multipart/form-data

Key Endpoints

EndpointMethodDescription
/extractions/uploadPOSTUpload a document for extraction
/extractions/{id}GETGet extraction data
/extractions/{id}/tables/{tableKey}/rowsGETGet table rows from an extraction
/extractions/{id}/tables/{tableKey}/downloadGETDownload table data as CSV
/extractions/{id}/download-originalGETDownload the original document

Pagination

For endpoints that return collections of items, TableFlow supports pagination with the following parameters:

  • offset - Number of items to skip (default: 0)
  • limit - Maximum number of items to return (default: 100, max: 1000)
curl -X GET https://api.tableflow.com/v2/extractions/{id}/tables/{tableKey}/rows?offset=100&limit=50 \
  -H "Authorization: Bearer YOUR_API_KEY"

Paginated responses include pagination metadata:

{
  "pagination": {
    "offset": 100,
    "limit": 50,
    "total": 250,
    "next_offset": 150
  },
  "rows": [
    // Row data...
  ]
}

Errors

When an error occurs, the API returns an error response with details:

{
  "error": "Invalid parameters",
  "message": "The parameter 'template_id' is required"
}

Webhooks

TableFlow can send webhook notifications for extraction events. Learn more about webhooks.

Example: Complete Extraction Flow

  1. Upload a document for extraction:
curl -X POST https://api.tableflow.com/v2/extractions/upload \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@./test.csv;type=text/csv" \
  -F "name=API Test File" \
  -F "metadata={\"metadata_key\": \"metadata_value\"}" \
  -F "template_id=dk4g1tUg1uHLs8YU"

You can also use auto as the template_id and TableFlow will select the best template based on the template’s allowed file types.

  1. Retrieve extraction data:
curl -X GET https://api.tableflow.com/v2/extractions/uT2bJNWN75YPU95r \
  -H "Authorization: Bearer YOUR_API_KEY"

Field data will be included, but table rows need to be retrieved through /extractions/{id}/tables/{tableKey}/rows

  1. Download table data as CSV:
curl -X GET https://api.tableflow.com/v2/extractions/uT2bJNWN75YPU95r/tables/line_items/download \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --output line_items.csv

API Reference

Explore the detailed documentation for each endpoint in the sections below.