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 |
|
HTTP method |
|
Scopes |
|
Content type |
|
Request
Headers
Field | Type | Description | Required | Example |
|
| The client access token of your mini app, prefixed with | Yes |
|
|
| The media type of the request body. | Yes |
|
|
| A unique key for the task. TikTok doesn't process a second request with the same key. You should use a UUID. | Yes |
|
Request body
Field | Type | Description | Required | Example |
|
| The ID of the BytePlus account. | Yes |
|
|
| The name of the BytePlus space. | Yes |
|
|
| The IDs of the videos to transcode. Maximum: | Yes |
|
|
| The template type. One of: | Yes |
|
|
| The ID of the transcoding template. Pass | Yes |
|
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 |
| The new task. | |
| The error object. |
TranscodeTaskData
Field | Type | Description | Example |
|
| The ID of the batch task. |
|
|
| The task status. |
|
|
| The number of videos in the task. |
|
ErrorStruct
Field | Type | Description |
|
| The error code. Omitted on success. |
|
| A human-readable description of the error. |
|
| 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 |
| The service is temporarily unavailable. | Retry later. If the error persists, contact support with the |
| The request is invalid. | Check the required fields and field limits, then retry. |
|
| Split the request and retry. |
| The BytePlus account isn't authorized for this request. | Verify the account binding and credentials. |
| The | Reuse the original request body, or use a new key. |