Every TikTok API v2 response has an error object with code, message and log_id. A successful call returns code "ok".
1. The request itself
2. The fail_reason when you check the post status
3. The OAuth token endpoints, with their own error field
creator_info/query returns spam_risk_too_many_posts and reached_active_user_cap with HTTP 200 on purpose. Always check error.code, not only the status.
Access tokens last 2 hours. Refresh and retry once. If the refresh fails, the account has to reconnect.
Limits are per endpoint, per token. Direct Post init allows 6 requests per minute, the status fetch 30. Back off and retry later.
spam_risk_too_many_posts, reached_active_user_cap, unaudited_client_can_only_post_to_private_accounts, url_ownership_unverified and privacy_level_option_mismatch. Retrying the same request right away will not fix them.
file_format, duration, frame_rate and picture_size checks need a new file. internal and pull failures can be retried. auth_removed and spam_risk cannot.
Every refresh returns a new refresh token. Reusing the old one fails and forces the user to authorize again. Lock refreshes per account.
Read creator_info/query first: privacy_level_options, max_video_post_duration_sec and the Duet, Stitch and comment settings.
Tables for every code with HTTP status and fix, a TypeScript retry classifier and what to send TikTok support.
postgate.studio