TikTok API Error Codes: Meanings, Causes and Fixes (2026)
Every TikTok API error code in one place: v2 request errors, Content Posting codes, fail_reason values and OAuth errors, with the fix and retry rule for each.
TikTok API error codes are readable strings in the error.code field, such as access_token_invalid, rate_limit_exceeded or spam_risk_too_many_posts, returned with a message and a log_id. Content Posting failures can also arrive later as a fail_reason when you check the post status, and OAuth calls use a separate error field. Each code points to one fix.
TikTok API error codes are plain strings, not numbers. Every TikTok API v2 response carries an error object with a code, a message and a log_id, and the code tells you what went wrong: access_token_invalid means refresh the token, rate_limit_exceeded means slow down, spam_risk_too_many_posts means this creator has hit the daily posting cap. A successful call returns the same object with code: "ok".
The catch is that TikTok spreads its errors across three places: the request itself, the post status you poll afterwards and the OAuth endpoints. This page puts every documented code in one reference, with the HTTP status, what it means and whether a retry can work. It is the TikTok chapter of our guide to social media API error handling, which covers the cross-platform side: sorting errors by the next action instead of by provider.
PostGate handles OAuth, publishing and delivery evidence for every network through one API. Start free or read the docs.
What does a TikTok API error look like?
TikTok's error handling reference defines one struct for API v2: code (the error category as a string), message (the detailed description) and log_id (a unique ID per request). TikTok support asks for these details when you open a ticket, so log all three on every failed call.
A publishing integration meets that struct in three shapes:
- Request errors. The call fails right away, with
error.codeset and an HTTP status of 400, 401, 403, 429 or 5xx. - Asynchronous failures. The init call succeeds and returns a
publish_id, but processing fails later. The status endpoint (or the Content Posting webhook) reportsstatus: "FAILED"with afail_reason, whileerror.codeis stillok. - OAuth errors. The token endpoints use a different shape:
error,error_descriptionandlog_id, following the OAuth 2.0 error names.
One trap: /v2/post/publish/creator_info/query/ returns spam_risk_too_many_posts, spam_risk_user_banned_from_posting and reached_active_user_cap with HTTP 200, which TikTok marks as intentional. If your client only checks the HTTP status, it will read those as success. Always check error.code !== "ok".
# 1. Request-level error (any TikTok API v2 endpoint)
{
"data": {},
"error": {
"code": "access_token_invalid",
"message": "Access token is invalid, please refresh token and retry",
"log_id": "20220829194722CBE87ED59D524E727021"
}
}
# 2. Asynchronous failure (POST /v2/post/publish/status/fetch/ or webhook)
{
"data": { "status": "FAILED", "fail_reason": "picture_size_check_failed" },
"error": { "code": "ok", "message": "", "log_id": "..." }
}
# 3. OAuth error (token endpoints)
{
"error": "invalid_grant",
"error_description": "...",
"log_id": "..."
}Which error codes can any TikTok API v2 call return?
These come from the general v2 list and apply across endpoints (Display API, Content Posting API and the rest). The posting endpoints spell the parameter error invalid_param, while the general list says invalid_params: match both.
| error.code | HTTP | What it means | What to do |
|---|---|---|---|
access_token_invalid | 401 | Token missing, invalid or expired | Refresh the token and retry once; if the refresh fails, reconnect the account |
scope_not_authorized | 401 | The user did not grant the scope this call needs (for example video.publish) | Send the user through authorization again with the scope |
scope_permission_missed | 400 | Some requested fields need extra scopes | Drop those fields or request the scopes the message names |
invalid_params / invalid_param | 400 | A field in the request is invalid | Read message; it names the field |
invalid_file_upload | 400 | The uploaded file does not meet the API specs | Fix the file, then upload again |
rate_limit_exceeded | 429 | Too many requests in the one-minute sliding window | Back off and retry later |
internal_error | 500 | Generic TikTok-side failure | Retry with backoff; if it persists, send the log_id to TikTok support |
Rate limits are set per endpoint. The rate limit page lists 600 requests per minute for /v2/user/info/, /v2/video/query/ and /v2/video/list/. The posting endpoints are much tighter and counted per user access token: 6 per minute for Direct Post init, 20 per minute for creator_info/query and 30 per minute for the status fetch.
What do the Content Posting API error codes mean?
These are returned by the init calls, /v2/post/publish/video/init/ for Direct Post and /v2/post/publish/inbox/video/init/ for upload to the creator's inbox, according to the Direct Post reference. Most are 403s, and none of them is fixed by sending the same request again right away.
| error.code | What it means | What to do |
|---|---|---|
spam_risk_too_many_posts | This creator reached the daily post cap for API posts | Queue the post for a later day or let the creator post from the TikTok app |
spam_risk_too_many_pending_share | Inbox uploads only: at most 5 pending shares in any 24-hour window | Ask the creator to finish or discard the drafts in their inbox |
spam_risk_user_banned_from_posting | TikTok banned the user from making new posts | Stop and tell the user; nothing on your side changes it |
reached_active_user_cap | Your app hit its daily quota of active publishing users | Wait for the window to reset, pass audit or ask TikTok for a higher cap |
unaudited_client_can_only_post_to_private_accounts | Your app has not passed audit, and the target account is public | Post to a private account with SELF_ONLY until the audit passes |
url_ownership_unverified | You used PULL_FROM_URL from a domain or URL prefix you have not verified | Verify the domain in the developer portal, or switch to FILE_UPLOAD |
privacy_level_option_mismatch | privacy_level is missing or not one of the creator's privacy_level_options | Read creator_info/query first and only offer the options it returns |
Four of these have their own deep dives. reached_active_user_cap belongs to your app, not the user, which is why disconnecting and reconnecting never clears reached_active_user_cap. The "daily active user quota reached" message some tools show is the same cap under another name, explained in TikTok daily active user quota reached. The private-account rule is covered in unaudited_client_can_only_post_to_private_accounts, and what changes after the TikTok audit shows which of these codes disappear once your app is approved.
TikTok's own note on privacy_level_option_mismatch is worth reading twice: it says frequent occurrences in a production app suggest a violation of its product-use guidance. An app that hard-codes PUBLIC_TO_EVERYONE will hit it, and an auditor will notice.
What does each fail_reason mean after a post is accepted?
When the init call succeeds you get a publish_id, and the post moves through statuses such as PROCESSING_UPLOAD, PROCESSING_DOWNLOAD, SEND_TO_USER_INBOX and PUBLISH_COMPLETE, or ends in FAILED. The Get Post Status reference lists the values fail_reason can take, from the status endpoint or from webhooks:
| fail_reason | Cause | Retry? |
|---|---|---|
file_format_check_failed | Unsupported media format | Only with a re-encoded file |
duration_check_failed | Video outside the duration limits | Only with a trimmed file |
frame_rate_check_failed | Unsupported frame rate | Only with a re-encoded file |
picture_size_check_failed | Unsupported video or photo dimensions | Only with a resized file |
internal | Part of TikTok's servers is unavailable | Yes, TikTok calls it retryable |
video_pull_failed / photo_pull_failed | TikTok could not download your URL, or the download did not finish within one hour | Yes, once you confirm the URL is public and not bandwidth-limited |
publish_cancelled | You cancelled an ongoing download | No |
auth_removed | The creator revoked your app's access during processing | No; the creator has to reconnect |
spam_risk_too_many_posts | Too many API posts by this creator in the last 24 hours | No; post from the TikTok app or wait |
spam_risk_user_banned_from_posting | TikTok's trust and safety team banned the creator from posting | No |
spam_risk_text | The caption was judged risky or spammy | No, not with the same text |
spam_risk | The publishing request as a whole was judged risky | No |
The four *_check_failed reasons point to TikTok's video and photo restrictions. For the encoding side, our walkthrough of file_format_check_failed on TikTok uploads has the ffprobe checks and a conservative re-encode. Also note that a public Direct Post goes through moderation before you get a post ID: TikTok says this usually takes under a minute but can take a few hours, so a post sitting in processing is not an error by itself.
Which TikTok OAuth errors break the connection?
The Login Kit token endpoints follow the standard OAuth 2.0 names, listed in TikTok's OAuth error handling page: access_denied, invalid_client, invalid_grant, invalid_request, invalid_scope, unauthorized_client, unsupported_grant_type, unsupported_response_type, server_error and temporarily_unavailable.
In a posting app the one you will see most is invalid_grant on a refresh. TikTok access tokens last 2 hours and refresh tokens 180 days, and every refresh returns a new refresh token. If you keep using a refresh token that has already been replaced, later refreshes fail and the user has to authorize your app again. The usual causes are two workers refreshing the same account at once and a write that saves the new access token but not the new refresh token. Lock the refresh per account and store both tokens in one write.
Which TikTok API errors should you retry?
Sort every code by the next action, not by the endpoint that returned it. Five buckets cover the full list above:
- Retry with backoff:
rate_limit_exceeded,internal_error, 5xx responses,internal, and the pull failures once the URL checks out. - Refresh, then retry once:
access_token_invalid. - Ask the creator:
scope_not_authorized,scope_permission_missed,auth_removed. - Fix the request or the app: parameter, file, privacy, URL ownership and audit errors.
- Stop: the
spam_risk_*family andreached_active_user_cap. Retrying these burns attempts and, for the spam ones, can make a creator look worse to TikTok.
The snippet below turns that into a lookup you can drop into a worker. Unknown codes fall back to the HTTP status, so a new code TikTok adds later fails safe instead of looping.
// Decide the next action from a TikTok error code or fail_reason.
type Next = 'retry_backoff' | 'refresh_then_retry' | 'ask_user' | 'fix_request' | 'stop';
const NEXT: Record<string, Next> = {
// retry later with exponential backoff
rate_limit_exceeded: 'retry_backoff',
internal_error: 'retry_backoff',
internal: 'retry_backoff',
video_pull_failed: 'retry_backoff', // only if the URL is public and fast
photo_pull_failed: 'retry_backoff',
// refresh the access token once, then retry
access_token_invalid: 'refresh_then_retry',
// the creator has to do something
scope_not_authorized: 'ask_user',
scope_permission_missed: 'ask_user',
auth_removed: 'ask_user',
// your request or your app setup is wrong
invalid_param: 'fix_request',
invalid_params: 'fix_request',
invalid_file_upload: 'fix_request',
privacy_level_option_mismatch: 'fix_request',
url_ownership_unverified: 'fix_request',
unaudited_client_can_only_post_to_private_accounts: 'fix_request',
file_format_check_failed: 'fix_request',
duration_check_failed: 'fix_request',
frame_rate_check_failed: 'fix_request',
picture_size_check_failed: 'fix_request',
// caps and trust & safety: do not retry the same request
spam_risk_too_many_posts: 'stop',
spam_risk_too_many_pending_share: 'stop',
spam_risk_user_banned_from_posting: 'stop',
reached_active_user_cap: 'stop',
spam_risk_text: 'stop',
spam_risk: 'stop',
publish_cancelled: 'stop',
};
export function nextAction(code: string, httpStatus: number): Next {
if (code === 'ok') throw new Error('not an error');
return NEXT[code] ?? (httpStatus >= 500 ? 'retry_backoff' : 'stop');
}How do you prevent TikTok posting errors before they happen?
Most Direct Post errors can be caught before the init call, because creator_info/query tells you what the creator is allowed to do right now. It returns privacy_level_options, comment_disabled, duet_disabled, stitch_disabled and max_video_post_duration_sec, and it surfaces the daily cap and ban codes before you upload anything. A pre-flight check takes one request:
- Call
creator_info/queryand stop iferror.codeis notok, even on HTTP 200. - Reject a
privacy_levelthat is not inprivacy_level_options. - Reject a video longer than
max_video_post_duration_sec. - Do not send Duet, Stitch or comment settings the creator has turned off.
- If the app is unaudited, only allow
SELF_ONLYon a private account. - Check the media against the spec, and serve it from a verified domain if you use
PULL_FROM_URL.
That checklist is how PostGate's TikTok integration handles Direct Post: it queries the creator first and rejects a privacy level the account does not offer, a video longer than the creator's limit, or Duet, Stitch and comment settings the creator disabled, with a readable message, before TikTok sees the request. Rate limits come back as a retryable 429, so one error format covers TikTok alongside the other networks in your app.
What should you send TikTok support?
Send the log_id, the full error.code and message, the endpoint, the time of the call and, for a failed post, the publish_id and its fail_reason. TikTok says it needs the error details to investigate, and the log_id is the only way it can find your request. If you are still choosing which TikTok products and scopes to build on, start with our TikTok API guide.
Frequently asked questions
What is the TikTok API log_id?
It is a unique ID TikTok attaches to every API response, including errors. Store it with each failed call and include it when you contact TikTok support, because it lets them find the exact request.
Why does TikTok return an error with HTTP 200?
Some endpoints report errors in the body on purpose. creator_info/query returns spam_risk_too_many_posts, spam_risk_user_banned_from_posting and reached_active_user_cap with HTTP 200, so always check that error.code equals ok.
What does spam_risk_too_many_posts mean on TikTok?
The creator has made too many posts through the API in the last 24 hours. Do not retry the same request: schedule the post for later or have the creator post from the TikTok app.
Is access_token_invalid the same as a revoked account?
Not always. TikTok access tokens expire after 2 hours, so refresh first. If the refresh fails with invalid_grant, the refresh token is expired, replaced or revoked, and the user has to reconnect.
How do I fix url_ownership_unverified?
Verify the domain or URL prefix that hosts your media in the TikTok developer portal before using PULL_FROM_URL, or upload the file directly with FILE_UPLOAD instead.
