Skip to main content
For a big file, ask for an upload address, send the file’s bytes to it, then parse the file with the uploadId. The file goes straight to the address as raw bytes, with no base64 and no JSON around it.

Upload and parse a file

Get an API key in the Quickstart. An upload needs an API key. This flow has three steps: get the address, PUT the file to it, and parse. The file is a small two-page PDF named report.pdf.

Read the response

The first call answers with the address to send the file to. uploadUrl is cut here, because it is a one-time address that you should not share.
uploadRef is the same value as uploadId. The PUT answers with an empty 200. The parse call answers like any other parse call. With pages set to true, it also returns each page.
The file is deleted when the parse ends, so each uploadId parses once. Parsing the same uploadId again returns 404 notFound.

Options

POST /v1/parse/upload-url takes these fields. POST /v1/parse takes uploadRef in place of file. Every other field works the same. See Parse documents and Formats.

Limits and errors

  • A file can be up to 36 MB (37,748,736 bytes).
  • Send the file to uploadUrl within 15 minutes of the call. After that, the address stops working.
  • Parse the file within 1 hour of getting the address. After that, the id stops working and parse returns 404 notFound with No upload with that id. An upload id works for one hour.
  • Parse before the PUT returns 400 invalidRequest with That file was not uploaded yet. PUT it to uploadUrl first.
  • A file over 36 MB returns 400 invalidRequest with This file is larger than 36 MB. Send a file of up to 36 MB. and the upload is deleted.
  • A parse that sends uploadRef without an API key returns 400 invalidRequest with An upload needs an API key.
  • Getting the address is free. The parse costs what any parse costs, and a failed parse costs nothing.