API & Authentication

40002 Invalid Access Token

API Error HTTP Code 40002

The access token you're sending in the `Access-Token` header is expired, revoked, or was never valid to begin with. TikTok access tokens have a 24-hour lifespan by default.

What causes this error?

The access token you’re sending in the Access-Token header is expired, revoked, or was never valid to begin with. TikTok access tokens have a 24-hour lifespan by default.

How to fix it

  1. Refresh your token: Use the /oauth2/access_token/ endpoint with your refresh token to generate a new access token.
  2. Check token storage: Make sure your code isn’t accidentally truncating or modifying the token string when storing it.
  3. Verify app credentials: Confirm that the app_id and secret used to generate the token match your registered TikTok developer app.

Want your TikTok Ads to outperform?

The Automation Engine supercharges your TikTok Ad performance using conditional automation™ via signals like weather, daypart, Amazon item availability and more.