Quickstart

Quickstart

Build your first TokPortal API integration in 5 minutes. Step-by-step guide to create accounts and post videos programmatically.

Open

Build your first TokPortal integration in 5 minutes.

Prefer a language SDK, the CLI or an AI agent? Everything is open source on GitHub at github.com/tokportal:

SurfaceInstallRepo
Node / TypeScript SDKnpm install @tokportal/nodetokportal-node
Python SDKpip install tokportaltokportal-python
Go SDKgo get github.com/tokportal/tokportal-gotokportal-go
CLInpm install -g @tokportal/clitokportal-cli
MCP server (Claude, Cursor, ChatGPT, VS Code…)npx -y tokportal-mcp or remote https://app.tokportal.com/api/ext/mcptokportal-mcp · install guide
Examplescopy-paste scripts and workflowsexamples

Prerequisites

Step 1: Generate an API Key

Go to the Developer Portal and click Generate. Copy your key — it starts with sk_ and is shown only once.

Step 2: Verify Your Key

curl https://app.tokportal.com/api/ext/me \
  -H "X-API-Key: sk_your_key_here"

You should see your profile and credit balance.

Step 3: Create a Bundle

curl -X POST https://app.tokportal.com/api/ext/bundles \
  -H "X-API-Key: sk_your_key_here" \
  -H "Idempotency-Key: first-bundle-v1" \
  -H "Content-Type: application/json" \
  -d '{
    "bundle_type": "account_and_videos",
    "platform": "tiktok",
    "country": "USA",
    "title": "My First Bundle",
    "videos_quantity": 5
  }'

This creates a TikTok account in the USA with 5 video slots. At the standard rate it costs 42 credits (32 for setup plus 5 x 2 video credits). The server calculates the workspace-effective price and can apply a contract_bundle_allowance. Read the returned credit_cost or call GET /credit-costs immediately before creation instead of hard-coding an amount.

Step 4: Configure the Account

curl -X PUT https://app.tokportal.com/api/ext/bundles/{bundle_id}/account \
  -H "X-API-Key: sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "mybrand",
    "visible_name": "My Brand Official",
    "biography": "Fashion and lifestyle content"
  }'

Step 5: Configure Videos

Upload a video first, then configure:

# Get a presigned upload URL
# Do not add Idempotency-Key: this response contains a temporary signed URL.
curl -X POST https://app.tokportal.com/api/ext/upload/video \
  -H "X-API-Key: sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"filename": "video1.mp4", "content_type": "video/mp4", "bundle_id": "{bundle_id}"}'

# Upload the file (use the upload_url from the response)
curl -X PUT "{upload_url}" \
  -H "Content-Type: video/mp4" \
  --data-binary @video1.mp4

# Configure the video slot
curl -X PUT https://app.tokportal.com/api/ext/bundles/{bundle_id}/videos/1 \
  -H "X-API-Key: sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "video_type": "video",
    "description": "Check out this trend! #fashion",
    "target_publish_date": "2026-09-01",
    "video_url": "{public_url}"
  }'

Or use batch configuration to set up multiple videos at once, or CSV import to import from a spreadsheet.

Step 6: Publish

curl -X POST https://app.tokportal.com/api/ext/bundles/{bundle_id}/publish \
  -H "X-API-Key: sk_your_key_here"

Your bundle is now live. An account manager will be assigned and start working on it.

Step 7: Track Progress

curl https://app.tokportal.com/api/ext/bundles/{bundle_id} \
  -H "X-API-Key: sk_your_key_here"

Monitor the status field on the bundle, account, and each video.

What's Next?

Use TokPortal from your agent

All 25 agents × 12 jobs

One MCP server (or the REST API), the same 91 tools in every host. Pick yours for the exact connect snippet, the tool sequence per job and a prompt to paste.

Latest from the blog

All posts

Release notes live in the changelog; the blog also has an RSS feed.