API & Authentication
40002Invalid Access Token
API ErrorHTTPCode 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
- Refresh your token: Use the
/oauth2/access_token/endpoint with your refresh token to generate a new access token. - Check token storage: Make sure your code isn’t accidentally truncating or modifying the token string when storing it.
- Verify app credentials: Confirm that the
app_idandsecretused 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.