Insights Studio
AI Report
Turn a document or spreadsheet into an interactive report dashboard.
document.report reads a document or spreadsheet and builds a self-contained HTML dashboard: headline figures, charts and the analysis behind them. Download dashboard.html from the result and open it in a browser.
| Operation | Input | Credits | Result |
|---|---|---|---|
| document.report | PDF up to 50 MB; DOCX, XLSX, XLS or CSV up to 25 MB | Standard: 2 per PDF page, 2 per 3,000 DOCX characters, 100 per spreadsheet. Premium: double. | dashboard file, title and genre |
Input
uploadIdstringrequiredUpload of a PDF, DOCX, XLSX, XLS or CSV file.
targetLanguagestringoptionaldefault: EnglishLanguage of the report, as a name or code. Same list as translation.
tonestringoptionaldefault: professionalWriting style of the report.
detailLevelstringoptionaldefault: standardHow much the report covers.
modelstringoptionaldefault: standardModel tier. Premium costs twice as much.
customInstructionsstringoptionalWhat to focus on, 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.report",
"input": {"uploadId":"UPLOAD_ID","targetLanguage":"English","tone":"professional","detailLevel":"concise","model":"standard"}
}'Response
Result of a finished document.report job
{
"job": {
"id": "JOB_ID",
"operation": "document.report",
"status": "succeeded",
"chargedCredits": 6,
"result": {
"type": "files",
"data": { "title": "Launch Services Program", "genre": "technical fact sheet" },
"files": [
{ "role": "dashboard", "fileName": "dashboard.html", "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. |