Skip to content
Get started

Upload a file

files.upload(FileUploadParams**kwargs) -> File
POST/v1/files

Upload an Excel spreadsheet file for later processing.

Supported formats:

  • Excel (.xlsx)

Maximum file size: 100 MB

ParametersExpand Collapse
file: FileTypes

The spreadsheet file to upload

ReturnsExpand Collapse
class File:

Response representing an uploaded file.

This is returned from POST (upload), GET (retrieve), and list endpoints.

id: str

The unique identifier for this file.

content_type: str

The MIME type of the file.

maxLength255
created_at: datetime

The timestamp when the file was uploaded.

formatdate-time
file_name: str

The original filename of the uploaded file.

maxLength255
object: Literal["file"]

The object type, which is always 'file'.

size: int

The size of the file in bytes.

minimum0

Upload a file

import os
from deeptable import DeepTable

client = DeepTable(
    api_key=os.environ.get("DEEPTABLE_API_KEY"),  # This is the default and can be omitted
)
file = client.files.upload(
    file=b"Example data",
)
print(file.id)
{
  "id": "file_01kfxgjd94fn9stqm414vjb0s8",
  "content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  "created_at": "2024-01-15T10:30:00Z",
  "file_name": "financial_report.xlsx",
  "object": "file",
  "size": 1048576
}
Returns Examples
{
  "id": "file_01kfxgjd94fn9stqm414vjb0s8",
  "content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  "created_at": "2024-01-15T10:30:00Z",
  "file_name": "financial_report.xlsx",
  "object": "file",
  "size": 1048576
}