Files API

Download

View as Markdown

Get file content

/v1/files/{file_id}/content

Download file content as a stream of byte chunks. Unlike DownloadFile which returns a presigned URL, this streams the raw bytes directly.

Path parameters

file_id

string

required

file_id of the file to download.

Query parameters

team_id

string

team_id of the team that owns the file. If not provided, the team ID will be derived from your request credentials.

format

string

Format of the downloaded content. ORIGINAL (default): raw file bytes. TEXT: extracted/converted text content. - DOWNLOAD_FORMAT_ORIGINAL: Download the original file. - DOWNLOAD_FORMAT_TEXT: Default: download as extracted text.

page_number

integer

Page number to download (1-indexed). Only applicable for TEXT format with multi-page documents (e.g., PDFs). If not provided, returns all pages concatenated.

Response Body

result

object

Response message for streaming file content (streamed).

error

object


Deprecated: Use Get file content instead, which streams raw bytes directly without exposing presigned URLs. See the guide examples in Managing Files.

Download a file (deprecated)

/v1/files:download

Deprecated: Use DownloadFileContent instead, which streams raw bytes without exposing presigned GCS URLs.

Request Body

Response Body

presigned_url

string

Presigned URL for downloading the file. Empty when content is returned directly (e.g., for transformed text).

expires_in_seconds

string

Duration in seconds until the URL expires. Zero when content is returned directly.

content

string

Direct content for text format downloads. When present, presigned_url will be empty and this contains the file content.


Did you find this page helpful?