Log inStart Free Trial
easyCoexistence Official APIs

Why a TikTok API connection stops working, and how to keep it alive

A TikTok API for Business connection stops working when its 24-hour access token is not renewed, its one-year refresh token runs out, the owner removes the app's access, or the token sent is missing or wrong. TikTok reports the token cases as 40102, 40103, 40104 and 40105. Renewing early, checking each account on a schedule and asking the owner to authorize again before the year ends keep it alive.

easyCoexistence keeps each TikTok connection alive on its own: it renews the 24-hour token ahead of time, checks the account about every 6 hours, and when TikTok refuses the token it marks the channel Reconnect needed and emails you, for Claude, ChatGPT or your own platform.

24 hours

Life of a TikTok account access token from the API for Business; /tt_user/oauth2/refresh_token/ renews it.

1 year

Life of the refresh token; once it expires, the account owner has to authorize the app again.

auth_removed

Fail reason when the owner removes the app's access while TikTok is processing a post; TikTok says not to retry.

comment.update

Events TikTok stops sending for an account once the owner's authorization expires or is revoked.

5 reasons

Why TikTok for Developers' authorization.removed fires: the user disconnects, the account is deleted, age changes, a ban, or the developer revokes.

6 hours

How often easyCoexistence checks each connected TikTok account; it renews the 24-hour token on its own and emails you if reconnecting is needed.

Why does a TikTok API connection stop working?

For a handful of reasons, most of them tied to the account's tokens or to the owner's consent. Some end the connection outright, while others leave it half working, with some calls refused and the rest still answering:

Access token expired24 hours passed without a renewal, and calls return 40102
Refresh token expiredIts year ended: renewal returns 40103 until the owner signs in again
Access removedThe owner chose Remove access in TikTok, or the app revoked the token
Wrong tokenMissing from the request (40104), or invalid or incorrect (40105)
Missing permissionA call outside the granted permissions returns 40001
Account level changedData tied to Advanced Access or verification is no longer available
App access revokedTikTok can revoke an app's Accounts API access for misuse, without notice

Which error does each cause return, and what fixes it?

TikTok's code field names most of them, inside an HTTP 200 answer rather than an error status, and the publishing status adds a fail reason of its own. 40100 sits in the table because a throttled call can look like a lost connection. What each one means, and the fix:

What it meansThe fix
40102The access token is past its 24 hoursRenew with the refresh token, store both new tokens, repeat the call
40103The refresh token has expiredA new authorization by the owner; nothing renews it
40104The request carried no access tokenA bug in the request: send the Access-Token header
40105The access token is invalid or incorrectCheck what was sent, renew, then ask the owner to authorize again
40107The refresh token is invalid or incorrectSend the refresh token from the latest response, or a new authorization
40131Authentication failed at a token endpointCheck the app ID and secret, then the code or the refresh token
40001A permission or scope is missingAdd it to the app, then have the owner authorize again
auth_removedAccess was removed while a post was processingNo retry; publish again after a new authorization
40100Throttled, not disconnectedPause the endpoint 5 minutes; the token still works

How long do the tokens last, and when should you renew?

On the API for Business, the access token lasts 24 hours, and expires_in in each token response gives the seconds left; the refresh token lasts a year, with its own countdown in refresh_token_expires_in. Renew well before the day ends, on a schedule rather than after a failed call, and store the refresh token each renewal returns, since TikTok's note on that field is to retain it. Treat refresh_token_expires_in as a deadline: in TikTok's renewal example it counts down instead of starting a new year.

What happens when the owner removes the app's access?

The app loses the Accounts API permissions the owner granted, so calls with that token stop working, and TikTok documents no API for Business event that announces it. The owner can do it at any time in the TikTok app, under Settings and privacy, Security, Manage app permissions, Remove access. The signs show up elsewhere: a post TikTok was processing fails with auth_removed, which TikTok says not to retry, and comment.update events for the account stop arriving.

What does a change of account type do to the connection?

TikTok ties no token error to it in its docs; what changes is what the API returns. Data such as unique_video_views, daily_new_followers and audience_activity needs Advanced Access or a Verified Business Account, as do the Mentions and Business Messaging APIs, and a private account's privacy_level_options leave out PUBLIC_TO_EVERYONE. Since October 16, 2026, is_business_account reads true only for Verified Business Accounts and has_advanced_access reports Advanced Access, so reading both, under user.account.type, shows a change before a call trips on it.

How do you catch a dead connection before a customer does?

With checks that run whether or not anyone is posting:

  • A light call per account on a schedule, such as /business/get/ with fields username, which returns a token error once the token stops working.
  • /tt_user/token_info/get/, which needs no permission and returns the token's scope, to confirm the grants still cover what your features call.
  • refresh_token_expires_in turned into a date when each response arrives, with a reminder to the owner weeks before it.
  • Silence on comment.update for an account that usually gets comments, since TikTok stops those events once the authorization expires or is revoked.
  • 40102, 40103, 40104 and 40105 counted per account, so one failing account stands out among many.

How do you reconnect an account?

By running the authorization again for the same account. Share the TikTok account holder authorization URL, with a state value that ties the return to the account, and disable_auto_auth=1 if the owner should see the permission page again. Exchange the new auth_code at /tt_user/oauth2/token/ within its 10 minutes, then replace both stored tokens. open_id is TikTok's application-specific ID for the account, so match the new tokens to the stored record by it instead of creating a second one.

Do Content Posting API connections expire the same way?

No. TikTok for Developers, which serves the Content Posting and Display APIs, updated its token pages on November 2, 2026: user access tokens expire within 2 hours and refresh tokens last 180 days from first issuance. Its refresh tokens rotate, so each successful refresh returns a new one and immediately invalidates the one sent, and if a server keeps using a replaced token, later refreshes fail and the user has to authorize again. A bad refresh token fails with invalid_grant, a bad access token with access_token_invalid and HTTP 401, and its authorization.removed webhook says why a user left.

What does easyCoexistence do to keep a TikTok connection alive?

It renews and checks on its own, and tells you when only the owner can fix it:

  • Renewal: before a call when less than 15 minutes remain, and during a check when less than 8 hours remain, storing the new refresh token and its expiry each time.
  • One renewal at a time per account, so calls that arrive together share it.
  • The check: a /business/get/ call for the account's username about every 6 hours.
  • A refused token, 40102, 40104 or 40105: the channel reads Reconnect needed, the owner gets one email, and a platform receives channel.disconnected, with TikTok's message as disconnected_reason.
  • Until then, tools answer that the account needs reconnecting, and a scheduled post fails as reconnect instead of reaching TikTok.
  • Reconnecting: Connect TikTok on the channel's page, or a new connect session, signs in again and keeps the same account_id and event destination.

How to set it up

  1. Store both tokens with datesSave access_token, refresh_token, open_id and scope, and turn expires_in and refresh_token_expires_in into dates as each response arrives.
  2. Renew ahead of the dayCall /tt_user/oauth2/refresh_token/ well before the 24 hours end, one renewal per account at a time, and keep the refresh token it returns.
  3. Check each accountMake one light call per account on a schedule and record any 40102, 40103, 40104 or 40105 against that account.
  4. Ask before the year endsSend the owner the authorization URL before refresh_token_expires_in runs out, and replace both tokens when the new code arrives.
  5. Reconnect on a token errorWhen renewal fails or the token is refused, stop calling for that account and send its owner the authorization URL.

Common mistakes

  • Treating a quiet comment webhook as a quiet account. TikTok stops comment.update for an account once its authorization ends, so check the account rather than wait for events.
  • Reconnecting into a new record. Match the new tokens by open_id, TikTok's application-specific ID for the account, and update the stored record in place, keeping its history and settings.
  • Retrying 40103 or 40107 with the same refresh token. Neither clears on retry: the first needs a new authorization, the second the refresh token from the latest response or a new authorization.
  • Reading 40100 as a lost connection. It is a throttled call; pause the endpoint 5 minutes, or until 00:00 UTC after a daily limit, and the same token keeps working.
Doing this with EasyCoexistence

US$ 9 to US$ 0.75 per connection per month, falling as you add connections, with the first 3 days free.

easyCoexistence is a multichannel API and MCP server that connects AI agents such as Claude and ChatGPT to WhatsApp, Instagram, TikTok, Facebook and more. On WhatsApp it uses Coexistence: the business keeps using its number in the WhatsApp Business app while the AI works through Meta's official API.

Frequently asked questions

Can a TikTok API connection last forever without the owner?

No. Renewal carries it through the refresh token's year at most; after that, TikTok's documented path is a new authorization by the account owner.

Why did TikTok connections fail for several accounts at once?

Look at the app before the accounts: 40113 means the app is blocked or its ID and secret do not match, and TikTok can revoke an app's Accounts API access for misuse.

Does a new feature mean reconnecting TikTok accounts?

When it needs a scope the owner never granted, yes. A token keeps the scopes approved at authorization, so the owner authorizes the app again to add one.

What happens to scheduled TikTok posts while an account needs reconnecting?

On easyCoexistence, they fail as reconnect at their time instead of reaching TikTok, the owner is emailed, and Retry sends them once the account is connected again.

Keep reading

Connect your first channel in two minutes.

No platform reviews to wait for. Connect WhatsApp, Instagram, TikTok or another channel, then ask your AI to post, reply or report, and watch it work.

  • 3 days free
  • Cancel any time
  • Official APIs only
  • Monitored 24/7

Verified on