Upload Editor Media
upload_editor_mediaPut image, video or audio files into your real Switch Editor project. By default they land in the project's media bin only; pass place: true to also lay each one at the end of its track. Three ways: url (an https link to the file; Switch keeps a copy), video_id (one of your finished videos from list_my_videos, attached as it is), or bytes: call with presign=true (one file, or files: [...] for several), PUT each file to its upload_url within 2 hours (or use the resumable block, a TUS upload in 6 MB pieces that can resume for up to 24 hours, for a big file on a slow link), then call again with confirm: [the confirm objects from the presign answer] (several in one call; each keeps the place asked at presign) or confirm_path for one. Files up to 500 MB each. A video's scrub copy and frame strip are made in the background after the confirm (a long clip takes a few minutes; the original plays until they land).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | An https link to the file to bring in (no presign needed). | |
| kind | No | What the file is. | |
| mime | No | The file type, for example video/mp4. | |
| name | No | Optional name the media bin shows, if it should differ from the file name. | |
| files | No | With presign=true: several files at once; the answer has one upload per file, each with its own confirm object. | |
| place | No | true also puts the media at the end of its timeline track. Default false: the media bin only. | |
| confirm | No | After the uploads: the confirm objects from the presign answer, all attached in one call and one save. | |
| presign | No | true on the first call: answers an upload_url to PUT the bytes to (and a resumable block) and the path to confirm. | |
| filename | No | The file name with its extension. | |
| video_id | No | One of your finished videos (list_my_videos) to attach as it is. | |
| file_size | No | Bytes; required for presign. | |
| project_id | Yes | The Editor project id, from list_editor_projects. | |
| confirm_path | No | The path from the presign answer, on the second call after the PUT, to put the file in the project. | |
| duration_seconds | No | The clip length in seconds, if known. A still image with none given is placed as a 5-second clip. |