Using a file
When submitting a parse job to the dataset, you can provide the content of the file in one of three ways:file_id
: The ID of a file that has been previously uploaded to the Upload File endpoint. This is the most common method.file_url
: A publicly accessible URL that points to the file you want to parse. The API will download the file from this URL. Redirects are also supported, but the URL and theLocation
header must point to a file that is publicly accessible.raw_text
: Raw text content, if you want to perform structured extraction from non-file sources; such as emails, HTML, CSV, XML, etc.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
The ID of the dataset to parse
Body
- file_id
- file_url
- raw_text
File source - must be exactly one of: file_id, file_url, or raw_text
ID of the file previously uploaded to Tensorlake. Has tensorlake- (V1) or file_ (V2) prefix.
"file_abc123xyz"
Additional metadata to identify the parse request. The labels are returned in the parse response.
{ "priority": "high", "source": "email" }
Comma-separated list of page numbers or ranges to parse (e.g., '1,2,3-5'). Default: all pages.
"1-5,8,10"
Name of the file. Only populated when using file_id.
"document.pdf"
application/pdf
, application/vnd.openxmlformats-officedocument.wordprocessingml.document
, application/msword
, application/vnd.openxmlformats-officedocument.presentationml.presentation
, application/vnd.apple.keynote
, image/jpeg
, text/plain
, text/html
, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
, application/vnd.ms-excel.sheet.macroenabled.12
, application/vnd.ms-excel
, text/xml
, text/csv
, image/png
, application/octet-stream
Response
Dataset file parsed successfully
The unique identifier for the parse job.
Use this identifier to track the progress and results of the parse job
using the /documents/v2/parse/{parse_id}
endpoint.
This identifier is used to track the parse job's progress and results.
"parse_id-12345"
The date and time when the parse job was scheduled.
The date is in RFC 3339 format (e.g., "2023-10-01T12:00:00Z").
"2023-10-01T12:00:00Z"