Guides
API principles

Rate limits

The per-app, per-route and per-advertiser limits, codes 40100 and 40133, and how to test them in the sandbox.

TikTok limits calls per app, per route and per advertiser. In Mimicr the limits only apply with the enforceRateLimits toggle on (off by default), or when you exhaust the limit on purpose.

App limits

Counted per route and per app, by the app's level:

LevelPer secondPer minutePer day
Basic (default)10600864,000
Advanced201,2001,728,000
Premium301,8002,592,000
Ultimate503,0004,320,000
Route with its own limitBasicAdvancedPremiumUltimate
/ad/create/ (per second / minute)5 / 15010 / 20010 / 30015 / 300
/event/track/1,000 per second at every level

Over the limit: 40100 Requests made too frequently. (HTTP 200; on the Events API, HTTP 401). Going over the per-minute limit blocks the route for 5 minutes. The daily counter resets at midnight UTC.

Change the sandbox app's level with PUT /v1/tiktok-ads/app {"rate_level": "ADVANCED"}.

Advertiser limit

Besides the app, each advertiser has a per-route limit. In Mimicr it is 20 calls per second:

json
{ "code": 40133, "message": "Advertiser (7000000013373458730)'s QPS (21) reaches QPS limit 20 for current path, request is temporarily restricted.", "request_id": "…", "data": {} }

How to react

  • Treat 40100 and 40133 as transient: wait and retry, with growing backoff.
  • 40100 is not a missing permission. Disconnecting the account on 40100 breaks integrations that are only calling too fast.
  • Spread ad creation: /ad/create/ has the lowest limit. Up to 20 creatives fit in one call.

Test it in the sandbox

bash
# turns real counting on
curl --request PUT \
  --url https://api.mimicr.dev/v1/tiktok-ads/homolog \
  --header 'Authorization: Bearer mk_...' \
  --header 'Content-Type: application/json' \
  --data '{ "enforceRateLimits": true }'

# or force it: every call answers 40100 until the reset
npx mimicr action tiktok-ads ratelimit.exhaust scope=app
npx mimicr action tiktok-ads ratelimit.exhaust scope=advertiser   # 40133 on an advertiser's routes
npx mimicr action tiktok-ads ratelimit.reset

Chaos also injects 40100 into a share of each area's calls (see Sandbox testing).

In Mimicr the second, minute and day windows are counted in memory on each server instance; the forced exhaustion from ratelimit.exhaust is stored in the sandbox and applies to all of them.