Import a Library
Moving from another host, or from a bucket and a spreadsheet of links? A bulk import turns a list of source URLs into hosted videos in one request. You see what it will cost before anything is encoded, you start it with a spend cap, and once the cap is reached it stops starting new videos. Videos already encoding finish, and a video whose length was not known in advance is counted at an estimate until it is measured, so the final spend can exceed the cap by up to the cost of the videos in flight. Running the same list again creates no duplicates.
Each URL becomes a hosted video exactly as Create a video from a URL would make it: same checks, same hosted quality ladder, same pricing. The full API is in the Imports reference.
How it works
- Create an import with your list. It starts as a
draftand comes back with a quote. Nothing is fetched or encoded yet. - Start it with a spend cap in euros. Videos are created in the order you listed them, in batches of up to 10 at a time, at a pace that leaves room in your queue for your own uploads.
- Follow it: counts per status, money spent against the cap, and every item’s result. If the cap is reached it pauses; raise the cap and it carries on.
- When nothing is left to do, it is
completedand theimport.completedwebhook fires.
Prepare the list
The dashboard takes either a pasted list of links (one URL per line) or a CSV file. The API takes the same fields as JSON.
| Column | Required | What it holds |
|---|---|---|
url | Yes | Public http:// or https:// link to the source video, with no spaces (write a space as %20). Transcodely downloads it when its turn comes. |
title | No | Title of the video (up to 255 characters). |
description | No | Description (up to 2,000 characters). |
tags | No | Tags, separated by a vertical bar (up to 20 tags of up to 100 characters each). |
external_id | No | Your own ID for the video, such as the lesson ID in your old platform. This is what makes re-runs safe; see Running it again. |
duration_seconds | No | Length of the source in seconds, if you know it, such as 612 or 612.5. Only used for the quote. |
The CSV rules:
- The first line is a header. Columns may be in any order, and only
urlis required. Unknown columns are ignored (the dashboard tells you which). - Wrap a value in double quotes when it contains a comma or a line break, and double a quote inside it:
"Tips, tricks and ""gotchas""". - Tags are separated with
|, as incourse-a|beginner, not with;, because many spreadsheet apps already use the semicolon to separate columns. - UTF-8 with or without a byte order mark, Windows or Unix line endings, and blank lines are all fine.
- One import holds up to 10,000 videos. Split a bigger library into several imports.
The dashboard checks every row before anything is sent and lists the problems by line number, so a typo in row 1,204 does not sink the other 1,203. You can fix the file, or import the rows without problems and leave the others out.
A pasted list has no external_id, so pasting the same links again imports them again. Use a CSV with an external_id column when you may need to re-run.
No duration column? That is fine. Those videos are counted in the quote but not priced, and the quote says how many there are.
Create the import
In the dashboard: Videos → Import → New import, pick the app, paste the links or upload the CSV, choose the defaults (who can watch, AI captions, tags), and press Get the quote. Who can watch starts on App default: the videos get the app’s default visibility from its hosting settings, or unlisted if the app has none. Pick Public, Unlisted or Private to set it for every video instead.
With the API:
curl -X POST https://api.transcodely.com/transcodely.v1.ImportService/Create
-H "Authorization: Bearer {{API_KEY}}"
-H "Content-Type: application/json"
-d '{
"source": { "type": "urls" },
"defaults": { "visibility": "unlisted", "auto_captions": true, "tags": ["imported"] },
"items": [
{
"url": "https://cdn.example.com/courses/lesson-01.mp4",
"external_id": "lesson-01",
"title": "Lesson 1: Getting started",
"tags": ["course-a", "beginner"],
"duration_seconds": 612
},
{
"url": "https://cdn.example.com/courses/lesson-02.mp4",
"external_id": "lesson-02",
"title": "Lesson 2: The basics"
}
]
}'Leave defaults.visibility out (or empty) to use the app’s default visibility, else unlisted; set it to public, unlisted or private to choose for every video. A single item can still override it with its own visibility.
One Create call takes up to 1,000 items. For a longer list, call AddItems with the next 1,000 while the import is still a draft (the dashboard does this for you).
Every URL is checked when you submit it: a link that is not public http(s) (a private address, localhost, gs://) fails the request and names the item. Links are not downloaded yet, so a link that has gone dead fails only its own item later.
Read the quote
The import comes back with a quote, computed from your app’s own rates:
| Field | Meaning |
|---|---|
item_count | Videos that will be created. Duplicates that will be skipped are not counted. |
known_duration_seconds | Total length of the videos that gave a duration_seconds. |
unknown_duration_items | Videos without a duration. They are not in the estimate. |
estimated_encode_eur | One-time encoding cost of the videos with a known duration, including the per-video processing fee and any caption translations you asked for. |
estimated_storage_eur_per_month | What storing those videos is expected to cost each month. |
The quote is an estimate, not a bill. Encoding is billed on each video’s real length, storage on the real bytes stored, and delivery on what viewers watch. AI captions are free on hosted videos.
Start it with a spend cap
An import cannot start without a cap. In the dashboard, type the cap under the quote and press Start import. With the API:
curl -X POST https://api.transcodely.com/transcodely.v1.ImportService/Start
-H "Authorization: Bearer {{API_KEY}}"
-H "Content-Type: application/json"
-d '{ "id": "imp_a1b2c3d4e5f6", "max_spend_eur": 60 }'Before each video is started, its estimated cost is set aside against the cap. When the next video would not fit, the import pauses with spend_cap_reached and starts no new videos. Videos already encoding finish, and a video whose length was not known in advance is counted at an estimate until it is measured, so the final spend can exceed the cap by up to the cost of the videos in flight. Nothing is lost: raise the cap (the Raise cap and continue button, or Update with a new max_spend_eur) and it continues where it stopped.
The cap is in addition to your app’s monthly spend limit, which still applies to every video. Whichever is lower stops the import first.
If the app does not host videos yet, starting the import turns hosting on for it, exactly as creating a single video from a URL does.
Follow the progress
The import page in the dashboard updates live while the import runs: a progress bar, the count of videos in each state, money spent and reserved against the cap, and a table of every item with its video. With the API, poll Get for the counts and ListItems for the items, or subscribe to the webhooks:
| Event | When |
|---|---|
import.completed | Once, when no video of the import is waiting or encoding any more. |
import.paused | Each time the import pauses on its own: the cap, the app spend limit, billing or hosting. |
Each video also fires its own video.ready or video.failed event, as any hosted video does.
When it pauses
| Pause reason | What to do |
|---|---|
spend_cap_reached | Raise the import’s cap. That resumes it. |
spend_limit_reached | The app’s monthly spend limit was reached. Raise it in the app’s settings, then resume the import. Resuming continues the videos not started yet; a video the limit refused once its source had been read is failed (nothing charged), so retry it with Retry failed. |
billing | A payment is past due or the balance is over its limit. Settle it in Billing, then resume. |
hosting_unavailable | Hosting was turned off for the app. Turn it back on, then resume. |
manual | You paused it. Resume when you are ready. |
While an import is paused, videos already encoding finish. Only new ones wait. You can also cancel an import at any point: videos not started yet are canceled, and videos already encoding finish and are billed.
Retry the failures
Every item ends succeeded, failed (with an error code and a plain explanation, such as input_not_found for a link that has gone dead), skipped (a duplicate) or canceled. Filter the items table by Failures to see what went wrong.
Fix what you can (a moved file, an expired link), then press Retry failed: the dashboard creates a new import from the failed items with the same URLs, external IDs and details, and shows you its quote. With the API, list the failed items (ListItems with "status": "failed") and submit them in a new import. Failed items do not hold their external_id, so the new import is not treated as a duplicate.
Running it again
external_id is what makes an import safe to repeat. Within an app, an item whose external_id already belongs to a video that is waiting, encoding or done is recorded as skipped and creates nothing, and the quote does not count it. So if you are unsure whether a migration finished, submit the same file again: only the videos that did not make it are imported. Rows without an external_id are never deduplicated, so give every row one when you can.
Caption files
Items accept caption file URLs (text_tracks) and keep them on the item, but this release does not attach them to the videos yet. Such items carry the warning text_tracks_not_ingested. Add the caption files to each video once it is ready, or turn on AI captions in the import’s defaults.