Post Script Configuration
This page documents the configuration parameters for the post script used in task creation.
Overview
The post script is used to automatically publish content (videos or images) to TikTok or Instagram. It supports various posting methods, material sources, and sound options.
Request Parameters
When creating a task, you can specify the following top-level parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| serials | string[] | Conditional | [] | List of device serial numbers (Mode 1: device-based) |
| usernames | string[] | Conditional | [] | List of usernames to create tasks for (Mode 2: username-based) |
| script_name | string | Yes | - | Script name to execute (e.g., "post") |
| script_config | object | Yes | - | Script configuration parameters (see below) |
| enable_multi_account | boolean | No | false | Enable multi-account mode (create task for each account on device) |
| start_time | string | No | - | Optional start time in format "HH:MM" |
| platform | string | Conditional* | auto | Target platform: tiktok, instagram. See note below |
Note: Either serials or usernames must be provided.
*Platform Parameter Behavior:
- TikMatrix & IgMatrix: The
platformparameter is ignored if provided. The platform is automatically determined from the app name (TikMatrix → tiktok, IgMatrix → instagram). - TikMatrix Pro: The
platformparameter is required and must be explicitly specified as eithertiktokorinstagram.
Script Configuration (script_config)
The script_config object contains the parameters for the post script. Below are the available parameters:
Common Parameters (TikTok & Instagram)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| content_type | integer | No | 0 | Content type: 0 = Video, 1 = Images |
| image_count | integer | No | 1 | Number of images to select (when content_type = 1) |
| captions | string | No | "" | Caption text for the post. Supports spintax format: {option1|option2|option3} |
| post_way | string | No | "share" | Post method: share, addButton, or useSound |
| material_source | string | No | "materialLibrary" | Material source: materialLibrary or localFolder (ignored if material_list is provided) |
| material_path | string | Conditional | "" | Local folder path (required when material_source = "localFolder") |
| material_list | string[] | No | [] | Direct material file paths array. When provided, bypasses material_source and material_path logic. Ideal for API automation. |
| materials_tags | string | No | "" | Comma-separated material tags for filtering from library |
| upload_wait_time | integer | No | 30 | Seconds to wait for upload completion |
| sound_wait_time | integer | No | 10 | Seconds to wait for sound loading |
| add_sound | string/integer | No | "-1" | Sound option: -1 = default, 0 = disable, 1 = enable, custom = use custom sound |
| sound_name | string | Conditional | "" | Sound name/URL (required when post_way = "useSound") |
| custom_sound_keyword | string | Conditional | "" | Keyword to search for custom sound (required when add_sound = "custom") |
| origin_sound_volume | integer | No | 50 | Original sound volume (0-100) |
| add_sound_volume | integer | No | 50 | Added sound volume (0-100) |
TikTok Specific Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| add_product_link | integer | No | 0 | Add product link: 0 = No, 1 = Yes |
Instagram Specific Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| placement | string | No | "reel" | Post placement: reel or story |
Examples
Basic Post Task with Direct Material List
This is the recommended approach for API automation - pass material paths directly without relying on material library or folder scanning:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "post",
"script_config": {
"content_type": 0,
"captions": "Check out my new video! #viral #fyp",
"material_list": [
"C:/Videos/video1.mp4"
],
"upload_wait_time": 60
}
}'
Post Task with Material Library (TikTok)
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1", "device_serial_2"],
"script_name": "post",
"script_config": {
"content_type": 0,
"captions": "Check out my new video! #viral #fyp",
"post_way": "addButton",
"material_source": "materialLibrary",
"materials_tags": "trending, dance",
"upload_wait_time": 60,
"add_sound": "-1"
},
"enable_multi_account": false
}'
Post Task by Username List
This mode allows you to create tasks directly for specific accounts without knowing their device serial numbers:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"usernames": ["@user1", "@user2", "@user3"],
"script_name": "post",
"script_config": {
"content_type": 0,
"captions": "Check out my new video! #viral #fyp",
"material_list": [
"C:/Videos/video1.mp4"
],
"upload_wait_time": 60
}
}'
Post Task with Local Folder (Instagram)
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "post",
"script_config": {
"content_type": 0,
"captions": "Amazing content! #instagram #reels",
"post_way": "addButton",
"placement": "reel",
"material_source": "localFolder",
"material_path": "C:/Videos/instagram",
"upload_wait_time": 45
},
"enable_multi_account": true
}'
Post with Custom Sound
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "post",
"script_config": {
"content_type": 0,
"captions": "Dancing to this trending sound!",
"post_way": "addButton",
"add_sound": "custom",
"custom_sound_keyword": "trending dance 2024",
"origin_sound_volume": 30,
"add_sound_volume": 70,
"material_source": "materialLibrary",
"upload_wait_time": 60
}
}'
Post Using Specific Sound URL
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "post",
"script_config": {
"post_way": "useSound",
"sound_name": "https://www.tiktok.com/music/original-sound-7123456789",
"captions": "Using this awesome sound!",
"material_source": "materialLibrary"
}
}'
Post Images (Carousel)
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "post",
"script_config": {
"content_type": 1,
"image_count": 5,
"captions": "Check out these photos! #photocarousel",
"material_source": "localFolder",
"material_path": "C:/Images/carousel",
"upload_wait_time": 45
}
}'
Post with Explicit Platform Selection
You can explicitly specify the target platform using the platform parameter. This is useful when you want to override the environment default:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "post",
"platform": "instagram",
"script_config": {
"content_type": 0,
"captions": "Posting to Instagram! #instagram #reels",
"placement": "reel",
"material_list": [
"C:/Videos/instagram_video.mp4"
],
"upload_wait_time": 60
}
}'
Response
{
"code": 0,
"message": "success",
"data": {
"task_ids": [101, 102],
"created_count": 2
}
}
See Also
- Task Management API - Create, list, and manage tasks