Message Script Configuration
The message script sends direct messages through Threads on a real Android device. When you provide multiple target users via the API, one task is created per target user. Use start_time to schedule when each task may begin.
message is available on Threads in TikMatrix Pro. It is not a TikTok or Instagram runner. Threads signs in with the linked Instagram account, so the target must be an account that exposes a Message action in Threads.
Script Configuration (script_config)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| target_users | string[] | Yes* | [] | Target usernames; the API creates one task per entry |
| target_user | string | Yes* | "" | One username, or several separated by newlines/commas |
| message_content | string | Yes | "" | Message text to send |
Provide either target_users or target_user. If both are supplied, target_users takes priority. message_content must contain non-whitespace text.
Examples
Send one message
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "message",
"platform": "threads",
"script_config": {
"target_user": "@username_to_message",
"message_content": "Hello from Threads!"
}
}'
Message several users
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "message",
"platform": "threads",
"script_config": {
"target_users": ["@user1", "@user2", "@user3"],
"message_content": "Thanks for following!"
},
"start_time": "14:30"
}'
This creates one task for each target. usernames may be used instead of serials when targeting specific accounts already known to TikMatrix.
Device flow and limitations
The runner opens the target Threads profile, uses the profile's Message action, enters the text, and confirms the send. It uses the active Threads account on the device unless the task selects an account through the normal task account fields.
- This script does not create a Threads profile for an Instagram account that has never used Threads. Add that account in Threads once before running the task.
- A target with no Message action, a private account that cannot be opened, or a temporary Threads prompt causes the task to fail so it can be retried safely.
- Keep batches and timing conservative. The script performs real UI actions and is subject to Threads rate limits and account restrictions.
Response
{
"code": 0,
"message": "success",
"data": {
"task_ids": [501, 502, 503],
"created_count": 3
}
}
Error Codes
| Code | Description |
|---|---|
| 40001 | Missing target user or message content |
| 40003 | Script is not supported by the selected build or platform |
| 40301 | API access requires a Pro+ plan |
See Also
- Task Management API - Create, list, and manage tasks
- Follow Back Script Configuration - Follow followers and optionally send a greeting
- Super Marketing Script Configuration - Multi-action campaigns and dataset-based messaging
- Local API Overview - API overview and quick start