Import project media
POST /cut/v1/projects/{project_id}/media:import
Import a URL, data URI or existing file into a writable project media library. Select binding from bindings.list or omit it to use default_upload. Save library_id and asset_id from the result and use them as libraryId and assetId inside execute script media references; overwrites follow the source asset latest version.
Support: supported
Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
| project_id | path | string | true | Project identifier returned by its create or list operation; use the id, not a display name. |
Request body (application/json)
Required: true
| Name | Type | Description |
|---|---|---|
| binding | string | Writable binding name from project bindings; omission uses default_upload. |
| source | object | Exactly one input source for the imported asset. |
| source.url | string | Publicly readable source URL to import. |
| source.data_uri | string | Inline data URI containing the source bytes. |
| source.file_id | string | Existing platform file id whose bytes should be imported. |
| display_name | string | Optional human-readable display name for the new media asset. |
{ "type": "object", "description": "Import one external asset into a writable project library.", "properties": { "binding": { "type": "string", "description": "Writable binding name from project bindings; omission uses default_upload." }, "source": { "type": "object", "description": "Exactly one input source for the imported asset.", "properties": { "url": { "type": "string", "description": "Publicly readable source URL to import.", "format": "uri", "example": "https://media.example/clip.mp4" }, "data_uri": { "type": "string", "description": "Inline data URI containing the source bytes." }, "file_id": { "type": "string", "description": "Existing platform file id whose bytes should be imported." } }, "oneOf": [ { "required": [ "url" ], "not": { "anyOf": [ { "required": [ "data_uri" ] }, { "required": [ "file_id" ] } ] } }, { "required": [ "data_uri" ], "not": { "anyOf": [ { "required": [ "url" ] }, { "required": [ "file_id" ] } ] } }, { "required": [ "file_id" ], "not": { "anyOf": [ { "required": [ "url" ] }, { "required": [ "data_uri" ] } ] } } ] }, "display_name": { "type": "string", "description": "Optional human-readable display name for the new media asset." } }, "required": [ "source" ]}Response
HTTP 200
Requested resource or operation result; use its revision when preparing a guarded edit.
application/json
| Name | Type | Description |
|---|---|---|
| library_id | string | Identifier of a library present in the project bindings. |
| asset_id | string | Asset identifier returned by media import or praxis.media asset operations. |
| info | object | Source media facts returned after import. |
| info.library_id | string | Destination library containing the imported asset. |
| info.asset_id | string | New asset identifier to use in execute script MediaRef objects. |
| info.version | integer | Current source asset version after import. |
| info.kind | string | video is moving footage; audio is sound-only; image is a still visual. |
| info.duration_sec | number | Source media duration, when time-based. In seconds, not frames or microseconds. |
| info.width | integer | Source visual width in pixels, if available. |
| info.height | integer | Source visual height in pixels, if available. |
| info.fps | number | Source frames per second, if the source is video. |
| info.has_audio | boolean | True when the source includes an audio stream. |