Internal documentation for developers. This page covers the TikTok for Business API integration: OAuth callback, webhook architecture, and event routing. Not intended for end users.
Route Map
TikTok OAuth Flow
dm.conversation.readonly— Read DMsdm.conversation.write— Send DMs
Webhook Architecture
TikTok sends webhook events to the registered endpoint for DM events. Webhook verification (challenge-response):DM Event Payload
Conversation Routing
Incoming TikTok DM → identified bysender_id → create or continue ZappWay conversation with channel: 'tiktok' → route to assigned AI Employee.
Environment Variables Required
Known Issues / Gotchas
- TikTok API is strictly internal — no user-facing setup UI currently. Connection is done by dev team on behalf of customers.
- Token refresh: TikTok access tokens expire. A background job must refresh them before expiry using the
refresh_token. - DM availability: TikTok DM API access is restricted to approved business accounts. The app must be whitelisted by TikTok.
- Rate limits: TikTok imposes strict rate limits per business account. Monitor for
429responses.

