The Import object
An import is a list of source URLs, each of which becomes a hosted video through the same path as Create a video from a URL: the same SSRF checks, the same admission probe, the same hosted ABR ladder, the same pricing. Every import is quoted before anything is encoded, is started with a spend cap, and pauses rather than fails when the cap is reached. A step-by-step walkthrough lives in the Import a library guide.
An import can also read its items from a source library: a Vimeo account, read with a Vimeo personal access token (source.type vimeo). See Source libraries. Vimeo import is not available yet: until it has been run against a live Vimeo account, every request with a vimeo source is refused with invalid_argument, error code parameter_unsupported, “Vimeo import is not available yet.”.
Base path: transcodely.v1.ImportService Requires: an app-scoped API key (ak_), or the X-Organization-ID header for portal sessions. API-key callers may omit app_id (the key’s app is used) or pass their own app; another app is rejected with permission_denied. An import of another app or organization answers not_found with error code import_not_found.
The lifecycle:
- Create an import with up to 1,000 items (status
draft), and add items to reach up to 10,000. Nothing is fetched or encoded yet. Every Create and AddItems returns the quote. - Start it with a spend cap (
max_spend_eur). Status becomesrunningand items are dispatched in submission order, in batches of up to 10, at a pace that leaves room in your queue for your own uploads. - If the next item would take the import over its cap, the import pauses (
paused, pause_reasonspend_cap_reached). Nothing is lost: raising the cap with Update resumes it. - When no item is pending or running any more, the import is
completedand theimport.completedwebhook fires once.
Attributes
| Attribute | Type | Description |
|---|---|---|
id | string | Unique identifier with the imp_ prefix (e.g. "imp_a1b2c3d4e5f6"). |
app_id | string | App the videos are created in. |
status | string | Lifecycle state. One of: draft, running, paused, completed, canceled. See States. |
pause_reason | string | Why the import is paused. Present only while status is paused. One of: spend_cap_reached, spend_limit_reached, billing, hosting_unavailable, manual, source_credentials_invalid, source_credentials_expired. See Pause reasons. |
source | object | Where the items come from: type is urls (items submitted in the request) or vimeo (items read from a Vimeo library, with the library’s settings in vimeo; see The VimeoImportSource object). |
defaults | object | Settings applied to every item unless the item overrides them. See Create an import. |
max_spend_eur | number | Spend cap in EUR. Required to start. Omitted until set. |
spent_eur | number | Actual cost, in EUR, of the items that have finished. |
reserved_eur | number | Estimated cost, in EUR, of items dispatched and not finished yet. It moves into spent_eur, as the actual cost, as each item finishes. |
quote | object | The quote for the items submitted so far. |
counts | object | Number of items in each status: pending, running, succeeded, failed, skipped, canceled. |
created_at | string | ISO 8601 timestamp. |
updated_at | string | ISO 8601 timestamp of the last change. |
started_at | string | When the import was started. Omitted while draft. |
completed_at | string | When the import completed. Omitted until then. |
canceled_at | string | When the import was canceled. Omitted unless canceled. |
{
"id": "imp_a1b2c3d4e5f6",
"app_id": "app_k1l2m3n4o5",
"status": "paused",
"pause_reason": "spend_cap_reached",
"source": { "type": "urls" },
"defaults": {
"visibility": "unlisted",
"preset": "",
"auto_captions": false,
"auto_translations": [],
"tags": ["imported"]
},
"max_spend_eur": 25,
"spent_eur": 22.84,
"reserved_eur": 1.71,
"quote": {
"item_count": 240,
"known_duration_seconds": 131400,
"unknown_duration_items": 12,
"estimated_encode_eur": 49.28,
"estimated_storage_eur_per_month": 2.1,
"currency": "EUR",
"free_encode_seconds_applied": 0
},
"counts": { "pending": 118, "running": 2, "succeeded": 117, "failed": 3, "skipped": 0, "canceled": 0 },
"created_at": "2026-11-30T09:00:00Z",
"updated_at": "2026-11-30T10:12:44Z",
"started_at": "2026-11-30T09:02:10Z"
}States
| Status | Meaning |
|---|---|
draft | Created, not started. Items can be added; nothing is fetched or encoded. |
running | Items are being dispatched and encoded. |
paused | No new items are dispatched; items already dispatched keep encoding. pause_reason says why. |
completed | Every item has succeeded, failed, been skipped or been canceled. Final. |
canceled | Canceled by you. Items not yet dispatched were canceled. Final. |
draft → running (Start) → completed. running ↔ paused (Pause and Resume, or the dispatcher pausing on one of the reasons below). draft, running and paused can be canceled. An action the current state does not allow is refused with failed_precondition, error code import_invalid_state, and a message that names the current status and what is allowed.
Pause reasons
| Pause reason | What happened | What to do |
|---|---|---|
spend_cap_reached | The next item would take spent_eur + reserved_eur over max_spend_eur. | Raise the cap with Update; that resumes the import. |
spend_limit_reached | The app’s monthly spend limit refused an item (error code limit_exceeded). | Raise the app limit, then Resume. Resume continues only the items still pending, which includes an item refused when its video was created. An item refused after its video was created, when the video’s input was first read, is failed with limit_exceeded and nothing charged: submit it again in a new import, and delete its errored video if you do not want it. |
billing | The account cannot start new work: a payment is past due, the outstanding balance is over its limit, or the account standing refuses new jobs. | Settle the account, then Resume. |
hosting_unavailable | Managed hosting was turned off, or could not be provisioned, for the app after the import started. | Enable hosting, then Resume. |
manual | Paused with Pause. | Resume. |
source_credentials_invalid | The source (Vimeo) rejected the import’s credential: it was revoked or lacks a required scope. | Give a new token with UpdateSourceCredentials; that resumes the import. |
source_credentials_expired | The import’s source credential was deleted because it was given more than 7 days ago. | Give a new token with UpdateSourceCredentials; that resumes the import. |
The quote
Computed on every Create and AddItems from the live rate card for the app, with the same pricing the encode is billed with. It is an estimate, not a charge: encodes are billed on the real source duration, storage on the real bytes stored.
| Attribute | Type | Description |
|---|---|---|
item_count | integer | Items that will be dispatched (pending items). Skipped duplicates are not counted. |
known_duration_seconds | number | Sum of duration_seconds over the counted items that gave one. |
unknown_duration_items | integer | Counted items that gave no duration_seconds. They are not priced in the quote; their real cost still counts against the cap as they run. |
estimated_encode_eur | number | Estimated encode cost of the items with a known duration, in EUR, including the per-video processing fee and any caption translation fees the defaults ask for. |
estimated_storage_eur_per_month | number | Estimated monthly cost of storing the encoded renditions of the items with a known duration, in EUR per month. Delivery is billed separately, on what viewers watch. |
currency | string | Always "EUR". |
free_encode_seconds_applied | number | Source seconds whose encode charge a free-import allowance covers. 0 unless such an allowance is enabled for your account. |
Source libraries (Vimeo, beta)
With source.type vimeo, the import reads a Vimeo library with a Vimeo personal access token instead of taking a list of URLs. Beta: not yet run against a live Vimeo account. The flow:
- Preview the library: its folders and videos, which videos can be imported and why the others cannot, and the quote. Nothing is created.
- Create the import with the same
sourceand no items. The library is read again and every importable video in the selected folders becomes an item with its title, description, tags (plusfolder:<name>), duration and visibility, andexternal_idvimeo:<id>. More than 10,000 importable videos is refused: select folders. - Start it with a spend cap, as any import. Each video’s download link is fetched from Vimeo just before its item is dispatched (the original upload when Vimeo offers it, else the largest rendition; the item’s
source_filerecords which), and is never stored. - When a video is ready, its Vimeo caption and subtitle tracks are attached to it (unless
include_text_tracksisfalse). - Export the mapping file to swap the embeds on your site.
The VimeoImportSource object
The vimeo field of source. Required when type is vimeo, refused otherwise.
| Attribute | Type | Description |
|---|---|---|
access_token | string | A Vimeo personal access token for the account that owns the videos, with the public, private and video_files scopes (max 512 characters). Write-only: accepted on Create, Preview and UpdateSourceCredentials, and never returned (responses carry it as an empty string). Stored encrypted, and deleted when the import completes or is canceled, and 7 days after it was given in any case. |
folder_ids | array of strings | Vimeo folder IDs to import, each with everything below it (at most 500, digits only). Empty: the whole library. |
include_text_tracks | boolean | Attach the videos’ Vimeo caption and subtitle tracks to the created videos once they are ready. Default true. A track the video cannot take becomes the warning text_track_not_imported on its item, never a failure. |
visibility_mapping | object | Visibility of the created videos per Vimeo privacy setting, overriding the default mapping. Keys are Vimeo privacy.view values (such as anybody, unlisted, password); values are public, unlisted or private. At most 20 entries. |
access_token_set | boolean | Output only. Whether the import still holds a token. false once the import has completed or been canceled, or 7 days after the token was given. |
account_name | string | Output only. The Vimeo account the token belongs to. |
{
"type": "vimeo",
"vimeo": {
"access_token": "",
"folder_ids": ["11223344"],
"include_text_tracks": true,
"visibility_mapping": {},
"access_token_set": true,
"account_name": "Acme Academy"
}
}Visibility mapping
The default, applied per video from its Vimeo privacy.view value. Override any row with visibility_mapping.
| Vimeo setting | Created video |
|---|---|
anybody | public |
unlisted, disable, embed_only | unlisted |
everything else: nobody, password, contacts, users, and any other value | private |
What each value means is defined by Vimeo (ViewPrivacyType in Vimeo’s own client library, accessed 2026-11-28).
A Vimeo video with a password becomes private: per-video passwords do not come across.
Why a video cannot be imported
Whether a video can be imported is decided per video, from what Vimeo returns for it, never from the account’s plan name.
| Reason | Meaning |
|---|---|
no_download_access | Vimeo offered no file to download: the account’s plan does not allow downloads through the API, or the token lacks the video_files scope (missing_scopes in the preview says which when Vimeo tells us). |
not_owner | The video belongs to another Vimeo account; only its owner’s token can download it. |
source_unavailable | The video has nothing to import right now: still processing on Vimeo, failed there, over the Vimeo account’s quota, or a live event. |
The ImportItem object
One source of an import and what became of it.
| Attribute | Type | Description |
|---|---|---|
id | string | Unique identifier with the imi_ prefix (e.g. "imi_a1b2c3d4e5f6g7"). |
import_id | string | Import the item belongs to. |
app_id | string | App the video is created in. |
status | string | One of: pending, running, succeeded, failed, skipped, canceled. |
url | string | Source URL, as submitted. |
external_id | string | Your identifier for the source, as submitted. Empty when none was given. |
title | string | Title, as submitted. |
description | string | Description, as submitted. |
tags | array of strings | Tags, as submitted. |
duration_seconds | number | Source duration hint, as submitted. Omitted when none was given. |
visibility | string | Visibility override, as submitted. Empty: the import’s defaults. |
text_tracks | array of objects | Caption files, as submitted (url, language, kind). Not ingested yet; see Caption files. |
video_id | string | The video this item created. Empty until the item is dispatched. |
error | object | Why the item failed: code (a standard API error code such as input_not_found or invalid_input_url, or for a Vimeo item source_no_download_access, source_not_owner or source_unavailable; see Item error codes) and message (plain words, and how to fix it). Present only when status is failed. |
duplicate_of_item_id | string | The item that holds this item’s external_id. Set only when status is skipped. |
warnings | array of objects | Things that did not stop the item, each with a code and message, e.g. text_tracks_not_ingested, or text_track_not_imported for a Vimeo caption track the video could not take. |
source_id | string | The source’s ID of the video (the Vimeo video ID). Empty for a urls import. |
source_file | object | Which file of the source video was imported: quality (source for the original upload, else a rendition label such as hd or sd), is_original (false means the import encodes a rendition Vimeo made, not your original), and width, height and size_bytes when Vimeo said. Present once the item has been dispatched from a source library. |
text_tracks_attached | integer | Number of the source video’s caption and subtitle tracks attached to the created video. |
estimated_cost_eur | number | Estimated cost of this item in EUR: from duration_seconds when given, else 0 until the item is dispatched. |
cost_eur | number | Actual cost of this item in EUR. Present once the item has finished. |
created_at | string | When the item was submitted. |
updated_at | string | When the item last changed. |
| Item status | Meaning |
|---|---|
pending | Not dispatched yet. |
running | Dispatched: its video is being created or encoded. |
succeeded | Its video is ready. Final. |
failed | Its video could not be created or encoded; error says why. Final. A failed item does not hold its external_id, so it can be retried by submitting it again in a new import. |
skipped | Not imported because another item of the same app with the same external_id is pending, running or succeeded; duplicate_of_item_id names it. No video is created. Final. |
canceled | Not dispatched because the import was canceled. Final. |
{
"id": "imi_a1b2c3d4e5f6g7",
"import_id": "imp_a1b2c3d4e5f6",
"app_id": "app_k1l2m3n4o5",
"status": "failed",
"url": "https://cdn.example.com/courses/lesson-07.mp4",
"external_id": "lesson-07",
"title": "Lesson 7",
"description": "",
"tags": ["course-a"],
"duration_seconds": 540,
"visibility": "",
"text_tracks": [],
"video_id": "",
"error": {
"code": "input_not_found",
"message": "The source URL answered 404. Check the URL, and that the object is still there."
},
"duplicate_of_item_id": "",
"warnings": [],
"estimated_cost_eur": 0.21,
"cost_eur": 0,
"created_at": "2026-11-30T09:00:00Z",
"updated_at": "2026-11-30T09:20:31Z",
"source_id": "",
"source_file": null,
"text_tracks_attached": 0
}Create an import
POST /transcodely.v1.ImportService/CreateCreates an import in draft with its first batch of items (1 to 1,000). Nothing is fetched or encoded until Start. The response carries the quote.
Every item URL is checked up front: a URL that is not http(s), or that points at a private or internal address, fails the whole request with invalid_argument, error code invalid_input_url, and a field violation naming the item (items[3].url); nothing is stored. URLs are not fetched at this point: an unreachable URL fails its item later, with input_not_found.
| Parameter | Type | Required | Description |
|---|---|---|---|
app_id | string | No | App to import into. API-key callers may omit it; portal sessions that omit it get the organization’s first active app. |
source | object | Yes | {"type": "urls"}, or {"type": "vimeo", "vimeo": {...}} for a Vimeo library. |
source.vimeo.access_token | string | For vimeo | Vimeo personal access token with the public, private and video_files scopes. Write-only. |
source.vimeo.folder_ids | array of strings | No | Vimeo folders to import, each with everything below it. Empty: the whole library. |
source.vimeo.include_text_tracks | boolean | No | Attach the videos’ Vimeo caption and subtitle tracks. Default true. |
source.vimeo.visibility_mapping | object | No | Per Vimeo privacy setting, the visibility of the created videos. Omitted: the default mapping. |
defaults | object | No | Settings for every item (below). Omitted: visibility from the app’s default, the app’s default hosted ladder, no captions, no tags. |
defaults.visibility | string | No | public, unlisted or private. Empty: the app’s hosting default_visibility, else unlisted, the same rule as CreateFromUrl. |
defaults.preset | string | No | Preset ID or slug for every transcode. Empty: the app’s default hosted ABR ladder. |
defaults.auto_captions | boolean | No | Generate AI captions for every item. Default false. Free on hosted video. |
defaults.auto_translations | array of strings | No | Translate the AI captions into these languages (ISO 639-2, at most 10). Requires auto_captions. Billed per source minute per language and included in the quote. |
defaults.tags | array of strings | No | Tags for every video (at most 20). An item with its own non-empty tags uses those instead. |
items | array of objects | For urls | 1 to 1,000 items (below) for a urls import. Append more with AddItems. Must be empty for a vimeo import: its items are read from the library. |
items[].url | string | Yes | Publicly reachable http(s) URL of the source video (max 2048 characters). |
items[].external_id | string | No | Your own ID for the source (max 255 characters), unique within the app among items that are pending, running or succeeded. The dedupe key. |
items[].title | string | No | Title of the video (max 255 characters). |
items[].description | string | No | Description of the video (max 2,000 characters). |
items[].tags | array of strings | No | Tags of the video (at most 20). Empty: defaults.tags. |
items[].duration_seconds | number | No | Source duration in seconds, if you know it (above 0, at most one week). Used only for the quote and the spend-cap reservation; the encode is billed on the real duration. |
items[].visibility | string | No | Visibility of this item’s video. Empty: defaults.visibility. |
items[].text_tracks | array of objects | No | Caption files (url, language, kind), at most 20. Accepted but not ingested yet; see Caption files. |
max_spend_eur | number | No | Spend cap in EUR (above 0). Optional here; required by Start. |
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", "tags": ["imported"] },
"items": [
{
"url": "https://cdn.example.com/courses/lesson-01.mp4",
"external_id": "lesson-01",
"title": "Lesson 1",
"tags": ["course-a"],
"duration_seconds": 612
},
{
"url": "https://cdn.example.com/courses/lesson-02.mp4",
"external_id": "lesson-02",
"title": "Lesson 2"
}
]
}'{
"import": {
"id": "imp_a1b2c3d4e5f6",
"app_id": "app_k1l2m3n4o5",
"status": "draft",
"source": { "type": "urls" },
"defaults": {
"visibility": "unlisted",
"preset": "",
"auto_captions": false,
"auto_translations": [],
"tags": ["imported"]
},
"spent_eur": 0,
"reserved_eur": 0,
"quote": {
"item_count": 2,
"known_duration_seconds": 612,
"unknown_duration_items": 1,
"estimated_encode_eur": 0.24,
"estimated_storage_eur_per_month": 0.01,
"currency": "EUR",
"free_encode_seconds_applied": 0
},
"counts": { "pending": 2, "running": 0, "succeeded": 0, "failed": 0, "skipped": 0, "canceled": 0 },
"created_at": "2026-11-30T09:00:00Z",
"updated_at": "2026-11-30T09:00:00Z"
}
}The amounts above are illustrative; your quote uses your app’s rate card.
Create an import of a Vimeo library
For a vimeo source, pass no items. The library is read when you call Create (the token in this request is the one used), and every importable video in folder_ids (all folders when empty) becomes an item: url is the Vimeo page (never a download link), external_id is vimeo:<id>, with the video’s title, description, tags (folder:<name> first), duration (so the quote is exact) and visibility from the mapping. Videos that cannot be imported become no item; they are listed in the mapping file with the reason. A library with more than 10,000 importable videos in the selection is refused: select folders and run several imports. A token Vimeo rejects is refused with invalid_argument, error code import_source_credentials_invalid.
curl -X POST https://api.transcodely.com/transcodely.v1.ImportService/Create
-H "Authorization: Bearer {{API_KEY}}"
-H "Content-Type: application/json"
-d '{
"source": {
"type": "vimeo",
"vimeo": {
"access_token": "{{VIMEO_TOKEN}}",
"folder_ids": ["11223344"]
}
},
"defaults": { "tags": ["from-vimeo"] },
"max_spend_eur": 50
}'Add items
POST /transcodely.v1.ImportService/AddItemsAppends 1 to 1,000 items to a draft urls import, up to 10,000 items per import (skipped items included). A source-library (vimeo) import takes no added items. A call that would exceed that is refused with invalid_argument and appends nothing. Refused with failed_precondition, error code import_invalid_state, once the import has been started or canceled. Returns the import with its recomputed quote.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the import (imp_ prefix). |
app_id | string | No | App of the import. API-key callers may omit it. |
items | array of objects | Yes | 1 to 1,000 items, as in Create. |
Retrieve an import
POST /transcodely.v1.ImportService/GetReturns the import with its quote, spend and per-status item counts. Poll it to follow progress, or listen for the webhooks.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the import. |
app_id | string | No | App of the import. API-key callers may omit it. |
List imports
POST /transcodely.v1.ImportService/ListLists imports, newest first.
| Parameter | Type | Required | Description |
|---|---|---|---|
app_id | string | No | App filter. API-key callers may omit it (their key’s app is used); portal sessions that omit it list every app in the organization. |
status | string | No | Only imports in this status, e.g. running. |
pagination | object | No | limit (default 20, at most 100) and cursor (the next_cursor of the previous page). |
Returns imports and pagination (next_cursor, empty on the last page).
Start an import
POST /transcodely.v1.ImportService/StartStarts a draft import. A spend cap is required: pass max_spend_eur here, or set it at Create or with Update; with neither, the call is refused with invalid_argument on max_spend_eur. Refused with invalid_argument when the import has no pending items.
Start enables managed hosting on the app if it is not enabled yet, exactly as CreateFromUrl does, and refuses with the same errors when it cannot (hosting_provisioning_failed is safe to retry).
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the import. |
app_id | string | No | App of the import. API-key callers may omit it. |
max_spend_eur | number | No | Spend cap in EUR (above 0). Replaces any cap set before. Required unless the import already has one. |
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 }'The spend cap
The dispatcher reserves an item’s estimate only while spent_eur + reserved_eur + estimate stays within max_spend_eur, and pauses the import with spend_cap_reached otherwise. A pause stops new videos only. 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 spent_eur can exceed the cap by up to the cost of the videos in flight. The cap is in addition to the app’s monthly spend limit, which still applies to every video the import creates: whichever is lower stops the import. Reaching the app limit pauses it with spend_limit_reached.
Update the spend cap
POST /transcodely.v1.ImportService/UpdateChanges an import’s spend cap, while the import is draft, running or paused. When the import is paused with spend_cap_reached, setting a cap resumes it (status running); the dispatcher pauses it again if the new cap still leaves no room for the next item. Lowering the cap below what is already spent and reserved stops further dispatch; items already dispatched finish.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the import. |
app_id | string | No | App of the import. API-key callers may omit it. |
max_spend_eur | number | Yes | New spend cap in EUR (above 0). |
Pause an import
POST /transcodely.v1.ImportService/PausePauses a running import (pause_reason manual). Items already dispatched keep encoding; no new items are dispatched. Takes id and optional app_id.
Resume an import
POST /transcodely.v1.ImportService/ResumeResumes a paused import, whatever paused it. Only items still pending are dispatched; failed items stay failed and go in a new import. If the cause is still there (the app spend limit is still reached, for example), the import pauses again with the same reason on the next dispatch. An import paused at its cap whose cap is still used up is refused with import_invalid_state: raise max_spend_eur with Update instead. Takes id and optional app_id.
Cancel an import
POST /transcodely.v1.ImportService/CancelCancels a draft, running or paused import. Items not yet dispatched become canceled. Videos already being encoded finish, and their cost is still added to spent_eur. Refused with failed_precondition, error code import_invalid_state, for a completed or already canceled import. Takes id and optional app_id.
List an import’s items
POST /transcodely.v1.ImportService/ListItemsLists an import’s items in submission order, optionally filtered by status. Each item carries the video it created (video_id), and failed items carry the standard error code and message.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the import. |
app_id | string | No | App of the import. API-key callers may omit it. |
status | string | No | Only items in this status, e.g. failed for a retry list. |
pagination | object | No | limit (default 20, at most 100) and cursor. |
curl -X POST https://api.transcodely.com/transcodely.v1.ImportService/ListItems
-H "Authorization: Bearer {{API_KEY}}"
-H "Content-Type: application/json"
-d '{ "id": "imp_a1b2c3d4e5f6", "status": "failed", "pagination": { "limit": 100 } }'Preview a source library
POST /transcodely.v1.ImportService/PreviewReads a source library and says what an import of it would bring in and cost, without creating anything. For a vimeo source: the account’s folders (subfolders included) and videos, which videos can be imported and, for the rest, why not, and the quote for the importable videos in the selected folders. Nothing is stored and no download link is requested. Not available for a urls source.
Refused with invalid_argument, error code import_source_credentials_invalid, when Vimeo rejects the token, and with unavailable, error code import_source_rate_limited or import_source_unavailable, when the library cannot be read right now; retry later.
| Parameter | Type | Required | Description |
|---|---|---|---|
app_id | string | No | App the import would create videos in; prices come from its rate card. API-key callers may omit it. |
source | object | Yes | The library to read: {"type": "vimeo", "vimeo": {"access_token": "...", "folder_ids": [...]}}. folder_ids selects which videos are listed and quoted; folders always lists the whole library. |
defaults | object | No | Settings the quote is computed with, as Create takes them (AI captions and translations change the quote). |
curl -X POST https://api.transcodely.com/transcodely.v1.ImportService/Preview
-H "Authorization: Bearer {{API_KEY}}"
-H "Content-Type: application/json"
-d '{
"source": {
"type": "vimeo",
"vimeo": { "access_token": "{{VIMEO_TOKEN}}", "folder_ids": ["11223344"] }
}
}'{
"preview": {
"account": { "id": "123456789", "name": "Acme Academy", "plan": "" },
"missing_scopes": [],
"warnings": [],
"folders": [
{ "id": "11223344", "name": "Course A", "parent_id": "", "video_count": 2 }
],
"videos": [
{
"source_id": "76979871",
"link": "https://vimeo.com/76979871",
"title": "Lesson 1: Getting started",
"duration_seconds": 612,
"folder_id": "11223344",
"view_privacy": "unlisted",
"embed_privacy": "whitelist",
"visibility": "unlisted",
"importable": true,
"reason_message": "",
"source_file": { "quality": "source", "is_original": true, "width": 1920, "height": 1080, "size_bytes": "734003200" },
"thumbnail_url": "https://i.vimeocdn.com/video/1234567_1280x720.jpg"
},
{
"source_id": "76979872",
"link": "https://vimeo.com/76979872",
"title": "Lesson 2: The basics",
"duration_seconds": 540,
"folder_id": "11223344",
"view_privacy": "password",
"embed_privacy": "public",
"visibility": "private",
"importable": false,
"reason": "no_download_access",
"reason_message": "Vimeo offered no file to download for this video.",
"source_file": null,
"thumbnail_url": "https://i.vimeocdn.com/video/1234568_1280x720.jpg"
}
],
"counts": {
"videos": 2,
"importable": 1,
"total_duration_seconds": "1152",
"importable_duration_seconds": "612",
"not_importable": { "no_download_access": 1 }
},
"quote": {
"item_count": 1,
"known_duration_seconds": 612,
"unknown_duration_items": 0,
"estimated_encode_eur": 0.13,
"estimated_storage_eur_per_month": 0.01,
"currency": "EUR",
"free_encode_seconds_applied": 0
}
}
}The amounts and the reason_message text above are illustrative.
The ImportPreview object
The preview field of the response.
| Attribute | Type | Description |
|---|---|---|
account | object | The Vimeo account the token belongs to: id, name, and plan as Vimeo names it, for reference only. Whether a video can be imported is decided per video, never from the plan. |
missing_scopes | array of strings | Required token scopes Vimeo says the token lacks. Empty when nothing is missing or Vimeo did not say. |
warnings | array of strings | Notes about parts of the library Vimeo would not list. The videos are all there; some may be shown without their folder. |
folders | array of objects | Every folder of the library: id (pass it in folder_ids), name, parent_id (empty for a top-level folder) and video_count as Vimeo counts them. |
videos | array of objects | The videos in the selected folders (all videos when none are selected), each with source_id (imported as external_id vimeo:<id>), link, title, duration_seconds, folder_id (the deepest folder that holds it), view_privacy and embed_privacy (Vimeo’s own settings), visibility (what the created video would get), importable, reason and reason_message when not importable, source_file (the file the import would fetch) and thumbnail_url. |
counts | object | Over videos: videos, importable, total_duration_seconds, importable_duration_seconds, and not_importable per reason. |
quote | object | The quote for the importable videos in videos, with defaults. |
Update source credentials
POST /transcodely.v1.ImportService/UpdateSourceCredentialsReplaces an import’s source credential (a new Vimeo access token) on a draft, running or paused import. The token is checked against Vimeo first, and must belong to the same Vimeo account as the import; otherwise the call is refused with invalid_argument, error code import_source_credentials_invalid, and a message that says which. An import paused with source_credentials_invalid or source_credentials_expired resumes (status running). The new token is kept for 7 days.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the import. |
app_id | string | No | App of the import. API-key callers may omit it. |
vimeo | object | Yes | The new credential. Only access_token is read. |
curl -X POST https://api.transcodely.com/transcodely.v1.ImportService/UpdateSourceCredentials
-H "Authorization: Bearer {{API_KEY}}"
-H "Content-Type: application/json"
-d '{ "id": "imp_a1b2c3d4e5f6", "vimeo": { "access_token": "{{VIMEO_TOKEN}}" } }'Returns the import, running again if it was paused for its credential.
Export the mapping file
POST /transcodely.v1.ImportService/ExportMappingDownloads the mapping of an import’s source videos to the videos created from them, as CSV or JSON. Use it to swap the embeds on your site. One row per source video: the import’s items first, in submission order, then the source videos that could not be imported, with the reason.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the import. |
app_id | string | No | App of the import. API-key callers may omit it. |
format | string | No | csv or json. Default csv. |
curl -X POST https://api.transcodely.com/transcodely.v1.ImportService/ExportMapping
-H "Authorization: Bearer {{API_KEY}}"
-H "Content-Type: application/json"
-d '{ "id": "imp_a1b2c3d4e5f6", "format": "json" }'{
"content_type": "application/json",
"filename": "imp_a1b2c3d4e5f6-mapping.json",
"content": "WwogIHsKICAgICJzb3VyY2VfaWQiOiAiNzY5Nzk4NzEiLAo..."
}content_type is text/csv or application/json, filename a suggested file name, and content the file itself (base64 in JSON, as every bytes field). The CSV has a header row; the JSON is an array of objects, each carrying every column (empty when there is no value). The columns, in order (new columns are only ever added at the end):
| Column | What it holds |
|---|---|
source_id | The source’s ID of the video (the Vimeo video ID). |
source_url | The video’s page on the source. |
external_id | The item’s external_id (vimeo:<id>). Empty for a video that was not imported. |
title | Title. |
status | The item’s status (pending, running, succeeded, failed, skipped, canceled), or not_imported for a source video that never became an item. |
video_id | The Transcodely video created from it. |
player_url | The video’s player URL, once the video can play. |
embed_code | An iframe embed snippet for that player, once the video can play. |
video_visibility | The created video’s visibility. |
file_quality | Which source file was imported: source for the original upload, else a rendition label such as hd. |
file_is_original | true when the original upload was imported, false when a rendition Vimeo made was. |
view_privacy | Vimeo’s privacy setting for the video, e.g. anybody or password. |
embed_privacy | Vimeo’s embed setting, e.g. public or whitelist (an embed-domain allow-list). Recorded here only; it is not applied to the created video. |
thumbnail_url | The Vimeo thumbnail. Not imported as the poster. |
text_tracks_attached | Caption and subtitle tracks attached to the created video. |
error_code | Why the item failed, when it did. |
not_imported_reason | For not_imported rows: no_download_access, not_owner or source_unavailable. |
not_imported_message | For not_imported rows: the reason in plain words. |
In the CSV, a value that starts with =, +, -, @ or a tab gets a leading ' so a spreadsheet does not read it as a formula.
Deduplication
external_id is the dedupe key, unique within the app among items that are pending, running or succeeded. An item whose external_id is already held, including by an earlier item of the same request, is stored as skipped with duplicate_of_item_id naming the holder, and creates no video. Failed, canceled and skipped items do not hold their key, so submitting the same list again retries exactly the items that did not make it. Items without an external_id are never deduplicated. A Vimeo import sets external_id to vimeo:<id> on every item, so importing the same library again skips the videos already imported.
Caption files
Items accept text_tracks (caption file URLs) and return them, but they are not ingested yet: an item with text tracks carries the warning text_tracks_not_ingested. Add the files to the video once it is ready.
A Vimeo import is different: when an item’s video is ready, the Vimeo video’s caption and subtitle tracks are attached to it before the item settles, and text_tracks_attached counts them. Tracks marked inactive on Vimeo are not imported. A track the video cannot take (a language we do not support, or a second track of the same language and kind, such as en-US and en-GB subtitles) becomes the warning text_track_not_imported on the item, never a failure. Turn it off with source.vimeo.include_text_tracks false.
Webhook events
| Event | When |
|---|---|
import.completed | Fired once, when no item of the import is pending or running any more. |
import.paused | Fired when the dispatcher pauses an import: its cap, the app spend limit, billing, hosting, or (for a Vimeo import) its source credential. |
Each event carries the Import as it was at that moment. Subscribe through webhook endpoints like any other event. Every video an import creates also fires its own video events (video.ready, video.failed).
Errors
| Code | Status | When |
|---|---|---|
import_not_found | not_found | No import with that ID in your app or organization. |
import_invalid_state | failed_precondition | The action is not allowed in the import’s current status. The message names the status. |
invalid_input_url | invalid_argument | An item URL is not public http(s). The field violation names the item. |
hosting_provisioning_failed | unavailable | Start could not enable hosting on the app. Nothing changed; retry. |
import_source_credentials_invalid | invalid_argument | Vimeo rejected the token (mistyped, revoked, missing a scope), or a replacement token belongs to another Vimeo account. The message says which. Give a new token with the scopes named. |
import_source_rate_limited | unavailable | Vimeo is rate limiting requests for the account; nothing was created. The message gives the retry time. |
import_source_unavailable | unavailable | Vimeo could not be read right now; nothing was created. Retry in a few minutes. |
Item error codes
A Vimeo item that fails carries one of these in error.code, alongside the standard codes any item can carry:
| Code | When |
|---|---|
source_no_download_access | Vimeo offered no file to download for the video when its turn came: the plan does not allow downloads through the API, the token lacks video_files, or Vimeo refused the video while the token itself still worked. |
source_not_owner | The video belongs to another Vimeo account. |
source_unavailable | The video is gone from Vimeo, is not available there right now (processing, failed, over quota, a live event), or Vimeo kept failing to hand out its file. |
A rate limit from Vimeo never fails an item: the item waits for Vimeo’s reset and is dispatched then. When a video’s fetch fails because its Vimeo download link no longer works (links expire), the item is sent again once with a freshly resolved link while the import still holds a working token, provided that failure cost nothing; the failed first video is deleted (a video.deleted webhook fires for it). A second fetch failure is final.