Insights Studio

Table Extraction

Pull every table in a document into one XLSX workbook.

document.extract_tables finds the tables in a document and writes them to extracted_tables.xlsx, one sheet per table. The result also lists the table titles and a short summary. A document with no tables succeeds with an empty tableTitles list and no file.

OperationInputCreditsResult
document.extract_tablesPDF up to 50 MB; DOCX or PPTX up to 25 MB10 per started 100 pagestables file, tableTitles, summary

Input

uploadIdstringrequired

Upload of a PDF, DOCX or PPTX file.

customInstructionsstringoptional

Which tables to keep or how to shape them, up to 2000 characters.

webhookUrlstringoptional

Public HTTPS URL that receives signed job updates (top-level, next to operation). See Webhooks.

Code Example

curl -X POST https://api.transpera.io/v1/jobs \
  -H "authorization: Bearer tp_test_..." \
  -H "content-type: application/json" \
  -H "idempotency-key: $(uuidgen)" \
  -d '{
    "operation": "document.extract_tables",
    "input": {"uploadId":"UPLOAD_ID","customInstructions":"Only financial tables"}
  }'

Response

Result of a finished document.extract_tables job
{
  "job": {
    "id": "JOB_ID",
    "operation": "document.extract_tables",
    "status": "succeeded",
    "chargedCredits": 10,
    "result": {
      "type": "files",
      "data": { "summary": "Two tables were found.", "tableTitles": ["Revenue", "Costs"] },
      "files": [
        { "role": "tables", "fileName": "extracted_tables.xlsx", "url": "https://...", "expiresAt": "..." }
      ]
    }
  }
}

Errors

StatusCodeWhen
400invalid_inputA field is missing, unknown or out of range, or the upload is not yours.
400unsupported_fileThe operation does not take this file type.
400file_too_largePDF over 50 MB, office or spreadsheet file over 25 MB, or image over 10 MB.
400unreadable_documentThe document's pages could not be counted.
402insufficient_creditsThe wallet, or a test key's spend cap, does not cover the estimate.
409conflictThe Idempotency-Key was already used with a different input or operation.
errorCodeMeaning
failedThe worker could not finish the job.
missing_outputThe worker finished but returned none of the expected output.
enqueue_failedThe job could not be handed to the worker. Retry with a new Idempotency-Key.