Skip to content
Get started

Files

Upload File
client.files.create(FileCreateParams { file, purpose, organization_id, 2 more } params, RequestOptionsoptions?): FileCreateResponse { id, name, project_id, 5 more }
POST/api/v1/beta/files
Query Files
Deprecated
client.files.query(FileQueryParams { organization_id, project_id, filter, 3 more } params, RequestOptionsoptions?): FileQueryResponse { items, next_page_token, total_size }
POST/api/v1/beta/files/query
List Files
client.files.list(FileListParams { external_file_id, file_ids, file_name, 5 more } query?, RequestOptionsoptions?): PaginatedCursor<FileListResponse { id, name, project_id, 5 more } >
GET/api/v1/beta/files
Delete File
client.files.delete(stringfileID, FileDeleteParams { organization_id, project_id } params?, RequestOptionsoptions?): void
DELETE/api/v1/beta/files/{file_id}
Read File Content
client.files.get(stringfileID, FileGetParams { expires_at_seconds, organization_id, project_id } query?, RequestOptionsoptions?): PresignedURL { expires_at, url, form_fields }
GET/api/v1/beta/files/{file_id}/content
ModelsExpand Collapse
File { id, name, project_id, 11 more }

Schema for a file.

id: string

Unique identifier

formatuuid
name: string
project_id: string

The ID of the project that the file belongs to

formatuuid
created_at?: string | null

Creation datetime

formatdate-time
data_source_id?: string | null

The ID of the data source that the file belongs to

formatuuid
expires_at?: string | null

The expiration date for the file. Files past this date can be deleted.

formatdate-time
external_file_id?: string | null

The ID of the file in the external system

file_size?: number | null

Size of the file in bytes

minimum0
file_type?: string | null

File type (e.g. pdf, docx, etc.)

maxLength3000
minLength1
last_modified_at?: string | null

The last modified time of the file

formatdate-time
permission_info?: Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null> | null

Permission information for the file

Accepts one of the following:
Record<string, unknown>
Array<unknown>
string
number
boolean
purpose?: string | null

The intended purpose of the file (e.g., 'user_data', 'parse', 'extract', 'split', 'classify')

resource_info?: Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null> | null

Resource information for the file

Accepts one of the following:
Record<string, unknown>
Array<unknown>
string
number
boolean
updated_at?: string | null

Update datetime

formatdate-time
FileCreate { name, data_source_id, external_file_id, 5 more }

Schema for creating a file.

name: string

Name that will be used for created file. If possible, always include the file extension in the name.

maxLength3000
minLength1
data_source_id?: string | null

The ID of the data source that the file belongs to

formatuuid
external_file_id?: string | null

The ID of the file in the external system

file_size?: number | null

Size of the file in bytes

minimum0
last_modified_at?: string | null

The last modified time of the file

formatdate-time
permission_info?: Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null> | null

Permission information for the file

Accepts one of the following:
Record<string, unknown>
Array<unknown>
string
number
boolean
resource_info?: Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null> | null

Resource information for the file

Accepts one of the following:
Record<string, unknown>
Array<unknown>
string
number
boolean
storage_type?: "ephemeral" | "permanent" | (string & {})

Storage type for the file. Valid values: 'Ephemeral', 'Permanent' (no expiration). If not specified, defaults to permanent storage.

Accepts one of the following:
"ephemeral" | "permanent"
"ephemeral"
"permanent"
(string & {})
PresignedURL { expires_at, url, form_fields }

Schema for a presigned URL.

expires_at: string

The time at which the presigned URL expires

formatdate-time
url: string

A presigned URL for IO operations against a private file

minLength1
formaturi
form_fields?: Record<string, string> | null

Form fields for a presigned POST request