---
title: "Connect TikTok Ads to Rig | Rig guide"
description: "Create a TikTok Marketing API app, authorise your ad account, exchange the auth code for a long-lived token, then sync campaign spend and conversions to your warehouse."
canonical: "https://rig.so/guides/connect-tiktok-ads"
format: markdown
---

Search guides, references, playbooks…⌘K

Browse guides

# Connect TikTok Ads to Rig

Sync your campaign hierarchy and daily campaign spend, clicks and conversions into the warehouse. TikTok reports the conversions it can attribute, which is not the same number as the orders you actually took, so the reason to land this next to your revenue data is to measure the gap rather than trust either side alone.

Requirements

A TikTok for Business developer account, and admin access to the ad account you want to sync

Time required

20 mins, plus TikTok's app review

## Before you start

- A developer account on **TikTok for Business**, at business-api.tiktok.com.
- Admin access to the TikTok Ads Manager account you want to sync, so you can complete the authorisation.
- Your **advertiser ID**, which sits under `Account Info` in TikTok Ads Manager.

TikTok reviews new Marketing API apps
Your app has to clear TikTok's review before it can call the Marketing API against live data, so allow a few business days and start this before you need the numbers.

One connection covers one advertiser ID. If you run several ad accounts, add a connection for each and give them names you will recognise later.

## Create the Marketing API app

1. Sign in at business-api.tiktok.com and open the developer portal.
2. Create an app, and add the **Marketing API** product to it.
3. Select the permissions the app needs. Rig only reads, so reporting and ad account read access are enough. Nothing Rig does requires write scopes.
4. Set a **redirect URI**. Any URL you control will do, because all you need from it is the authorisation code sitting in the address bar. Rig does not host a callback page for TikTok Ads.
5. Copy the **App ID** and **secret**. Treat the secret like a password.
6. Submit the app for review, and wait for TikTok to approve it.

## Authorise your ad account

1. In the developer portal, open your app and copy its **Advertiser authorization URL**.
2. Open that URL in a browser signed in to the ad account you want to sync.
3. Approve the app, and select the advertiser account it should reach.
4. TikTok sends you back to your redirect URI with `auth_code` in the query string. Copy that value.

## Exchange the code for a token

The authorisation code is single use and short lived. Trade it for a long-lived access token, which is the value Rig actually stores:

Exchange the auth code

```
curl -X POST https://business-api.tiktok.com/open_api/v1.3/oauth2/access_token/ \
  -H "Content-Type: application/json" \
  -d '{
    "app_id": "YOUR_APP_ID",
    "secret": "YOUR_APP_SECRET",
    "auth_code": "THE_CODE_FROM_THE_REDIRECT"
  }'
```

Copy

Read `data.access_token` out of the response. That token is long lived and does not rotate, so you paste it once and Rig keeps using it until you revoke the app in TikTok.

The auth code is not the token
Both values are 40 characters of hex, they look identical, and pasting the wrong one is the single most common way this connection fails on the first try. An unexchanged auth code does not error politely: every call comes back with TikTok error `40105`.

## Connect it in Rig

New to Rig? Watch how to find Connections

1. In Rig, open `Connections` and go to `Sources & actions`.
2. Search for **TikTok Ads** and open the card.
3. **TikTok access token**: paste the access token from the exchange, not the auth code.
4. **Advertiser ID**: the ID from `Account Info` in TikTok Ads Manager. It has to be one the token is authorised for.
5. Click `Test`, then `Sync`.

Rig syncs nightly by default. You can change the schedule and its timezone per source, or leave it manual.

## What Rig pulls in

TikTok Ads lands in its own `tiktok_ads` schema in your warehouse, and stays current with incremental syncs.

- **Campaigns**, **ad groups** and **ads**, the structure of the account
- **Daily campaign performance**: spend, impressions, reach, clicks, CTR, CPC, CPM, conversions, cost per conversion and conversion rate

Performance arrives at **campaign by day**, through yesterday. Ads and ad groups sync as structure rather than as metrics, so you can group, filter and label by them, but spend is attributed no finer than the campaign. If you need creative-level numbers, they are not in this connector today.

The first sync reaches back several years and drains in 30 day windows, which is TikTok's per-request cap rather than a Rig limit, so a cold start takes a while and resumes where it left off. After that, Rig re-pulls the last seven days on every run and merges the result, because TikTok restates recent days as late conversions land and spend reconciles.

## Troubleshooting

- **Error 40105 on every call**: you pasted the auth code instead of the access token. Go back and exchange it, then paste what comes out.
- **Every stream shows as unavailable**: the advertiser ID is not one this token can reach. Rig checks the pairing before it syncs anything, so this is usually a token from a different app or an authorisation that covered another advertiser. Re-run the authorisation against the right account.
- **The sync fails but nothing looks broken**: TikTok returns HTTP 200 on failures and puts the real status in the response body, so Rig surfaces TikTok's own message along with a `request_id`. Quote that ID if you raise it with us or with TikTok.
- **It worked and then stopped**: the token does not expire on a timer, but it dies the moment the app is revoked in TikTok. Generate a new one through the same authorise and exchange steps and paste it in.
- **Yesterday's numbers moved**: that is the restatement window doing its job. TikTok keeps adjusting recent days, so treat the last week as provisional and anything older as settled.

## What people use this for

- Keep more history than the platform hands back
- Track cost per conversion by campaign
- Monitor spend pacing against budget
- Join TikTok spend to revenue for blended CAC

[More ideas for using TikTok Ads](https://rig.so/integrations/tiktok-ads)

Was this guide helpful?

Yes No

---

- [This page as HTML](https://rig.so/guides/connect-tiktok-ads)
- [Site map for language models](https://rig.so/llms.txt)
- [API and agent documentation](https://rig.so/developers)
