All Products
Search
Document Center

Intelligent Media Services:UploadMediaByURL

Last Updated:Mar 30, 2026

Uploads an audio or video file based on the URL of the source file. You can upload multiple media files at a time.

Operation description

  • If a callback is configured, you will receive an UploadByURLComplete event notification after the file is uploaded. You can query the upload status by calling the GetURLUploadInfos operation.

  • After a request is submitted, the upload job is queued as an asynchronous job in the cloud. You can query the status of the upload job based on information such as the URL and media asset ID that are returned in the event notification.

  • Upload media files that are not stored on a local server or device and must be uploaded by using URLs that are accessible over the Internet.

  • Upload media files only to ApsaraVideo VOD, but not to your own Object Storage Service (OSS) buckets. To upload a media file to an OSS bucket, pull the file to a local directory, use OSS SDK to upload the file to an OSS bucket, and then call the RegisterMediaInfo operation to register the file in the OSS bucket with the media asset library.

  • This operation is available only in the China (Shanghai), China (Beijing), and China (Shenzhen) regions.

  • Upload only audio and video files.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ice:UploadMediaByURL

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

UploadURLs

string

No

The URL of the source file.

  • The URL must contain a file name extension, such as mp4 in https://****.mp4.

    • If the URL does not contain a file name extension, you can specify one by setting FileExtension in UploadMetadata.

    • If the URL contains a file name extension and FileExtension is also specified, the value of FileExtension prevails.

  • URL encoding is required. Separate multiple URLs with commas (,). You can specify a maximum of 20 URLs.

  • Special characters may cause upload failures. Therefore, you must encode URLs before you separate them with commas (,).

https://diffurl.mp4

AppId

string

No

The application ID.

app-1000000

UserData

string

No

The user data. The value must be a JSON string. You can configure settings such as message callbacks.

{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"xxx","test":"www"}}

UploadTargetConfig

string

No

The destination storage address.

Set StorageType to oss.

Set StorageLocation to an address in ApsaraVideo VOD. You cannot set this field to an OSS URL.

{"StorageType":"oss","StorageLocation":"outin-***.oss-cn-shanghai.aliyuncs.com"}

MediaMetaData

string

No

The metadata of the media file that you want to upload. The value must be a JSON string.

  • This parameter takes effect only if its value matches a URL that is specified in UploadURLs.

  • You must convert the JSON-formatted data, such as [UploadMetadata, UploadMetadata,…], into a JSON string.

  • For more information, see the "UploadMetadata" section of this topic.

[{"SourceURL":"https://example.aliyundoc.com/video01.mp4","Title":"urlUploadTest"}]

PostProcessConfig

string

No

The postprocessing configurations. You can specify this parameter if Type is set to video or audio.

Set ProcessType to Workflow.

{"ProcessType": "Workflow","ProcessID":"b72a06c6beeb4dcdb898feef067b1***"}

EntityId

string

No

The entity ID. You can call the CreateEntity operation to create an entity and specify a dynamic metadata structure.

d67281da3c8743b8823ad12976187***

UploadMetadata

Field Type Required Description
SourceURL String Yes The URL of the source file that you want to upload.
Title String Yes The title of the media asset. The value can be up to 128 bytes in length. The value must be encoded in UTF-8.
FileSize String No The file size.
Description String No The description of the media asset. The value can be up to 1024 bytes in length. The value must be encoded in UTF-8.
CoverURL String No The URL of the custom video thumbnail.
CateId String No The category ID.
Tags String No The tags that you want to add to the media asset. Each tag can be up to 32 bytes in length. You can set a maximum of 16 tags. Separate multiple tags with commas (,). The value is encoded in UTF-8.
WorkflowId String No The workflow ID.
FileExtension String No The file name extension.
DynamicMetaData String No The dynamic metadata. Example: "{"Uploader": "xxx"}".
EntityId String No The entity ID.

Note* The values of fields, such as Title, Description, and Tags, in UploadMetadata cannot contain emojis.

  • If a callback is configured, you can receive an UploadByURLComplete event notification when the media file is uploaded. You can also receive the FileUploadComplete and StreamTranscodeComplete event notifications.

  • If you upload multiple media files at a time, an event notification is sent for each media file when the media file is uploaded.

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

****83B7-7F87-4792-BFE9-63CD2137****

UploadJobs

array<object>

The information about upload jobs.

object

The details of the upload job.

JobId

string

The ID of the upload job.

20ce1e05dba64576b96e9683879f0***

SourceURL

string

The URL of the source file that is uploaded in the upload job.

http://example****.mp4

MediaId

string

The ID of the media asset.

f476988629f54a7b8a4ba90d1a6c7***

Examples

Success response

JSON format

{
  "RequestId": "****83B7-7F87-4792-BFE9-63CD2137****",
  "UploadJobs": [
    {
      "JobId": "20ce1e05dba64576b96e9683879f0***",
      "SourceURL": "http://example****.mp4\n",
      "MediaId": "f476988629f54a7b8a4ba90d1a6c7***"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.