TikTok for Developers

Developer Docs

Last updated November 24, 2026

Create a Mini Drama CDN Preload Task

Creates a task that warms up the CDN with up to 100 video resources before viewers request them. Prewarm before a large-scale launch to reduce buffering on first playback. To check progress, call Query a Mini Drama CDN Preload Task.

Endpoint

HTTP URL

https://open.tiktokapis.com/v2/sg/shortdrama/cdn/preload/tasks/

HTTP method

POST

Scopes

None

Content type

application/json

Request

Headers

Field

Type

Description

Required

Example

Authorization

string

The client access token of your mini app, prefixed with Bearer.

Yes

Bearer clt.example12345Example12345Example

Content-Type

string

The media type of the request body.

Yes

application/json

Request body

Unlike other Media Asset API endpoints, this endpoint uses PascalCase field names, except client_key.

Field

Type

Description

Required

Example

client_key

string

The client key of your mini app.

Yes

mnexample12345

AccountID

string

The ID of the BytePlus account, as a non-empty decimal string.

Yes

3000000000

SpaceName

string

The name of the BytePlus space.

Yes

shortdrama-sg

Resources

list<ResourceItem>

The resources to preload. Maximum: 100.

Yes

See ResourceItem.

ResourceItem

Field

Type

Description

Required

Example

Vid

string

The ID of the video.

Yes

v0d000example0000000000000000001

StoreUris

list<string>

The storage URIs to preload. Use the store_uri values returned by Query Mini Drama Video Media Information. Each URI must not be empty and must be 4,096 bytes or smaller.

Yes

["example0000.mp4"]

Request example

curl --location --request POST 'https://open.tiktokapis.com/v2/sg/shortdrama/cdn/preload/tasks/' \
--header 'Authorization: Bearer CLIENT_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "client_key": "CLIENT_KEY",
  "AccountID": "BYTEPLUS_ACCOUNT_ID",
  "SpaceName": "SPACE_NAME",
  "Resources": [
    {
      "Vid": "v0d000example0000000000000000001",
      "StoreUris": ["example0000.mp4", "example0000transcode720p"]
    }
  ]
}'

Replace the following:

  • CLIENT_ACCESS_TOKEN: your mini app's client access token.
  • CLIENT_KEY: your mini app's client key.
  • BYTEPLUS_ACCOUNT_ID: the ID of the BytePlus account bound to your mini app.
  • SPACE_NAME: the name of your BytePlus space.

Response

Response body

Field

Type

Description

data

PreloadCreateData

The business data.

error

ErrorStruct

The error object.

PreloadCreateData

Field

Type

Description

ResponseMetadata

ResponseMetadata

The response metadata.

Result

PreloadCreateResult

The new task. Returned only on success. Result and ResponseMetadata.Error are mutually exclusive.

ResponseMetadata

Field

Type

Description

Example

RequestId

string

The ID of the downstream request.

202508010000000000000000000000000

Error

object

The downstream error, with Code and Message fields. Returned only on failure.

N/A

PreloadCreateResult

Field

Type

Description

Example

TaskID

string

The ID of the preload task.

31c6a06d-e686-42ef-9887-e4b7c39df3fa

ErrorStruct

Field

Type

Description

code

string

The error code. Omitted on success.

message

string

A human-readable description of the error.

log_id

string

The unique identifier for the request. Include this value when contacting support.

Response example

{
  "data": {
    "ResponseMetadata": {
      "RequestId": "202508010000000000000000000000000"
    },
    "Result": {
      "TaskID": "31c6a06d-e686-42ef-9887-e4b7c39df3fa"
    }
  },
  "error": {
    "log_id": "202508010000000000000000000000000"
  }
}

Error codes

Error code

Description

Resolution

5001

The service is temporarily unavailable.

Retry later. If the error persists, contact support with the log_id.

1121013

The request is invalid.

Check the required fields. Resources must contain 100 or fewer items, and each StoreUris value must be non-empty and 4,096 bytes or smaller.

1121408

The BytePlus account is unavailable for CDN preload.

Check the domain binding for your client key, the BytePlus account connection, and the account authorization.

1221508

BytePlus rejected the request.

Check the resources, domains, and BytePlus configuration, then retry. If the error persists, contact support with the RequestId.

TikTok for Developers