Skip to main content

Getting Started (Quickstart)

  1. Set your API key (shell)
export API_KEY="<YOUR_API_KEY>"
  1. Check wallet balance
curl -s -H "X-API-Key: $API_KEY" https://api.tokportal.com/wallet-balance
  1. Create a bundle (Account + Videos)
curl -s -H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
-d '{"title":"API Demo","country":"FR","bundle_type":"account_and_videos","videos_quantity":5,"external_ref":"ext-123"}' \
https://api.tokportal.com/bundles-create

Copy the returned bundle id from the response (or copy it from the UI in Developer → My bundles). See Finding your IDs.

Optionally, capture it with jq if your client returns the id at the top level:

export BUNDLE_ID=$(curl -s -H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
-d '{"title":"API Demo","country":"FR","bundle_type":"account_and_videos","videos_quantity":5,"external_ref":"ext-123"}' \
https://api.tokportal.com/bundles-create | jq -r '.id')
  1. Configure account
curl -i -X POST -H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
-d '{"bundle_id":"'$BUNDLE_ID'","requested_username":"brand_av","visible_name":"Brand AV","biography":"Bio","profile_picture_url":"https://static.example.com/pfp.png"}' \
https://api.tokportal.com/account-configure
  1. Configure a video at position (1..N). target_start will be clamped to current_date + 3 and target_end = start + 3 days. Only video_type="video" is supported currently.
curl -i -X POST -H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
-d '{"bundle_id":"'$BUNDLE_ID'","position":1,"video_type":"video","description":"Desc","video_url":"https://cdn.example.com/v.mp4","target_start":"2025-09-05T00:00:00Z"}' \
https://api.tokportal.com/video-configure-at-position
  1. Publish the bundle (wallet will be charged)
curl -s -X POST -H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
-d '{"bundle_id":"'$BUNDLE_ID'"}' \
https://api.tokportal.com/bundles-publish
  1. Read states
curl -s -H "X-API-Key: $API_KEY" "https://api.tokportal.com/bundles-state?bundle_id=$BUNDLE_ID"

Videos Only flow:

  • Create with POST /bundles-create-videos-only using your existing_account_id (owned and with valid tiktok_url).
  • Country is derived from the saved account. Title defaults to Video Only Bundle when not provided.
  • Configure videos at positions (1..N), then publish the bundle.

See also:

  • 05-domain-model.md
  • 06-media-requirements.md
  • 09-finding-your-ids.md