Skip to content
Get started

List files

client.Files.List(ctx, query) (*CursorIDPage[File], error)
GET/v1/files

List all files uploaded by the current user.

ParametersExpand Collapse
query FileListParams
After param.Field[string]optional

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

Limit param.Field[int64]optional

Maximum number of files to return.

formatint32
maximum100
minimum1
ReturnsExpand Collapse
type File struct{…}

Response representing an uploaded file.

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

ID string

The unique identifier for this file.

ContentType string

The MIME type of the file.

maxLength255
CreatedAt Time

The timestamp when the file was uploaded.

formatdate-time
FileName string

The original filename of the uploaded file.

maxLength255
Object File

The object type, which is always 'file'.

Size int64

The size of the file in bytes.

minimum0

List files

package main

import (
  "context"
  "fmt"

  "github.com/deeptable-com/deeptable-go"
  "github.com/deeptable-com/deeptable-go/option"
)

func main() {
  client := deeptable.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.Files.List(context.TODO(), deeptable.FileListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "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"
}