Import via API - Video CDN [EN]
Importing files through the API is one of the most common and flexible ways to import content into the CDN. This method allows you to instruct the system to fetch a specific file from a provided location by sending an import request, essentially telling the CDN “download this file from here”.
The CDN supports several protocols for retrieving files, including http(s)|ftp|rsync(+ssh)|s3:
http[s]://[user:password@]host[:port]/path/to/file.mp4
ftp://[user:password@]host[:port]/path/to/file.mp4
rsync://[user:password@]host[:port]/path/to/file.mp4
rsync+ssh://user:password@host[:port]/path/to/file.mp4
s3://access-key:secret-access-key@endpoint.host/bucket/path/to/file.mp4See also
How to get Video CDN API credentials
Guide for getting api credentials
Guide for file import
Complete reference for all API methods
Verification
During the import process, the system verifies the integrity of each file. A size check is mandatory: the actual size of the file downloaded must match the value specified in the size parameter of the request.
Optionally, a sha-256 checksum can be provided via the chksum parameter for additional verification.
Settings overriding
When initiating an import via API, you can define custom delivery and protection settings for individual files. These per-file overrides allow you to fine-tune behavior without altering global configurations.
The following parameters can be used to override defaults:
protection— defines access control or security level specific to the filespeed— sets delivery speed limits, such as throttling playback to match video bitratebuffer— adjusts initial buffering behavior for smoother playback startup
These overrides are applied at the time of import and are bound to the specific file being processed, enabling granular control over how each asset is served through the CDN.
Prioritization of the import
When importing a large batch of files, there may be situations where a specific file needs to be downloaded and processed ahead of others. To handle this, the fetch_prio parameter can be used in the import request.
This parameter increases the priority of the file in the import queue, allowing the system to fetch and process it before lower-priority items. It’s especially useful for time-sensitive content or urgent updates that should be made available without waiting for the full batch to complete.
Reimport and duplications
If the file being added already exists in the system and is marked as “failed”, it will be automatically replaced without any restrictions.
However, if the existing file is not marked as failed, replacement is only allowed if the new import request includes a different size or chksum value. This makes system sure, that the file being added is not identical to the one already present.
To explicitly prevent overwriting an existing file, regardless of its state, you can use the no_replace parameter. When set to “true”, this option blocks the replacement of any file that is already present in the CDN.
Scripting
Not all users are comfortable writing code or working with APIs directly. Many prefer a solution that just works without involving developers. For these scenarios, we provide a ready-to-use helper script that enables push-based imports with minimal setup.
With this method, you simply download the script, specify the folder containing your files, and run it. The script automatically uploads all files from that folder to the CDN for distribution — no coding required, just a few basic settings.
This method works best for projects with a manageable number of files. For extremely large content volumes (e.g., hundreds of terabytes), importing everything may not be practical or cost-effective.
If you encounter any issues during installation or configuration, please contact our technical support team.