Skip to main content
Upload is optional. Send a file directly to Parse or Extract for the shortest request; upload first when you want to reuse its file reference.

Upload the file

Set UNSTRUCTURED_API_KEY using the API key setup and put document.pdf in your working directory. Upload uses the field name file.
HTTP 200 returns file_id, mimetype, and expires_at. Save the returned file_id as FILE_ID. The following shape is illustrative, not a captured upload response:

Parse the uploaded file

Replace the placeholder with the file_id returned by Upload:
For direct Extract, replace its input field with file_id and retain schema. Continue using the same credential scope; a file ID is not a sharing link or a credential.

Handle expiry

The Upload API specifies 24 hours of temporary file storage. Read expires_at for the exact expiry of your file. If the file is unavailable or expired, upload the original document again and use the new ID. GET /api/v2/upload/{fileId} retrieves the file. DELETE /api/v2/upload/{fileId} deletes it early and returns HTTP 204, including when it is already absent. See Upload reference and retention.