Log inStart Free Trial
easyCoexistence Official APIs

TikTok error 40104: access token is empty

TikTok error 40104 means the request arrived without an access token. Accounts API endpoints such as /business/video/list/ and /business/comment/list/ expect the TikTok account's token in a request header named Access-Token. Add that header with a valid token, from /tt_user/oauth2/token/ or renewed with the refresh token, and send the request again.

easyCoexistence adds the TikTok account's current token, in the Access-Token header, to every call it makes for Claude, ChatGPT or your own code.

40104

TikTok's return code when the access token is empty; the fix is to send a valid one.

Access-Token

The required header that carries the TikTok account's token on Accounts API endpoints.

business_id

The parameter naming the TikTok account in each call, set to the open_id returned with its token.

Bearer

The token_type TikTok returns with a TikTok account access token, which is still sent in Access-Token.

What does error 40104 mean?

TikTok received the call with no access token in it. The return code appendix lists 40104 as an empty access token, with the same fix as the other token errors: use a valid access token and try again. The request reached TikTok, but nothing in it showed which authorization it acts under, so TikTok treats the call as unsuccessful.

Where does the token go?

In a header named Access-Token. The Accounts API references, from publishing to comments and insights, list Access-Token as a required header holding the token the TikTok account authorized. The account itself is named separately, in business_id, set to the open_id that came back with the token.

An Accounts API call with its token
curl -G 'https://business-api.tiktok.com/open_api/v1.3/business/video/list/' \
  -H 'Access-Token: <ACCESS_TOKEN>' \
  --data-urlencode 'business_id=<OPEN_ID>' \
  --data-urlencode 'fields=["item_id","caption","video_views"]'

How does the header end up empty?

The token gets lost somewhere between storage and the request. These are the places to look:

  • The header has another name. A token sent as Authorization: Bearer leaves Access-Token empty, even though TikTok gives the token's type as Bearer.
  • The variable holding the token is empty, for example after a renewal that failed without its error being checked.
  • The token travels in the body or the query string instead of the header.
  • A helper written for /tt_user/oauth2/token/ and /tt_user/oauth2/refresh_token/ is reused; those endpoints take no Access-Token header, so the helper sends none.

How do you fix it?

Send the token in Access-Token, alongside business_id. If there is no current token to send, get one: renew with /tt_user/oauth2/refresh_token/ while the refresh token is valid, or have the account owner authorize the app again if it is not. When debugging, log whether the header is present and how long its value is rather than the token itself, since TikTok notes that anyone holding the token can use it.

Common mistakes

  • Treating 40104 as an expired token. The token is absent rather than old, so renewing it changes nothing until the code actually sends it.
  • Renewing the token without passing the new one on. The renewal returns a new access token, and the calls that follow must send that value in Access-Token.
  • Retrying the request unchanged. Without the header, every attempt reaches TikTok the same way and gets the same code.
Doing this with EasyCoexistence

If TikTok answers with 40102, 40104 or 40105 anyway, the connection is marked for reconnecting at once and you get an email. 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 I send a TikTok access token as Authorization: Bearer?

No. Accounts API endpoints read the token from the Access-Token header, so a token sent as Authorization: Bearer leaves it empty and the call returns 40104, though TikTok gives the token's type as Bearer.

Is 40104 the same as an expired token?

No. 40104 means no token arrived at all; an expired one returns 40102, and an invalid or incorrect one returns 40105.

Do the TikTok token endpoints need Access-Token?

No. /tt_user/oauth2/token/ and /tt_user/oauth2/refresh_token/ identify the app with client_id and client_secret in the request body instead.

Does business_id replace the token?

No. business_id says which TikTok account the call is about, and Access-Token carries the authorization to act for it. Every call needs both.

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