All Products
Search
Document Center

ApsaraVideo VOD:UploadMediaByURL

Last Updated:Jul 21, 2026

Pulls audio and video media files for upload based on source file URLs. Batch upload is supported.

Operation description

  • Before using this operation, make sure that you fully understand the billing methods and pricing of ApsaraVideo VOD. Uploading media files to ApsaraVideo VOD incurs storage fees. For billing details, see Media asset storage billing. If you have enabled storage transfer acceleration, uploading media files to ApsaraVideo VOD also incurs upload acceleration fees. For billing details, see Storage transfer acceleration billing.

  • For the media file formats supported by this operation, see Media formats.

  • This operation is mainly applicable to scenarios where files are not stored on a local server or terminal and need to be uploaded through a URL with public network access.

  • This operation is an asynchronous upload operation. It is not real-time and does not guarantee timeliness. Generally, the migration upload is completed within hours or even days after the node is submitted. If you have high timeliness requirements, use the upload SDK instead.

  • If a callback is configured, you will receive the URL upload video complete event notification after the upload is completed. You can call the GetURLUploadInfos operation to query the upload status.

  • After an upload node is submitted, an asynchronous node is generated in the cloud for execute. All URL upload nodes committed by users in the corresponding service region are queued for execute. The completion time is affected by the number of existing nodes. After the upload is completed, you can associate the URL with the video ID based on the information returned in the event notification (message callback).

  • This operation currently supports only the China (Shanghai), China (Beijing), China (Shenzhen), Singapore, and US (Silicon Valley) regions.

  • Each time you commit an upload node for the same media file URL, a new media resource is generated in ApsaraVideo VOD (that is, a new media ID is generated).

  • If a single file exceeds 20 GB, the upload is failed. If you need to upload a single file larger than 20 GB, use the upload SDK. For more information, see Overview of the upload SDK.

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

vod:UploadMediaByURL

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

UploadURLs

string

Yes

The URLs of media source files.

  • The URL must include a file name extension. For example, mp4 is the file name extension in https://****.mp4.
    • If the URL does not include a file name extension, you can specify the FileExtension parameter in UploadMetadatas.

    • If the URL includes a file name extension and the FileExtension parameter is also specified, the value of FileExtension takes precedence.

    • For supported file name extensions, see Upload overview.

Note
  • Separate multiple URLs with commas (,). A maximum of 20 URLs are supported. To prevent upload failures caused by special characters, URL-encode each URL before joining them with commas.

https://****.mp4

TemplateGroupId

string

No

The ID of the transcoding template group. You can obtain the ID by using one of the following methods:

  • Log on to the ApsaraVideo VOD console and choose Configuration Management > Media Processing > Transcoding Template Groups to view the transcoding template group ID.

  • Obtain the value of TranscodeTemplateGroupId from the response when you call the AddTranscodeTemplateGroup operation.

  • Obtain the value of TranscodeTemplateGroupId from the response when you call the ListTranscodeTemplateGroup operation.

Note
  • If you do not specify a transcoding template group ID, the default transcoding template group is used. If you specify a transcoding template group ID, the specified template group is used.

  • You can also set this parameter in UploadMetadatas. If TemplateGroupId is set in both UploadMetadatas and this parameter, the value in UploadMetadatas takes precedence.

ca3a8f6e4957b65806709586****

StorageLocation

string

No

The storage address of the media file.

Log on to the ApsaraVideo VOD console and choose Configuration Management > Media Asset Management > Storage to view the storage address. If you do not specify this parameter, the default storage address is used.

outin-bfefbb90a47c******163e1c7426.oss-cn-shanghai.aliyuncs.com

UploadMetadatas

string

No

The metadata of the media files to upload. The value is a JSON string.

  • The metadata takes effect only when it matches a URL in UploadURLs.

  • JSON format: [UploadMetadata, UploadMetadata,…]. The value must be converted to a JSON string.

  • For more information, see the UploadMetadata table below.

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

UserData

string

No

The custom settings. The value is a JSON string that supports message callback and upload acceleration settings. For more information, see UserData.

Note
  • To use message callbacks in this parameter, you must configure an HTTP callback URL and select the corresponding callback event types in the console. Otherwise, the callback settings do not take effect. For information about how to configure HTTP callbacks in the console, see Callback settings.

  • To use the upload acceleration feature, submit a ticket to activate it. For more information, see Upload instructions. For information about how to submit a ticket, see Contact us.

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

AppId

string

No

The application ID. Default value: app-1000000. For more information, see Multi-application.

app-****

WorkflowId

string

No

The workflow ID. Log on to the ApsaraVideo VOD console and choose Configuration Management > Media Processing > Workflows to view the workflow ID.

Note

If both WorkflowId and TemplateGroupId are specified, WorkflowId takes precedence. For usage instructions, see Workflows.

e1e243b42548248197d6f74f9****

SessionId

string

No

The custom deduplication identifier. If this parameter is specified and a request with the same identifier was sent within the past 10 minutes, an error is returned for the current request.

Note
  • This deduplication identifier is custom-defined. It can be up to 50 characters in length and can contain uppercase and lowercase letters, digits, hyphens (-), and underscores (_). If this parameter is not specified or is set to an empty string, deduplication is not performed.

5c62d40299034bbaa4c195da330****

EnableFirstFrameCover

boolean

No

GenerateThumbnail

boolean

No

UploadMetadata

NameTypeRequiredDescription
SourceURLStringYesThe URL of the media source file to upload.
TitleStringNoThe title of the media file. The title can be up to 128 bytes in length. UTF-8 encoding is used.
FileSizeStringNoThe file size.
DescriptionStringNoThe description. The description can be up to 1024 bytes in length. UTF-8 encoding is used.
CoverURLStringNoThe custom video thumbnail URL.
CateIdStringNoThe category ID. Log on to the ApsaraVideo VOD console and choose Configuration Management > Media Asset Management > Categories to view the category ID.
TagsStringNoThe tags. Each tag can be up to 32 bytes in length. A maximum of 16 tags are supported. Separate multiple tags with commas (,). UTF-8 encoding is used.
TemplateGroupIdStringNoThe transcoding template group ID. This value overrides the TemplateGroupId specified in the outer parameter.
WorkflowIdStringNoThe workflow ID. If both WorkflowId and TemplateGroupId are specified, WorkflowId takes precedence. For more information, see Workflows.
FileExtensionStringNoThe file name extension of the media file. For supported file name extensions, see Upload overview.
ReferenceIdStringNoThe custom ID. Only lowercase letters, uppercase letters, digits, hyphens (-), and underscores (_) are supported. The value must be 6 to 64 characters in length. The value must be unique within a user account.
Note
  • Parameters in UploadMetadata (such as Title, Description, and Tags) cannot contain emoji characters.

  • To ensure normal playback, when you upload video files with TemplateGroupId set to "VOD_NO_TRANSCODE" (no transcoding), only the following formats support direct playback without transcoding: MP4, FLV, MP3, M3U8, and WEBM. Other formats support storage only (pay attention to the file name extension of FileName). If you use Alibaba Cloud Player, the version must be 3.1.0 or later.

  • If you specify a no-transcoding template group (TemplateGroupId set to "VOD_NO_TRANSCODE"), only the video upload complete event notification is sent after the video is uploaded. The single stream transcoding complete event notification is not sent.

  • If a callback is configured, after the video upload is completed, in addition to the upload and transcoding notifications, the URL upload video complete event notification is also sent.

  • When you submit tasks in batches, each SourceURL has an independent notification.

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

25818875-5F78-4AF6-D7393642CA58****

UploadJobs

array<object>

The list of upload jobs.

object

The details of an upload job.

SourceURL

string

The source file URL of the upload job.

http://example****.mp4

JobId

string

The ID of the upload job.

ad90a501b1b94fb72374ad005046****

Examples

Success response

JSON format

{
  "RequestId": "25818875-5F78-4AF6-D7393642CA58****",
  "UploadJobs": [
    {
      "SourceURL": "http://example****.mp4",
      "JobId": "ad90a501b1b94fb72374ad005046****"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.