Upload the file
SetUNSTRUCTURED_API_KEY using the API key setup and put document.pdf in your working directory. Upload uses the field name file.
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 thefile_id returned by Upload:
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. Readexpires_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.
