GET
/
documents
/
v2
/
files
/
{file_id}
/
metadata
cURL
curl --request GET \
  --url https://api.tensorlake.ai/documents/v2/files/{file_id}/metadata \
  --header 'Authorization: Bearer <token>'
{
  "file_id": "file_12345",
  "file_name": "example.pdf",
  "mime_type": "application/pdf",
  "file_size": 100000,
  "checksum_sha256": "d3242c5c1d369d233fa65183bdd4c486eba109ceb13490ed291384eaffbe743b",
  "created_at": "2023-10-01T12:00:00Z",
  "labels": "{\"label1\": \"value1\", \"label2\": \"value2\"}"
}
Get the metadata of a specific file in the Tensorlake Cloud. This endpoint allows you to retrieve detailed information about a file, including its ID, name, size, type, and any associated labels.

Authorizations

Authorization
string
header
required

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

Path Parameters

file_id
string
required

The public ID of the file to retrieve metadata for the file. Only files created with the V2 API will be returned.

Response

Information about the uploaded file

file_id
string
required

The ID of the file

This ID is used to reference the file in parse, datasets, and other operations.

Example:

"file_12345"

mime_type
enum<string>
required

The content type of the file.

This is determined from the multipart form data, or from the file extension.

Available options:
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
file_size
integer
required

The file size in bytes.

This is determined from the Content-Length header of the request, or from the file metadata.

This is not guaranteed to be accurate, as the file may be compressed or encoded in a way that changes its size.

Required range: x >= 0
Example:

100000

checksum_sha256
string
required

The SHA256 checksum of the file.

This is calculated from the file content and is used to verify the integrity of the file.

Example:

"d3242c5c1d369d233fa65183bdd4c486eba109ceb13490ed291384eaffbe743b"

created_at
string
required

The creation date and time of the file.

This is in RFC 3339 format.

Example:

"2023-10-01T12:00:00Z"

file_name
string | null

The name of the file.

This is taken from the multipart form data or the file metadata.

It is not guaranteed to be unique, and it may not match the original file name.

Example:

"example.pdf"

labels
object

Labels submitted at the time of file upload.

This is a map of label names to their values.

Example:

"{\"label1\": \"value1\", \"label2\": \"value2\"}"