TokPortal + n8n - TikTok Workflow via HTTP
Build a realistic n8n workflow that calls the TokPortal REST API to create a TikTok bundle, configure account/video data, and publish.
TokPortal + n8n
TokPortal does not currently provide a native n8n node. Use n8n's HTTP Request node with the public REST API.
This workflow creates a TikTok bundle, configures the account profile, configures one or more video slots from public video URLs, then publishes the bundle. TokPortal handles the order lifecycle after publish; the API does not guarantee views, reach, or avoidance of platform enforcement.
Prerequisites
- A TokPortal account with credits
- A TokPortal API key from the Developer Portal
- n8n Cloud or self-hosted n8n
- Video files available as public/direct URLs, or uploaded through Media Upload
1. Create the HTTP credential
Create an n8n credential for header authentication:
| Field | Value |
|---|---|
| Header Name | X-API-Key |
| Header Value | sk_your_key_here |
Every TokPortal API request also needs Content-Type: application/json when the body is JSON.
2. Trigger the workflow
Typical triggers:
| Trigger | Expected fields |
|---|---|
| Google Sheets row | country, username, visible_name, bio, profile_picture_url, video_url, description, target_publish_date |
| Webhook | JSON payload from your CMS or internal tool |
| Schedule | Pull queued rows from Airtable, Sheets, or a database |
Use country codes returned by GET /countries. US and GB aliases are accepted by the API, but the platform may return canonical codes such as USA or UK.
3. Create a bundle
Add an HTTP Request node:
{
"method": "POST",
"url": "https://app.tokportal.com/api/ext/bundles",
"headers": {
"Content-Type": "application/json"
},
"body": {
"bundle_type": "account_and_videos",
"platform": "tiktok",
"country": "US",
"title": "n8n TikTok workflow",
"videos_quantity": 3,
"external_ref": "n8n-{{$json.row_id}}"
}
}
Save {{$json.data.bundle_id}} from the response. Costs are calculated server-side and returned as credits_charged and cost_breakdown.
Reference: Create Bundle
4. Configure the account profile
Account configuration is required before publishing.
{
"method": "PUT",
"url": "https://app.tokportal.com/api/ext/bundles/{{$json.data.bundle_id}}/account",
"headers": {
"Content-Type": "application/json"
},
"body": {
"username": "mybrand_us",
"visible_name": "My Brand",
"biography": "Daily product videos.",
"profile_picture_url": "https://cdn.example.com/mybrand/profile.jpg"
}
}
Reference: Account Configuration
5. Configure videos
If your trigger already provides a public video URL, pass it directly as video_url.
{
"method": "PUT",
"url": "https://app.tokportal.com/api/ext/bundles/{{bundle_id}}/videos/1",
"headers": {
"Content-Type": "application/json"
},
"body": {
"video_type": "video",
"description": "New drop is live #newarrival",
"target_publish_date": "2026-06-05",
"video_url": "https://cdn.example.com/videos/drop-01.mp4",
"external_ref": "drop-01"
}
}
For local files or browser uploads, first use Media Upload:
POST /upload/video/directuploads the file through TokPortal.POST /upload/videoreturns a presigned URL so a client can upload directly to storage.- For 50-100 MB videos, prefer presigned upload or a stable public URL instead of routing the binary through n8n/Zapier if your automation plan has small payload limits.
Reference: Configure Videos
6. Publish
When the account and at least one video are configured, publish the bundle:
{
"method": "POST",
"url": "https://app.tokportal.com/api/ext/bundles/{{bundle_id}}/publish"
}
If publish is blocked, call GET /bundles/{id}/publish-readiness or read the publish error response to see which account/video fields are missing.
Reference: Publish & Unpublish
Multi-country workflows
POST /bundles/bulk creates multiple bundles for one country and one or more platforms. To cover several countries in n8n, loop over a country list and call the bulk endpoint once per country.
{
"method": "POST",
"url": "https://app.tokportal.com/api/ext/bundles/bulk",
"headers": {
"Content-Type": "application/json"
},
"body": {
"platforms": ["tiktok"],
"country": "US",
"accounts_count": 5,
"upload_accounts_count": 2,
"videos_per_account": 10,
"wants_niche_warming": true,
"niche_warming_instructions": "Lifestyle and product review content.",
"external_ref": "n8n-q2-us"
}
}
This creates 5 TikTok bundles in the selected country. The first 2 bundles include video slots; the remaining 3 are account-only bundles.
Reference: Create Bulk
Monitoring
Add optional n8n branches for:
GET /bundles/{id}to check bundle status- Webhooks to receive
bundle.*,account.*, andvideo.*events - Analytics after accounts and posts are live
Related guides: Zapier, Make, Python Quickstart.