Skip to main content

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:

ParameterTypeRequiredDefaultDescription
serialsstring[]Conditional[]List of device serial numbers (Mode 1: device-based)
usernamesstring[]Conditional[]List of usernames to create tasks for (Mode 2: username-based)
script_namestringYes-Script name to execute (e.g., "post")
script_configobjectYes-Script configuration parameters (see below)
enable_multi_accountbooleanNofalseEnable multi-account mode (create task for each account on device)
start_timestringNo-Optional start time in format "HH:MM"
platformstringConditional*autoTarget platform: tiktok, instagram. See note below

Note: Either serials or usernames must be provided.

*Platform Parameter Behavior:

  • TikMatrix & IgMatrix: The platform parameter is ignored if provided. The platform is automatically determined from the app name (TikMatrix → tiktok, IgMatrix → instagram).
  • TikMatrix Pro: The platform parameter is required and must be explicitly specified as either tiktok or instagram.

Script Configuration (script_config)

The script_config object contains the parameters for the post script. Below are the available parameters:

Common Parameters (TikTok & Instagram)

ParameterTypeRequiredDefaultDescription
content_typeintegerNo0Content type: 0 = Video, 1 = Images
image_countintegerNo1Number of images to select (when content_type = 1)
captionsstringNo""Caption text for the post. Supports spintax format: {option1|option2|option3}
post_waystringNo"share"Post method: share, addButton, or useSound
material_sourcestringNo"materialLibrary"Material source: materialLibrary or localFolder (ignored if material_list is provided)
material_pathstringConditional""Local folder path (required when material_source = "localFolder")
material_liststring[]No[]Direct material file paths array. When provided, bypasses material_source and material_path logic. Ideal for API automation.
materials_tagsstringNo""Comma-separated material tags for filtering from library
upload_wait_timeintegerNo30Seconds to wait for upload completion
sound_wait_timeintegerNo10Seconds to wait for sound loading
add_soundstring/integerNo"-1"Sound option: -1 = default, 0 = disable, 1 = enable, custom = use custom sound
sound_namestringConditional""Sound name/URL (required when post_way = "useSound")
custom_sound_keywordstringConditional""Keyword to search for custom sound (required when add_sound = "custom")
origin_sound_volumeintegerNo50Original sound volume (0-100)
add_sound_volumeintegerNo50Added sound volume (0-100)

TikTok Specific Parameters

ParameterTypeRequiredDefaultDescription
add_product_linkintegerNo0Add product link: 0 = No, 1 = Yes

Instagram Specific Parameters

ParameterTypeRequiredDefaultDescription
placementstringNo"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