Perception reference

Format support

Which file types each document operation reads.

An operation refuses a file type it doesn't read with 422, code unsupported_file_type, when the job is created. How the document service tells the type depends on the source:

  • Uploaded files (workspace_file): when it's uploaded, from its extension, checked against its first bytes. A file whose bytes clearly say another type (a PDF named .bmp) is refused at upload with 422 unsupported_file_type. A file with no supported extension gets the type its bytes show, and one whose bytes are inconclusive, such as plain text, keeps its extension's type.
  • Links (url): from the extension of the source's file_name, since nothing has been downloaded yet. Name the file with an extension from the table below. The SDKs and the CLI take file_name from the URL when it ends in one; see Sources.
File typeExtensionsParseSplitClassifyExtractGround
PDF.pdf✅✅✅✅✅
Spreadsheet.xlsx .xlsm .xls .csv✅✅✅✅✅
Parquet.parquet✅❌✅✅✅
Word document.docx .doc .docm✅✅✅✅✅
Image.png .jpg .jpeg .tiff .tif .webp✅✅✅✅✅
Bitmap.bmp❌✅✅✅✅
Presentation.pptx .ppt✅✅✅✅✅
HTML.html .htm✅✅✅✅✅
Plain text.txt .log .xml✅✅✅✅✅
Diagram.vsdx .vsd✅✅✅✅✅
Markdown.md .mdx✅✅✅✅✅
JSON.json✅✅✅✅✅
JSON Lines.jsonl❌❌❌❌✅
Email.eml .msg .oft✅✅✅✅✅
Video.mp4 .mov .avi .mkv✅❌❌❌✅
Audio.mp3 .wav .m4a .flac .mpga .oga .ogg✅❌❌❌✅
  • Audio and video: Parse transcribes them. See Parse.
  • Markdown is read as it is, not OCR'd. Parse returns its text unchanged except for tables, which follow output.table_format: HTML by default, so pass "markdown" to keep pipe tables.
  • Large plain text: Parse reads .txt files up to 1 GiB and returns the complete text through document.content_url. Split, Extract and Ground read .txt files up to 256 MiB.