API Reference
Events API 2.0

Report events

POST/open_api/v1.3/event/track/
Base URL: https://tiktok-ads.mimicr.dev · provider: https://business-api.tiktok.com

Use this endpoint to report web (event_source web, a Pixel code), offline or CRM events (offline/crm, an event set id), up to 1,000 per request. The token is a Marketing API token with scope 5 (Measurement) or the Pixel's own Events API token.

Unlike the Marketing API, failures return HTTP 4xx: 400 with 40002 naming the first invalid event (Invalid value for data.0.event_time.) or 40001 for a source the token cannot reach, and 401 for an empty token (40104) or over the rate limit (40100).

Emails, phones and external ids must be SHA-256 lowercase hex. Events with the same event_source_id, event and event_id are merged within 5 minutes and dropped within 48 hours. In Mimicr a web event whose ttclid came from a click on a sandbox ad is attributed to that ad and shows in its reports.

Authorization

Bearer token in the Authorization: Bearer <token> header. See Authentication.

Headers

Access-Tokenstringrequired

Authorized access token, sent in this header (not Authorization: Bearer). Marketing API tokens never expire.

Body

application/json
event_sourcestringrequired

This field is used to specify the type of events you are uploading through Events API.

event_source_idstringrequired

An Event Source ID that is used to measure events.

dataobject[]required

Returned data.

Show child attributes
eventstringrequired

For web, app, offline, and CRM events. Conversion event name.

event_timeintegerrequired

For web, app, offline, and CRM events. The time when the event occurred, indicated as a Unix timestamp measured in seconds, and in UTC+0 time zone.

event_idstring

Event ID, used for deduplication with the Pixel: events with the same event_source_id, event and event_id are merged within 5 minutes and dropped within 48 hours. Required when the same event is also sent from the browser.

userobject

For web, app, offline, and CRM events. Information about the customer. To view the list of fields included in the user object, refer to the " user parameters " section below.

Show child attributes
ttclidstring

TikTok Click ID, from the ttclid parameter of the landing page URL. When absent, Mimicr reads it from page.url.

emailstring[]

Email of the customer, SHA-256 hashed (lowercase hex) after trimming and lowercasing; a string or an array.

phonestring[]

Phone number of the customer in E.164 format, SHA-256 hashed (lowercase hex); a string or an array.

external_idstring[]

Your id of the customer, SHA-256 hashed (lowercase hex); a string or an array.

ttpstring

The _ttp cookie of the Pixel.

ipstring

IP address of the browser, not hashed.

user_agentstring

User agent of the browser, not hashed.

localestring

Locale of the browser (pt_BR).

propertiesobject

For web, app, offline, and CRM events. Information about the product, order and additional information to help improve ad performance. To view the list of fields included in the properties object, refer to the " properties parameters " section below.

Show child attributes
content_idsstring[]

Unique ID or array of multiple IDs of the products or content. Example: ["987", "654"]. We recommend using sku_id or item_group_id that matches the sku_id or item_group_id you set up in the catalog, if available. This field is required for Video Shopping Ads (VSA).

contentsobject[]

Relevant products in an event with product information. To view the list of fields included in the contents object, refer to the " contents parameters " section below.

Show child attributes
pricenumber

The price of the item.

content_idstring

Unique ID of the product or content. We recommend using sku_id or item_group_id if you have one. If you have set up sku_id or item_group_id in the catalog, the ID should match the sku_id or item_group_id.

content_namestring

Name of the page or product.

content_typestring

The type of content in the event. Enum values: product, product_group.

currencystring

Recommended for revenue related events.

valuenumber

Recommended for revenue related events.

num_itemsinteger

The quantity of items.

search_stringstring

The user-entered string for search.

descriptionstring

Description of the item or page.

order_idstring

Order ID.

pageobject

Current page number. Default value: 1. Value range: ≥ 1.

Show child attributes
urlstringrequired

The browser URL where the event happened, for example, the value of location.href in the client side Javascript. It is recommended to use the full URL, including all URL parameters.

referrerstring

The referrer URL. For example, document.referrer in the client side Javascript, or the server side Referer http header.

adobject

Only for app and web events. Information about the ad. To view the list of fields included in the ad object, refer to the " ad parameters " section below.

Show child attributes
callbackstring

Ad callback string.

campaign_idstring

Campaign ID.

ad_idstring

Ad ID.

creative_idstring

Creative ID.

limited_data_useboolean

For web and app events. To learn more about the Limited Data Use feature, refer to Events API 2.0 - Limited Data Use.

leadobject

Required for CRM events. Information about the lead. To view the list of fields included in the lead object, refer to the " lead parameters " section below.

Show child attributes
lead_idstring

Required for CRM events. ID of TikTok leads. Every lead will have its lead_id when exported from TikTok.

lead_event_sourcestring

Lead event source. You can set this field to the name of your CRM system, such as HubSpot or Salesforce.

Responses

200The events were accepted (code 0). Deduplicated events are accepted too.
codenumber

Return code. 0 means success; see the return codes appendix for the others.

messagestring

Return message: OK on success, otherwise the error description.

request_idstring

The log ID of the request, which uniquely identifies it (also sent in the X-Tt-Logid header).

dataobject

Returned data.

400Invalid payload (40002, naming the first invalid event), unknown or revoked token (40105) or no permission on the event source (40001). Error bodies have no data.
codeinteger

Return code. 0 means success; see the return codes appendix for the others.

messagestring

Return message: OK on success, otherwise the error description.

request_idstring

The log ID of the request, which uniquely identifies it (also sent in the X-Tt-Logid header).

401Empty access token (40104) or too many requests (40100).
codeinteger

Return code. 0 means success; see the return codes appendix for the others.

messagestring

Return message: OK on success, otherwise the error description.

request_idstring

The log ID of the request, which uniquely identifies it (also sent in the X-Tt-Logid header).