TikTok Events API Error Codes: What They Mean and How to Fix Them
How to Read a TikTok Events API Error
TikTok Events API 2.0 answers every request with the same response skeleton: a code (the API return code), a message with the failure details, and a request_id, which is the log ID of your request. On success the API returns HTTP 200 with a return code of 0 and an empty data object. On failure you get a 4XX or 5XX status, the corresponding return code, and no data field. If you run a tracker, you will see this JSON in its outbound postback logs - Keitaro, Binom, and Voluum record the raw response of every S2S call, which is the fastest place to read the actual code.
When you send several events in one call, the message points at the zero-based index of the first invalid event. A message like Invalid value for data.2.event_id: not a valid string means the third event in your batch has a broken event_id - the first two may have been fine, but the batch still failed. This one detail changes how you debug TikTok Events API error codes: fix the named event first, and only then re-send the batch.
{
"code": 40002,
"message": "Invalid value for data.2.event_id: not a valid string.",
"request_id": "202308291437415F6E70BA7E095091A6F4"
}The Error Codes You Will Actually See
TikTok documents a short list of errors that are common specifically for Events API 2.0, and a much longer appendix of general API return codes. The ones that hit conversion delivery in practice:
| Code | HTTP | What it means |
|---|---|---|
| 40001 | 400 | No permission to operate the advertiser account |
| 40002 | 400 | Invalid payload: broken JSON, missing or wrongly typed field, an unhashed value where SHA-256 is required, or more than 1,000 events in one request |
| 40100 | 401 | Too many requests: endpoint rate limit (1,000 queries per second) reached |
| 40104 | 401 | Access token is empty |
| 40007 | 400 | The operation object does not exist: the campaign, ad, or object ID in the request points to nothing |
| 40050 | 400 | Duplicate request: the identical request was sent more than once |
Around these four sit two bigger families from the general return-code appendix. The token family: 40102 (token expired), 40105 (invalid token), 40101 (bad authentication parameters - secret and app ID mismatch), 40110 (authorization code cancelled or already used). The throttling family: 40016 (app-level rate limit), 40133 (advertiser-level rate limit), and 40132 (per-field throttling - your pixel_code itself got QPS-limited). And 40000 is the generic "parameters are invalid" catch-all with the real reason in the message.
Fixing 40001: Permission Errors
Code 40001 means the request reached TikTok with valid credentials, but the identity behind the access token has no rights over the advertiser account that owns the pixel you are sending events for. The Events API endpoint is the same for everyone - the access token and the pixel_code in your request body decide which account you are acting against - so the mismatch is between the token and the pixel's owner. This happens after the ad account is moved to a different business center, when a tracker or integration was authorized under a personal account, or when a teammate's token simply was never granted that account.
The fix is not in the payload - it is in authorization. Re-run the OAuth flow for the correct account and generate a fresh long-term access token, or grant the existing integration the missing permission scope. If you store one token for several ad accounts, check that the pixel you send to belongs to an account that token can operate.
Fixing Token Errors: 40104, 40105, and 40102
The token family fails differently from permission errors: here TikTok never got a usable credential at all. 40104 means the access token was empty - the request went out without the token, usually because the integration field was never filled or a variable resolved to nothing. 40105 means a token was sent but is invalid - a typo, a token from a different app, or a value that got truncated during copy-paste. 40102 means the token expired: short-lived tokens die quietly, and the first sign is a batch of 401s in your postback log after a previously working period.
The fix for all three is the same flow with different starting points: generate a valid long-term access token for the correct account and update the credential in every place that stores it - the tracker integration, the tag manager variable, the custom script. The TikTok pixel ID and access token setup guide walks through provisioning and storage.
Fixing 40002: Invalid Payload
Code 40002 is the most common TikTok Events API error code in tracker-driven setups, and the message field names the exact field. The failure modes, in order of how often they bite:
- Unhashed identifiers. Fields like
emailmust travel as SHA-256 hashes. Sending[email protected]instead of its 64-character lowercase hex digest returnsInvalid value for email: not a valid SHA256-hashed string. Normalization before hashing matters too - trim, lowercase, strip separators from phone numbers. The same rules power TikTok enhanced matching, so a fix here improves match rate as well. - Wrong timestamp format. The event time is a Unix timestamp in seconds. Tracker templates and scripts frequently emit millisecond timestamps (13 digits instead of 10) or an ISO date string, and either variant fails validation.
- Wrong JSON structure. A payload that is not valid JSON, or a field passed as a string where a number is required.
- Batch size. More than 1,000 events in a single request fails the call - split your queue into smaller batches.
- Missing required fields. The message names the missing parameter; trust it before rewriting the whole payload.
Because one invalid event fails the entire batch, a single malformed record from one campaign can silently drop conversions from every other campaign in the same request. When you see 40002, split the batch, locate the indexed event, and fix it before re-sending everything.
Fixing 40100, 40133, and 40132: Rate Limits
The throttling family shares one root cause - too many requests per second - but the codes tell you where the ceiling is. 40100 is the endpoint-level limit of 1,000 queries per second. 40133 is advertiser-level: your own account QPS on that path. 40016 is the app-level limit for your developer application. And 40132 deserves special attention: it throttles by the pixel_code field value, which happens when one pixel is hammered by too many calls - or when your access token leaked and someone else is using it.
The fixes are mechanical: add exponential backoff with retries instead of immediate re-sends, consolidate many small requests into fewer large batches (still under 1,000 events), and stagger queue workers. If 40132 appears without a matching increase in your own traffic, rotate the token and treat the old one as compromised.
Diagnosing Delivery Beyond Error Codes
A clean API response only proves TikTok received your events. The next failure layer is measurement, and it has its own toolkit: Test Events in Events Manager shows events arriving from a specific source in near real time, and Web Diagnostics scores your pixel configuration page by page. If your API calls return 0 but Ads Manager shows fewer conversions than your tracker does, you are in TikTok conversion discrepancy territory, not in error-code territory.
Check three things in order. First, deduplication: if the pixel and the Events API both fire for one order, the events must share an event_id, or TikTok counts two conversions. Event ID deduplication collapses repeated reports of one conversion into a single counted event. Second, event delay: TikTok expects events close to real time, and events that arrive long after they happened come back rejected or fail to attribute. The same failure class has a dedicated error code on Meta - 2804003, its 7-day ingestion limit, see why Meta rejects events older than 7 days. Third, delivery automation: if you run many landings, Pixel Activator for TikTok Events API provisions the connection without code - the free tool lives at Pixel Activator - and the TikTok Events API and pixel guide maps the whole cluster.
