Read File
POST/v1/files/:file_id/read
What a file says, one bounded page at a time; never the file's bytes.
By kind:
table(CSV, Excel):sheets, each with itsname,rowCount,columnswith an inferredtype(integer, number, boolean, date, datetime, text) and a page ofrows.sheetnarrows a workbook to one sheet;headerRownames the row that holds the column names when it is not the first.text(Word, PowerPoint, plain text): a page of the text, withtotalCharsandhasMore.ocr(a photo, a scan, a screenshot, a PDF):ocrholds the reading of a vision model, as data:pages(the text),tables(header and rows) andfields(dates, amounts, totals, names, typed). The first read of a picture runs the model, chosen as the cheapest that can see among the model sets the account offers, and is billed in credits like an assistant model call (402no_creditswhen the account has none); the reading is kept with the file, and every later read answers it at no cost (cached: true). Withocr: falseonly a kept reading is answered. OCR reads images: a PDF is answered withstatus: unavailableand how to read its pages as images.
offset and limit page rows (20 by default, at most 500) or
characters (20000 by default, at most 100000). Needs the right to see the
file: its folder's datasets, or having uploaded it. A sheet that is not in
the workbook is 422 sheet_not_found, naming the sheets that are.
Request
Responses
- 200
- 403
- 404
- 422
Successful Response
error is feature_not_offered: files are not included for this account (feature is files), or the target is the account's capture folder and capture is not included (feature is capture). An account admin can switch either on.
Not found
Validation Error