Skip to content

The Files Downloads API lets you fetch remote files into a server-side directory, monitor in-flight downloads, and review historical download activity. Use these endpoints to pull external content into the platform’s filesystem or audit past transfers.

Download a file from a remote URL to the server.

NameInTypeRequiredDescription
directorypathstringYesDestination directory
downloadquerystringYesURL to download from
filenamequerystringNoCustom filename for downloaded file
timeoutqueryintegerNoDownload timeout in seconds. Default: 300

This endpoint accepts no request body.

{
"success": true,
"download_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"filename": "renamed-data.csv",
"path": "/home/user/Downloads/renamed-data.csv",
"message": "Download started",
"error": null
}
const result = await client.files.downloads.fetch(
"Downloads",
"https://files.example.com/data.csv",
"renamed-data.csv",
600
);

Get progress of currently running downloads scoped to a single directory.

NameInTypeRequiredDescription
directorypathstringYesDirectory to scope the listing to
downloadsquerystringYesReserved query parameter — pass an empty string

This endpoint accepts no request body.

{
"downloads": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"directory": "Downloads",
"filename": "data.csv",
"file_path": "/home/user/Downloads/data.csv",
"url": "https://files.example.com/data.csv",
"current_size": 5242880,
"expected_size": 10485760,
"progress_percentage": 50.0,
"start_time": 1700000000,
"status": "downloading"
}
]
}
const active = await client.files.downloads.listActive("Downloads", "");

Get progress of currently running downloads across every directory.

This endpoint takes no parameters.

This endpoint accepts no request body.

{
"downloads": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"directory": "Downloads",
"filename": "data.csv",
"file_path": "/home/user/Downloads/data.csv",
"url": "https://files.example.com/data.csv",
"current_size": 5242880,
"expected_size": 10485760,
"progress_percentage": 50.0,
"start_time": 1700000000,
"status": "downloading"
}
]
}
const allActive = await client.files.downloads.listGlobal();

Get history of past downloads, including both completed and failed transfers.

NameInTypeRequiredDescription
download_historyquerystringYesReserved query parameter — pass an empty string

This endpoint accepts no request body.

{
"history": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"directory": "Downloads",
"filename": "data.csv",
"file_path": "/home/user/Downloads/data.csv",
"url": "https://files.example.com/data.csv",
"start_time": 1700000000,
"end_time": 1700000015,
"total_bytes": 10485760,
"status": "completed",
"error": null
}
]
}
const history = await client.files.downloads.getHistory("");