sources

Upload File To Source

Upload a file to a data source.

post/v1/sources/{source_id}/upload

Request

  • Base URL
    https://app.letta.com
  • URL
    https://app.letta.com/v1/sources/{source_id}/upload
  • Auth
    HTTP bearer

Path parameters

source_idstring required

Query parameters

duplicate_handling'skip' | 'error' | 'suffix' | 'replace'

How to handle duplicate filenames when uploading files

How to handle duplicate filenames

namestring nullable

Optional custom name to override the uploaded file's name

Request body multipart/form-data

filestring binary required

Response

Successful Response

source_idstring required

The unique identifier of the source associated with the document.

file_namestring nullable

The name of the file.

original_file_namestring nullable

The original name of the file as uploaded.

file_pathstring nullable

The path to the file.

file_typestring nullable

The type of the file (MIME type).

file_sizeinteger nullable

The size of the file in bytes.

file_creation_datestring nullable

The creation date of the file.

file_last_modified_datestring nullable

The last modified date of the file.

processing_status'pending' | 'parsing' | 'embedding' | 'completed' | 'error'
error_messagestring nullable

Optional error message if the file failed processing.

total_chunksinteger nullable

Total number of chunks for the file.

chunks_embeddedinteger nullable

Number of chunks that have been embedded.

contentstring nullable

Optional full-text content of the file; only populated on demand due to its size.

idstring

The human-friendly ID of the File

created_atstring date-time nullable

The creation date of the file.

updated_atstring date-time nullable

The update date of the file.

Example response

{
  "id": "file-123e4567-e89b-12d3-a456-426614174000"
}

Changes

No recorded changes to this operation across all 36 revisions of this API.