Getting Started (Quickstart)
- Set your API key (shell)
export API_KEY="<YOUR_API_KEY>"
- Check wallet balance
curl -s -H "X-API-Key: $API_KEY" https://api.tokportal.com/wallet-balance
- 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')
- 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
- Configure a video at position (1..N).
target_startwill be clamped tocurrent_date + 3andtarget_end = start + 3 days. Onlyvideo_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
- 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
- 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-onlyusing yourexisting_account_id(owned and with validtiktok_url). - Country is derived from the saved account. Title defaults to
Video Only Bundlewhen not provided. - Configure videos at positions (1..N), then publish the bundle.
See also:
05-domain-model.md06-media-requirements.md09-finding-your-ids.md