PDFs & Chart Finder
List the workspace PDFs with the pages that hold charts, and scan a file to get the chart frames and process diagrams it contains, with polling states.
GET /v1/chart-to-data/pdfs lists the workspace's PDFs, newest first, each file once. Documents with the same file content collapse into the newest, and the older ones are listed in copies, because inputs and runs follow the file and not the document. sha256 is the file hash when it is known. pages lists the pages that have stored inputs with the number of charts the page's latest inputs name, and found carries chart counts from the file's finished scan, or null until one ran.
GET /v1/chart-to-data/pdfs/{documentId}/charts is the chart finder. The first request for a file queues a scan on a worker, and the route answers at once with the charts that already have stored inputs (state: "ready"). While the scan runs, status is queued or running; when it is done, charts also lists every chart frame the scan found (state: "found") and diagrams lists the process diagrams read on the scanned pages. Poll until status is done or failed. A scan by an older engine, or one that failed for a transient reason, is queued again on the next request; a deterministic failure stays.
Each chart entry has the page_number, a box in PDF points with a top-left origin, its state, and an id that stays stable across rescans: the chart key when one is stored, else the page and frame corner. ready charts have stored inputs and a chart_key; found ones were only seen by the scan. title is the title from the chart's latest reading and is absent or null for a chart never read. The scan covers the first pages of the file up to a configured limit, and pages_scanned and page_count report how far it went.
/v1/chart-to-data/pdfsResponse fields (data[])
/v1/chart-to-data/pdfs/{documentId}/chartsResponse fields
Response: Scan done, one ready chart and one found chart
{
"document_id": "d0e4b7a2-3f19-4c68-9a05-b1c7e8f26d34",
"status": "done",
"error_code": null,
"error_message": null,
"page_count": 12,
"pages_scanned": 12,
"charts": [
{
"page_number": 4,
"box": { "x": 56.7, "y": 120.4, "width": 482.0, "height": 301.5 },
"state": "ready",
"chart_key": "p4-c1",
"id": "p4-c1",
"title": "Monthly output"
},
{
"page_number": 7,
"box": { "x": 56.7, "y": 98.0, "width": 482.0, "height": 340.2 },
"state": "found",
"chart_key": null,
"id": "p7-56.7-98.0",
"title": null
}
],
"diagrams": []
}nodes (id, label, kind, optional lane, boxes and evidence) and edges (from, to, kind, evidence). An edge is directed only when an arrowhead or the line order says which way the connection runs, and pipe diagrams add the drawn path as polylines of [x, y] points in PDF points. Otherwise directed is false.