TikTok setup
Registering a TikTok developer app for photo publishing, and what its audit gates.
TikTok publishing uses the Content Posting API. SocialRelay supports photo posts — one to ten images with a caption. Video publishing is not implemented.
TikTok gates public posts behind an audit
Prerequisites
- A developer account at
developers.tiktok.com - A TikTok account to publish from
- A verified domain — TikTok requires you to prove you own the redirect host
1. Create the app
- In the TikTok developer portal, create an app.
- Add the Login Kit product, which provides OAuth.
- Add the Content Posting API product.
- Under Content Posting API, enable Direct Post. Without it the API can only create drafts, and SocialRelay publishes directly.
2. Verify the domain
TikTok will not accept a redirect URI on a host you have not verified. In the portal, add social.aitoolbucket.com as a verified property and complete the check it offers — usually a DNS TXT record or a file served from the domain root.
3. Redirect URI
https://social.aitoolbucket.com/api/oauth/tiktok/callbackTikTok requires HTTPS and does not accept localhost. For local development, tunnel your dev server and verify that hostname instead.
4. Scopes
SocialRelay requests exactly these:
user.info.basic read the connected account's open id and username
video.publish publish content directly
video.upload upload the media for a postThe video.* naming is TikTok’s own and covers photo posts too — there is no separate photo scope.
5. Copy the credentials
TikTok calls these a Client Key and Client Secret, not a client ID — the environment variable names follow TikTok’s terminology.
cd /var/www/creator
read -rsp "TIKTOK_CLIENT_KEY: " V && printf '\nTIKTOK_CLIENT_KEY="%s"\n' "$V" >> .env
read -rsp "TIKTOK_CLIENT_SECRET: " V && printf '\nTIKTOK_CLIENT_SECRET="%s"\n' "$V" >> .env
sudo systemctl restart creator-app creator-workerWhat TikTok will accept
- 1 to 10 images per photo post
- Caption and hashtags, with the first 90 characters used as the post title
- Images are pulled by TikTok from the URLs you supply, so those URLs must be publicly reachable over HTTPS
When a content package arrives with more than ten images, the review screen refuses to publish and asks you to remove the extras rather than silently truncating.
Publishing is asynchronous
TikTok’s API returns a publish_id immediately and processes the post afterwards, so a successful call does not yet mean a live post. SocialRelay records the publish id and can poll for the final state. If TikTok rejects the content during processing, the status comes back as failed even though the original request succeeded.
Troubleshooting
scope_not_authorized
The app does not have the requested scope approved, or Direct Post was never enabled. Re-check the Content Posting API configuration, then reconnect the account.
TIKTOK_TOKEN_EXPIRED
TikTok access tokens are short-lived. SocialRelay refreshes automatically when a token is within five minutes of expiring, but only if a refresh token was stored — which requires the original connection to have completed cleanly. Reconnect the account.
Unaudited client cannot post publicly
Expected before the audit. Posts land as private on the account. Submit the app for TikTok’s content-posting review to lift it.
TIKTOK_MEDIA_TOO_LARGE or a format error
TikTok could not fetch or decode an image. Confirm the URL is publicly reachable, served over HTTPS, and is a JPEG, PNG, or WebP.
See also the TikTok connection guide for the end-user flow.

