TikTok for Developers

Developer Docs

Last updated November 24, 2026

Create a Mini Drama Transcoding Task

Creates a batch task that transcodes up to 1,000 videos with a BytePlus transcoding template. Transcoding produces multiple bitrates so viewers can choose a quality level. To check progress, call Query a Mini Drama Transcoding Task.

Caution: When you use this endpoint, TikTok adds a callback subscription to Callbacks in your BytePlus console: https://open.tiktokapis.com/v2/sg/shortdrama/video/transcode/callback/. Don't modify or delete it.

Endpoint

HTTP URL

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

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

Idempotency-Key

string

A unique key for the task. TikTok doesn't process a second request with the same key. You should use a UUID.

Yes

3f2504e0-4f89-11d3-9a0c-0305e82c3301

Request body

Field

Type

Description

Required

Example

byteplus_account_id

string

The ID of the BytePlus account.

Yes

3000000000

space_name

string

The name of the BytePlus space.

Yes

shortdrama-sg

vids

list<string>

The IDs of the videos to transcode. Maximum: 1000.

Yes

["v0d000example0000000000000000001"]

template_type

int32

The template type. One of:
• 0: The default template.
• 1: A custom BytePlus template.

Yes

0

template_id

string

The ID of the transcoding template. Pass default_0 when template_type is 0, or your BytePlus custom template ID when template_type is 1.

Yes

default_0

Request example

curl --location --request POST 'https://open.tiktokapis.com/v2/sg/shortdrama/video/transcode/batch/' \
--header 'Authorization: Bearer CLIENT_ACCESS_TOKEN' \
--header 'Idempotency-Key: IDEMPOTENCY_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "byteplus_account_id": "BYTEPLUS_ACCOUNT_ID",
  "space_name": "SPACE_NAME",
  "vids": [
    "v0d000example0000000000000000001",
    "v0d000example0000000000000000002",
    "v0d000example0000000000000000003"
  ],
  "template_id": "default_0",
  "template_type": 0
}'

Replace the following:

  • CLIENT_ACCESS_TOKEN: your mini app's client access token.
  • IDEMPOTENCY_KEY: a unique key for this task, such as a UUID.
  • 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

TranscodeTaskData

The new task.

error

ErrorStruct

The error object.

TranscodeTaskData

Field

Type

Description

Example

task_id

string

The ID of the batch task.

transcode:batch:7300000000000000004

task_status

string

The task status.

PROCESSING

total_count

int32

The number of videos in the task.

3

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": {
    "task_id": "transcode:batch:7300000000000000004",
    "task_status": "PROCESSING",
    "total_count": 3
  },
  "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.

1121008

The request is invalid.

Check the required fields and field limits, then retry.

1121009

vids contains more videos than allowed.

Split the request and retry.

1121406

The BytePlus account isn't authorized for this request.

Verify the account binding and credentials.

1121601

The Idempotency-Key was used with a different request.

Reuse the original request body, or use a new key.

TikTok for Developers