Send DMs
The outreach pipeline sends templated DMs to crawled influencers via TikTok’s messaging system. It handles the full flow: search for the user, navigate to their profile, open messages, type the message, and send. 236+ DMs sent in production.
Quick Start
Section titled “Quick Start”# Send DMs using strategy #1, targeting influencers with 10K+ followerspython3 -m marketing_system.bots.tiktok.outreach \ --strategy-id 1 \ --min-followers 10000 \ --delay 60 \ --limit 20REST API
Section titled “REST API”curl -X POST http://localhost:5055/api/bot/start \ -H "Content-Type: application/json" \ -d '{ "type": "outreach", "device": "L9AIB7603188953", "params": { "strategy_id": 1, "min_followers": 10000, "max_followers": 500000, "limit": 20, "delay": 60 } }'Python
Section titled “Python”from marketing_system.skills.tiktok import loadfrom marketing_system.bots.common.adb import Device
dev = Device()skill = load()wf = skill.get_workflow("send_dm", dev, contact="@username", message="Hey! Love your content.")result = wf.run()How It Works
Section titled “How It Works”For each targeted influencer, the bot performs this sequence:
- Search — type
@handlein TikTok search - Users tab — switch to Users tab in results
- Tap user — tap the matching user row
- Message button — tap “Message” on their profile
- Type message — type the strategy text with
{{handle}}substitution - Send — tap the send button
- Back out — navigate back to prepare for the next DM
Each DM takes approximately 30-45 seconds of device time.
Strategies
Section titled “Strategies”Outreach messages are stored as templates in the outreach_strategies table. The {{handle}} placeholder is replaced with the influencer’s username at send time.
Create a Strategy
Section titled “Create a Strategy”curl -X POST http://localhost:5055/api/strategies \ -H "Content-Type: application/json" \ -d '{ "name": "Free credits offer", "message": "Hey {{handle}}! Love your content. We are offering free credits to try our platform. Interested?" }'Manage Strategies
Section titled “Manage Strategies”# List all strategiescurl -s http://localhost:5055/api/strategies | python3 -m json.tool
# Update a strategycurl -X PUT http://localhost:5055/api/strategies/1 \ -H "Content-Type: application/json" \ -d '{"message": "Updated message text..."}'
# Delete a strategycurl -X DELETE http://localhost:5055/api/strategies/1You can also manage strategies from the Strategies tab in the dashboard.
Filtering Targets
Section titled “Filtering Targets”The outreach bot selects influencers from the database based on:
| Filter | CLI Flag | Description |
|---|---|---|
| Min followers | --min-followers | Only contact influencers above this threshold |
| Max followers | --max-followers | Skip mega-influencers who won’t respond |
| Labels | --label | Target specific categories (cat, dog, pet) |
| Status | Automatic | Only contacts not_contacted influencers |
| Custom query | --query | SQL WHERE clause for advanced filtering |
Status Tracking
Section titled “Status Tracking”Each influencer progresses through a status pipeline:
not_contacted -> dm_sent -> replied -> deal_closed \-> rejectedStatus updates happen automatically:
dm_sent— set immediately after successful sendreplied— detected by inbox scanningdeal_closed/rejected— set manually via API or dashboard
# Manual status updatecurl -X POST http://localhost:5055/api/outreach/42 \ -H "Content-Type: application/json" \ -d '{"status": "deal_closed", "notes": "Agreed to collab"}'Rate Limiting
Section titled “Rate Limiting”The bot uses randomized delays between DMs to avoid detection:
- Default delay: 60 seconds
- Actual delay: randomized between 45-75 seconds (
random.uniform(0.75, 1.25) * delay) - Daily limit: configurable via
--limitflag (default: no limit)
Use stealth mode for additional detection avoidance:
dev.stealth_tap(540, 1200) # Gaussian jitter on coordinatesdev.stealth_type("message") # Character-by-character with random delaysInbox Scanning
Section titled “Inbox Scanning”After sending DMs, scan the inbox to detect replies:
# Scan DM inboxpython3 -m marketing_system.bots.tiktok.inbox_scanner --max-scrolls 10Or via the API:
curl -X POST http://localhost:5055/api/bot/start \ -H "Content-Type: application/json" \ -d '{"type": "inbox_scan", "device": "L9AIB7603188953", "params": {"max_scrolls": 10}}'The scanner captures reply screenshots and updates influencer statuses in the database.
Scheduling Outreach
Section titled “Scheduling Outreach”Set up recurring outreach via the scheduler:
curl -X POST http://localhost:5055/api/schedules \ -H "Content-Type: application/json" \ -d '{ "name": "Daily outreach", "job_type": "outreach", "device": "L9AIB7603188953", "interval_minutes": 1440, "params": {"strategy_id": 1, "min_followers": 10000, "limit": 15}, "max_duration_minutes": 30, "priority": 3 }'Limitations
Section titled “Limitations”- ASCII only — emoji and non-ASCII characters are stripped from messages. This is a limitation of
adb shell input text. - One account per device — cannot send from multiple TikTok accounts simultaneously on the same phone
- No read receipts — cannot detect if the DM was read, only if a reply was received
Related
Section titled “Related”- Scrape Profiles — find influencers to contact
- Stealth Mode — reduce detection risk during outreach
- Scheduler — automate recurring outreach