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.
| Operation | Input | Credits | Result |
|---|---|---|---|
| document.extract_tables | PDF up to 50 MB; DOCX or PPTX up to 25 MB | 10 per started 100 pages | tables file, tableTitles, summary |
Input
uploadIdstringrequiredUpload of a PDF, DOCX or PPTX file.
customInstructionsstringoptionalWhich tables to keep or how to shape them, up to 2000 characters.
webhookUrlstringoptionalPublic 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
| Status | Code | When |
|---|---|---|
| 400 | invalid_input | A field is missing, unknown or out of range, or the upload is not yours. |
| 400 | unsupported_file | The operation does not take this file type. |
| 400 | file_too_large | PDF over 50 MB, office or spreadsheet file over 25 MB, or image over 10 MB. |
| 400 | unreadable_document | The document's pages could not be counted. |
| 402 | insufficient_credits | The wallet, or a test key's spend cap, does not cover the estimate. |
| 409 | conflict | The Idempotency-Key was already used with a different input or operation. |
| errorCode | Meaning |
|---|---|
| failed | The worker could not finish the job. |
| missing_output | The worker finished but returned none of the expected output. |
| enqueue_failed | The job could not be handed to the worker. Retry with a new Idempotency-Key. |