Guides
Getting started

Environment

Hosts, path format, versions, ids, dates, money, the data the sandbox comes with and the sandbox clock.

Hosts

ForURL
Marketing API, Events API, Subscription API and leadshttps://tiktok-ads.mimicr.dev/open_api/v1.3/
Advertiser authorization pagehttps://tiktok-ads.mimicr.dev/portal/auth (or /marketing_api/auth)
Mimicr pages (Instant Form, click, report files)https://tiktok-ads.mimicr.dev/mimicr/…
Mimicr control APIhttps://api.mimicr.dev/v1/tiktok-ads
Consolehttps://app.mimicr.dev, in the organization, under TikTok Ads

GET https://api.mimicr.dev/v1/tiktok-ads returns your sandbox's host, api_base_url and auth_url, along with the App ID and Secret.

Paths

  • Every API path ends with /, as on TikTok: /open_api/v1.3/campaign/get/. Without the slash, the response is HTTP 404 with the plain text 404 page not found.
  • The method follows the docs: GET to read, POST to write. A wrong method is also a 404.
  • Only v1.3 exists. /open_api/v1.2/ and /open_api/v1.1/ answer 40051 Invalid API version.
  • Routes TikTok documents outside Mimicr's core answer HTTP 501 with 40014 (see Envelope and errors).

Parameters

  • On GET, lists and objects go as JSON in the query: advertiser_ids=["7000000013373458730"], filtering={"campaign_ids":["1700013373458745"]}. URL-encode them (curl --get --data-urlencode). Invalid JSON answers 40002 <param>: Invalid JSON.
  • On POST, the body is JSON (Content-Type: application/json). File uploads use multipart.
  • advertiser_id is required on every ad account route, in the query or the body.

Ids

  • In the API every id is a string of digits: advertisers, Business Centers, users, Pixels and leads have 19 digits; campaigns, ad groups and ads 16. Mimicr also accepts numbers in requests.
  • video_id looks like v10033g50000… and image_id like ad-site-i18n-sg/<date><hex>.
  • In webhooks ids are 64-bit JSON integers, above 2^53. Read them without going through a float (see Verify the signature).

Dates

  • create_time and modify_time of campaigns, ad groups and ads: "YYYY-MM-DD HH:MM:SS" in UTC.
  • schedule_start_time and schedule_end_time: "YYYY-MM-DD HH:MM:SS" in UTC+0. Convert local time before sending.
  • Advertiser create_time: Unix seconds.
  • Reports: days of the advertiser time zone (America/Sao_Paulo for the sandbox accounts).
  • dayparting: in Mimicr, the half hours follow the advertiser time zone.

Money

Budgets and bids are numbers in the account currency, not cents: "budget": 25 is R$ 25.00. In BRL the precision is 0.01; more decimals answer 40002. Report metric values are strings ("14.68").

What the sandbox comes with

ObjectCount
Developer app1 (19-digit App ID, 40-hex Secret, every scope, Basic rate-limit level)
TikTok for Business users2: Joana Ribeiro (admin) and Bruno Sem Contas (no_advertisers)
Business Center1, with Joana as ADMIN
Ad accounts3 in BRL: Principal and Filial (STATUS_ENABLE) and Bloqueada (STATUS_LIMIT)
In each accountAn Instant Form ("Pedido de gás": name, phone, e-mail), a Pixel with an events token and a test code, an event set for offline and CRM events, and a custom identity

More accounts, forms and Pixels: the advertiser.create, form.create and pixel.create actions. Creating accounts through the API (/bc/advertiser/create/) is a 501.

POST https://api.mimicr.dev/v1/tiktok-ads/reset goes back to that state: it deletes campaigns, stats, leads, tokens, subscriptions and deliveries, keeps the app and the settings, and sets the clock back to real time.

Sandbox clock

The sandbox has its own clock, which you move forward with POST /v1/tiktok-ads/clock/advance or npx mimicr clock tiktok-ads +2h. Advancing expires auth_codes (1 h), completes reviews, generates delivery hours, crosses ad group start and end times, applies scheduled budgets, finishes asynchronous reports and lead tasks, and runs webhook retries. Tokens do not expire. Every date in the API follows this clock.