PUT
/
documents
/
v2
/
files
cURL
curl --request PUT \
  --url https://api.tensorlake.ai/documents/v2/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'labels={
  "owner": "JohnDoe",
  "project": "Tensorlake"
}'
{
  "file_id": "file_12345",
  "created_at": "2023-10-01T12:00:00Z"
}

This operation allows you to upload a file to the Tensorlake Cloud. The file will be associated with the project specified by the API key used in the request.

The file can be of any of the following types:

  • PDF
  • Word (DOCX)
  • Spreadsheets (XLS, XLSX, XSLM, CSV)
  • Presentations (PPTX, Apple Keynote)
  • Images (PNG, JPG, JPEG)
  • Raw text (plain text, HTML)

The file type is automatically detected based on Content-Type header. In case the Content-Type header is not provided, the file extension will be used to infer the type. If the file type cannot be determined, it will default to application/octet-stream.

We only keep one copy of the file, so uploading the same file multiple times will return the same file_id.

Labels

Labels can be added to the file to help categorize the parse jobs associated with it. Labels are key-value pairs that can be used to filter and organize files.

These should be provided in the a labels text field in the multipart form data.

Labels are optional, but they can be very useful for organizing and managing parse jobs.

Limits

There is an upload limit of 1 GB per file. If you need to upload larger files, please reach out to us at support@tensorlake.ai.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data

Response

200
application/json

File uploaded successfully

The response is of type object.