Skip to content
Get started

List files

client.files.list(FileListParams { after, limit } query?, RequestOptionsoptions?): CursorIDPage<File { id, content_type, created_at, 3 more } >
GET/v1/files

List all files uploaded by the current user.

ParametersExpand Collapse
query: FileListParams { after, limit }
after?: string | null

A cursor for pagination. Use the last_id from a previous response to fetch the next page.

limit?: number

Maximum number of files to return.

formatint32
maximum100
minimum1
ReturnsExpand Collapse
File { id, content_type, created_at, 3 more }

Response representing an uploaded file.

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

id: string

The unique identifier for this file.

content_type: string

The MIME type of the file.

maxLength255
created_at: string

The timestamp when the file was uploaded.

formatdate-time
file_name: string

The original filename of the uploaded file.

maxLength255
object: "file"

The object type, which is always 'file'.

size: number

The size of the file in bytes.

minimum0

List files

import DeepTable from '@deeptable/deeptable';

const client = new DeepTable({
  apiKey: process.env['DEEPTABLE_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const file of client.files.list()) {
  console.log(file.id);
}
{
  "data": [
    {
      "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
    }
  ],
  "has_more": false,
  "object": "list",
  "first_id": "file_01kfxgjd94fn9stqm414vjb0s8",
  "last_id": "file_01kfxgjd94fn9stqm414vjb0s8"
}
Returns Examples
{
  "data": [
    {
      "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
    }
  ],
  "has_more": false,
  "object": "list",
  "first_id": "file_01kfxgjd94fn9stqm414vjb0s8",
  "last_id": "file_01kfxgjd94fn9stqm414vjb0s8"
}