All Products
Search
Document Center

ApsaraVideo VOD:RefreshMediaPlayUrls

Last Updated:Jul 21, 2026

Submits a refresh or prefetch task for audio or video files by audio or video ID.

Operation description

  • ApsaraVideo VOD provides resource purge and prefetch features. The purge feature deletes cached resources on points of presence and forces the points of presence to retrieve the latest resources from the origin server through back-to-origin requests. The prefetch feature allows you to download and cache popular resources to points of presence before peak hours to improve access efficiency.

  • This operation directly submits a refresh or prefetch node by audio or video ID and supports filtering by streaming format and definition, which allows you to refresh or prefetch specific streams as needed.

  • You can submit a refresh or prefetch node for up to 20 audio or video files at a time.

QPS limit

The QPS limit for a single user for this operation is 50 calls per second. If the limit is exceeded, the API invocation is throttled, which may affect your business. Invoke this operation properly. For more information, see QPS limit.

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:RefreshMediaPlayUrls

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

MediaIds

string

Yes

The IDs of the audio or video files that you want to refresh or prefetch. You can specify one or more IDs. Separate multiple IDs with commas (,). You can specify up to 20 IDs. You can obtain audio or video IDs by using the following methods:

  • For audio or video files uploaded through the console, log on to the ApsaraVideo VOD console and choose Media Files > Audio/Video to view the audio or video ID.

  • When you call the CreateUploadVideo operation to obtain the upload URL and credential, the audio or video ID is the value of the VideoId response parameter.

  • After the audio or video file is uploaded, you can call the SearchMedia operation to query the audio or video ID, which is the value of the VideoId response parameter.

ca3a8f6e4957b658067095869****, a6e49sfgd23p5g9ja7095863****

TaskType

string

Yes

The type of the task. Valid values:

  • Refresh: purge.

  • Preload: prefetch.

Preload

Formats

string

No

The streaming formats that you want to refresh or prefetch. You can specify multiple formats. Separate multiple formats with commas (,). If you do not specify this parameter, streams in all formats are refreshed or prefetched by default. Valid values:

  • mp4

  • m3u8

  • mp3

  • flv

  • webm

  • ts

mp4,m3u8

Definitions

string

No

Specifies the definitions of the streams that you want to purge or prefetch. You can specify multiple definitions. Separate multiple definitions with commas (,). If you do not specify this parameter, streams in all definitions are purged or prefetched by default.

Note

The value must be one of the values defined in Definition in Metric description for media assets.

HD, SD

StreamType

string

No

The types of the streams that you want to refresh or prefetch. You can specify multiple stream types. Separate multiple stream types with commas (,). If you do not specify this parameter, all stream types are refreshed or prefetched by default. Valid values:

  • video: video.

  • audio: audio.

video

ResultType

string

No

The result type of the refresh or prefetch task. Valid values:

  • Single (default): Only the latest transcoded stream for each definition and format is refreshed or prefetched.

  • Multiple: All transcoded streams for each definition and format are refreshed or prefetched.

Single

SliceFlag

boolean

No

Specifies whether to refresh or prefetch the playback URLs of TS files in M3U8 streams. Valid values:

  • false (default): No.

  • true: Yes.

false

SliceCount

integer

No

The number of TS file playback URLs to refresh or prefetch for M3U8 streams. Only the first N TS file playback URLs of each M3U8 stream are refreshed or prefetched. Valid values: 1 to 20. Default value: 5.

5

UserData

string

No

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

Note
  • To use message callbacks in this parameter, 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"}}

Response elements

Element

Type

Description

Example

object

The response parameters.

MediaRefreshJobId

string

The ID of the refresh or prefetch task.

41d465e31957****

NonExistMediaIds

string

The list of audio or video IDs that do not exist.

ca3a8f6e4957b658067095869****

ForbiddenMediaIds

string

The list of audio or video IDs that are forbidden. This is typically because you do not have multi-application permissions. For more information, see Multi-application.

a6e49sfgd23p5g9ja7095863****

RequestId

string

The request ID.

25818875-5F78-4AF6-04D5-D7393642****

Examples

Success response

JSON format

{
  "MediaRefreshJobId": "41d465e31957****",
  "NonExistMediaIds": "ca3a8f6e4957b658067095869****",
  "ForbiddenMediaIds": "a6e49sfgd23p5g9ja7095863****",
  "RequestId": "25818875-5F78-4AF6-04D5-D7393642****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.