TikTok for Developers

Developer Docs

Last updated November 24, 2026

Upload a Mini Drama Video

Asynchronously uploads an episode video from a URL to your BytePlus space, or imports a video that already exists in BytePlus. A URL upload returns a job_id. Poll Query a Mini Drama Video with it to get the video's vid.

Important: Only a vid returned by this endpoint or by Query a Mini Drama Video can be used in an episode. A video ID that exists only in the BytePlus console can't be used.

Endpoint

HTTP URL

https://open.tiktokapis.com/v2/sg/shortdrama/video/

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

Field

Type

Description

Required

Example

url

string

Required when vid isn't provided. The download URL of the video. The URL must be a publicly accessible HTTP or HTTPS link. Supported formats: MP4, HLS (M3U8), FLV, ASF (WMV), RM, RMVB, MPEG, MOV, AVI, FLASH, MPEG-TS (MTS), M4S, and MKV.

Conditional

https://example.com/episode-01.mp4

vid

string

The ID of a video that already exists in your BytePlus space. Pass this value to import the video without uploading it again.

No

v0d000example0000000000000000000

title

string

Required when you upload by url without a vid. The title of the video.

Conditional

episode_01

space_name

string

The name of the BytePlus space to upload the video to.

Yes

shortdrama-sg

byteplus_account_id

string

The ID of the BytePlus account to upload the video to.

Yes

3000000000

byteplus_region

string

The BytePlus region. Default: ap-southeast-1, Asia Pacific (Johor).

No

ap-southeast-1

Note: For HLS (M3U8) videos, only unencrypted media playlists with TS segments are supported. Master playlists, fMP4 segments, and encrypted streams can fail during upload, review, transcoding, or playback.

Request example

curl --location 'https://open.tiktokapis.com/v2/sg/shortdrama/video/' \
--header 'Authorization: Bearer CLIENT_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://example.com/episode-01.mp4",
  "title": "episode_01",
  "space_name": "SPACE_NAME",
  "byteplus_account_id": "BYTEPLUS_ACCOUNT_ID"
}'

Replace the following:

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

Response

Response body

Field

Type

Description

data

VideoUploadData

The upload result. Omitted when the request fails.

error

ErrorStruct

The error object.

VideoUploadData

A URL upload returns only job_id. An import of an existing video returns only byteplus_vid. Neither returns byteplus_url.

Field

Type

Description

Example

job_id

string

The ID of the asynchronous upload task. Returned only for a URL upload. Use it to poll Query a Mini Drama Video.

vod:job:1234567890

byteplus_vid

string

The ID of the imported video. Returned only when you import an existing video.

v0d000example0000000000000000000

byteplus_url

string

The video playback URL. Not returned by this endpoint.

""

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": {
    "job_id": "vod:job:1234567890",
    "byteplus_vid": "",
    "byteplus_url": ""
  },
  "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.

1121001

A required field is missing or a field is invalid.

Check the error message for the field, correct it, and retry.

1121002

The video URL is invalid.

Provide an accessible HTTP or HTTPS URL.

1121202

The video belongs to a different client key.

Use the matching client key or a different vid.

1121401

The BytePlus account isn't authorized for this client key.

Connect the BytePlus account to your mini app on the Developer Portal.

1121403

HLS upload isn't enabled for this BytePlus account.

Contact the BytePlus team to enable HLS upload.

1221105

The video wasn't found in the requested BytePlus account, space, or region.

Verify the vid, account, space, and region.

1221402

The BytePlus space and region don't match the account bound to the client key.

Verify the space and region in the BytePlus console, then correct the request.

TikTok for Developers