All Products
Search
Document Center

ApsaraVideo Live:SetLiveStreamPreloadTasks

Last Updated:Oct 20, 2025

Creates tasks to prefetch live streams in batches.

Operation description

  • You can specify up to 100 URLs in a request.

  • URLs in the HTTP Live Steaming (HLS) format are not supported.

QPS limit

You can call this operation up to 50 times per second per account. Requests that exceed this limit are dropped and you may experience service interruptions.

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

live:SetLiveStreamPreloadTasks

*Domain

acs:cdn:*:{#accountId}:domain/{#DomainName}

None

None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID.

cn-shanghai

DomainName

string

Yes

The streaming domain name.

example.com

PlayUrl

string

Yes

A comma-separated list of the live stream URLs to prefetch. You can specify up to 100 URLs.

rtmp://guide.aliyundoc.com/liveApp****/liveStream****

Area

string

No

The acceleration region where you want to prefetch the live content. Valid values:

  • domestic: regions in the Chinese mainland.

  • overseas: regions outside the Chinese mainland.

  • global: regions in and outside the Chinese mainland.

If you do not specify this parameter, the acceleration region of the domain name is used.

domestic

PreloadedStartTime

string

No

The start time of the prefetch task. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. If you do not specify this parameter, the prefetch task runs for 1 hour by default.

2016-06-29T19:00:00Z

PreloadedEndTime

string

No

The end time of the prefetch task. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. The interval between the start time and end time cannot exceed 6 hours.

2016-06-30T19:00:00Z

Response elements

Parameter

Type

Description

Example

object

FailedURL

integer

The number of URLs in the request for which a prefetch task failed to be created.

0

PreloadTasksMessages

object

PreloadTasksMessage

array<object>

The details of the prefetch tasks.

object

The details of the prefetch tasks.

Description

string

Indicates if the prefetch task for a URL was created. Valid values:

  • Successfully

  • InternalError

Successfully

PlayUrl

string

The live stream URL.

rtmp://guide.aliyundoc.com/liveApp****/liveStream****

TaskId

string

The task ID.

yourTaskId

RequestId

string

The request ID.

36E0E523-E0C6-5D95-A465-A8EA2DCBA2A5

Status

string

The overall status of the task creation request. Valid values:

  • Success: All tasks were created.

  • Failed: At least one task failed to be created.

Note

Success is returned only if the prefetch task is configured for all specified URLs.

Success

SuccessURL

integer

The number of URLs in the request for which a prefetch task was created.

1

TotalURL

integer

The total number of URLs submitted in the request.

1

Examples

Success response

JSON format

{
  "FailedURL": 0,
  "PreloadTasksMessages": {
    "PreloadTasksMessage": [
      {
        "Description": "Successfully",
        "PlayUrl": "rtmp://guide.aliyundoc.com/liveApp****/liveStream****",
        "TaskId": "yourTaskId"
      }
    ]
  },
  "RequestId": "36E0E523-E0C6-5D95-A465-A8EA2DCBA2A5",
  "Status": "Success",
  "SuccessURL": 1,
  "TotalURL": 1
}

Error codes

HTTP status code

Error code

Error message

Description

400

InvalidParam

Parameter invalid.

Illegal input parameters

400

InvalidEndTime.Mismatch

Specified end time does not match the specified start time.

400

Duration.Exceed

Duration between StartTime and EndTime is too long.

400

QuotaExceeded.PreloadTaskslimit

Exceed max task count limit

400

NoSpecialConfiguration

no special configuration for domain name.

500

InternalError

The request processing has failed due to backend service exception.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.