Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TokPortal examples

TokPortal is the managed social infrastructure API: real TikTok and Instagram accounts created, warmed and operated by human account managers in 16+ countries — exposed as a REST API and an MCP server. No OAuth per account, no 25-posts/day cap, no app review.

Docs https://developers.tokportal.com · API base https://app.tokportal.com/api/ext · OpenAPI https://developers.tokportal.com/openapi.json · MCP remote https://app.tokportal.com/api/ext/mcp · Get an API key https://app.tokportal.com/developer/api-keys · llms.txt https://developers.tokportal.com/llms.txt


Runnable quickstarts for the TokPortal API. Every example walks the same happy path:

  1. Create a bundlePOST /bundles (a fresh managed TikTok account in the US + 1 video slot; credits are debited here)
  2. Upload the video — presigned POST /upload/videoPUT upload_url, or one-shot multipart POST /upload/video/direct
  3. ConfigurePUT /bundles/{id}/account (username, visible name, bio) and PUT /bundles/{id}/videos/1 (video_type, video_url = public_url, description, target_publish_date). target_publish_date is the first day of a 2-day publishing window — the manager may post that day or the next — and the end day is derived (that day + 1); target_publish_end_date is rejected on this endpoint. Minimum lead time: 3 days ahead while the account is still being created, 1 day for an existing or delivered account (the quickstarts use today + 7). Publishing may still shift a date; the publish response reports it in adjusted_videos.
  4. PublishGET /bundles/{id}/publish-readiness then POST /bundles/{id}/publish
  5. Get the accountGET /bundles/{id}saved_account_idGET /accounts/{saved_account_id} (username, profile_url); or listen to the account.in_review / account.finalized webhooks
Folder Stack Files
curl/ bash + curl + jq quickstart.sh (presigned upload)
node/ Node 18+ quickstart.mjs (@tokportal/node SDK, direct upload) · quickstart-fetch.mjs (plain fetch, presigned upload)
python/ Python 3.9+ quickstart.py (tokportal SDK, direct upload) · quickstart_requests.py (plain requests, presigned upload)

Run

export TOKPORTAL_API_KEY=sk_your_key_here     # https://app.tokportal.com/developer/api-keys

# curl
./curl/quickstart.sh ./launch.mp4

# node
cd node && npm install && node quickstart.mjs ../launch.mp4

# python
cd python && pip install -r requirements.txt && python quickstart.py ../launch.mp4

Heads-up. These scripts hit production (https://app.tokportal.com/api/ext) — there is no public sandbox yet — and POST /bundles debits credits immediately. They are syntactically validated in CI (node --check, py_compile, bash -n) and their endpoints/fields are taken from the public OpenAPI document, but they are not executed against a sandbox in CI. Read them before running.

Prefer an agent?

The same flow is one sentence away with the MCP server:

npx -y tokportal-mcp   # TOKPORTAL_API_KEY=sk_...

See https://github.com/tokportal/tokportal-mcp for Cursor / Claude / VS Code / Windsurf / Codex / Gemini CLI configs, or use the remote server at https://app.tokportal.com/api/ext/mcp.

More

MIT © TokPortal

About

Quickstart examples for the TokPortal API — curl, Node.js and Python

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages