Skip to main content

TikTok Ads — Authentication

B
Written by Ben Keeling

A plain-language overview of the access we'll request, what we read, who on your team should connect, and what to expect during setup.



​

What to expect

Connecting takes a couple of minutes. When you connect TikTok Ads in Medialake, you're redirected to TikTok for Business, where you sign in and approve Medialake's access to your ad accounts. You approve it yourself and can revoke access at any time. We never see or store your password: the login happens entirely on TikTok's site, and once you approve you're returned to Medialake.

Medialake is a reporting and media platform. We never create, edit, pause, or spend anything in your ad accounts. Every request the connector makes to the official TikTok API for Business is a read.

 You                    Medialake                  TikTok
  │  connect source         │                         │
  │────────────────────────▶│                         │
  │  redirect to TikTok     │                         │
  │◀────────────────────────│                         │
  │  log in & authorize     │                         │
  │──────────────────────────────────────────────────▶│
  │  redirect with code     │                         │
  │◀──────────────────────────────────────────────────│
  │                         │  exchange code          │
  │                         │────────────────────────▶│
  │                         │  access token           │
  │                         │◀────────────────────────│
  │  source authorized      │                         │
  │◀────────────────────────│                         │


​

Two ways to connect

TikTok Ads can be connected through Medialake's OAuth app or through your own app:

  1. Medialake's OAuth app (default). Accounts connect using Medialake's central TikTok for Business app. No setup is required: just sign in and approve.

  2. Your own app (optional). If your organization would rather own the app that appears when you authorize, you can create a developer app in the TikTok API for Business portal and add its credentials to Medialake. Your organization owns the app.

What Medialake reads, and everything else on this page, is identical for both options.


​

Setting up your own app (optional)

Most accounts connect with Medialake's OAuth app and can skip this section.

  1. Sign in to the TikTok API for Business portal and register as a developer if you haven't already.

  2. Create a new app. Give it a name your team will recognize.

  3. Set the app's advertiser redirect URL to your Medialake address followed by /tiktokads-redirect. It must match exactly, or TikTok will refuse the sign-in. If you're not sure which address to use, contact [email protected] before you submit the app. For example:

https://yourcompany.medialakeapp.com/tiktokads-redirect
  1. Under Scope of permission, select only the read permissions that cover the requests the connector makes. It does not need any permission to create or change anything:

- Ad Account Management → Ad Account Information → Read Ad Account Information

- Ads Management → Campaign → Read Campaigns

- Ads Management → Ad Group → Read Ad Groups

- Ads Management → Ad → Read Ads

- Creative Management → Image Management → Read Image Library

- Creative Management → Video Management → Read Video Library

- Reporting → Consolidated Report

Reading the connecting user's profile does not need a permission.

  1. Submit the app. TikTok reviews new developer apps before they can be used, which can take a few business days.

  2. Once the app is approved, copy its App ID and Secret.

>Keep the Secret private. Store it in an approved password manager or secret-management system. Do not email it, paste it into a support ticket, or commit it to source control.


​

Add your app's credentials to Medialake

You need Medialake administrator privileges for this step.

  1. Open Administration → Integrations from the sidebar.

  2. Open the TikTok Ads integration.

  3. In the Access Keys section, click Create New Setting.

  4. In the New access key panel, give the key a Name, for example Marketing TikTok Ads app. Team members see this name when they choose an app to connect with.

  5. Under Credentials, fill in both fields:

- Enter your TikTok Ads Client Key (App ID) here without any spaces: your app's App ID. Medialake accepts digits only, 15 to 25 of them.

- Enter your TikTok Ads Client Secret here without any spaces: your app's Secret. Medialake accepts letters and numbers only, at least 30 characters.

  1. Under Who can use it?, choose which teams can connect accounts with this key, or allow all teams.

  2. Click Save access key.

The values are stored encrypted and are never shown again.


​

Connect and choose what to sync

Any team member who is allowed to connect sources can do this.

  1. Open Connections → Catalogue from the side menu.

  2. Find TikTok Ads and click Connect.

  3. Under How do you want to connect?, choose Connect it myself: "Sign in with your TikTok Ads account and approve what Medialake can access."

  4. If your organization has saved its own app as an access key, an OAuth app dropdown also appears. Leave it on Medialake's OAuth app (tagged Recommended), or pick your organization's app by the name it was saved under.

  5. Sign in to TikTok for Business and authorize the request. You're returned to Medialake.

  6. Choose the ad accounts to sync. Medialake lists the ad accounts (TikTok calls them advertisers) that were authorized for the app when you approved access; accounts that weren't authorized don't appear.

For each selected ad account, Medialake syncs:

  • Images and videos from the ad account's creative assets. Files that TikTok doesn't provide a download link for are skipped.

  • Campaign structure: campaigns, ad groups, and ads, so each media file can be linked to the ads that use it.

  • Daily performance: spend, impressions, reach, frequency, clicks, CTR, CPC, CPM, conversions, cost per conversion, conversion rate, ROAS, video plays, 25% video views, average play time, engagements, comments, and shares.


​

Verifying it's really us

When you authorize, check that the app requesting access is the one you expect: Medialake's TikTok Ads app, or the app your organization created and named. If the name doesn't match, stop and contact us. Never approve a TikTok access request you weren't expecting.


​

Who should do the connecting

The connection is tied to the TikTok for Business account that signs in. Have it done by someone who:

  1. Has access to every ad account you want to sync.

  2. Is a permanent member of your team. If the person who authorized us leaves your company or loses access to the ad accounts, the connection stops working and someone else will need to reconnect.

Their TikTok login is used only to authorize the connection. The only account details we read are the user's ID, display name, username, and profile picture, to confirm who authorized.


​

Limiting what Medialake can access

We inherit at most the connecting person's access, and only for the ad accounts authorized for the app. To keep the connection as narrow as possible, have someone whose access covers only the ad accounts in scope do the connecting, and authorize only those accounts.


​

What Medialake reads

What we read

How we use it

The connecting user's TikTok for Business profile: ID, display name, username, profile picture

To confirm who authorized

The authorized ad accounts: ID, name, country, time zone, and currency

To list them for you to choose from, to suggest a region for each one, and to report spend in the right currency

Images and videos in each selected ad account's creative assets

To bring them into Medialake as media files

Campaigns, ad groups, and ads

To link each media file to the ads that use it

Daily performance reports

To power dashboards and reports

On TikTok, an app's permissions are set on the app itself, under Scope of permission in the TikTok API for Business portal, and the authorization screen lists the permissions selected for the app you're connecting with. Whichever app you use, the connector only makes requests covered by the read permissions in step 4 of setting up your own app.


​

What Medialake can and cannot do

Medialake can:

  • List the ad accounts authorized for the app

  • Read creative images and videos, including their names, sizes, and download links

  • Read campaigns, ad groups, ads, and performance reports

Medialake does not, and cannot:

  • See or store your password, or log in as you

  • Reach any ad account that wasn't authorized for the app, or that the connecting user cannot access

The connector never:

  • Creates, edits, pauses, or deletes campaigns, ad groups, ads, or creative assets

  • Changes budgets or billing, or spends money on your account

  • Adds, removes, or manages members of your business


​

Staying connected

There is no renewal schedule to plan around. Medialake keeps using the access token TikTok issued when you connected, and does not refresh it on its own.

If TikTok later reports the token as invalid or revoked, Medialake confirms it with TikTok and stops syncing the source until someone connects it again from Connections → Catalogue. That happens if access is revoked on TikTok's side. If the connecting user loses access to an ad account, TikTok refuses requests for that ad account instead, and someone who has access will need to reconnect.

If your organization uses its own app and its Secret changes, save the new values as an access key in Medialake and reconnect.


​

Revoking access

You're in control at any time. To remove the connection:

  • On TikTok, signed in as the connecting user, open the TikTok For Business authorization settings page and click Remove for the app, or

  • Remove the connecting user's access to the ad accounts in TikTok for Business, or

  • Disconnect the TikTok Ads source in Medialake.

Once TikTok stops accepting the token, data collection stops. No action is needed on our side.


​

Troubleshooting

Symptom

What to check

The access key won't save

The App ID must be 15 to 25 digits, and the Secret must be letters and numbers only, at least 30 characters. Paste both again with no spaces.

TikTok shows a redirect URL error (own app)

The app's advertiser redirect URL must exactly match your Medialake address followed by /tiktokads-redirect.

Sign-in fails before you reach the authorization screen (own app)

TikTok may not have approved the app yet. Check its status in the TikTok API for Business portal.

"This connection link is invalid or has expired. Please start the connection again."

The sign-in page was left open too long, or the link was already used. Start again from Connections → Catalogue.

No ad accounts are listed after connecting

No ad accounts were authorized for the app, or the signed-in user has no access to any. Reconnect and authorize the ad accounts you need.

An ad account is missing

It wasn't authorized when you approved access, or the signed-in user can't access it. Reconnect with a user who has access and authorize it.

A working connection stopped syncing

Access was revoked, the connecting user lost access, or (own app) the Secret changed. Reconnect, and update the access key if the Secret changed.

If you get stuck, contact [email protected]. Do not include your Secret.


​

Further reading (TikTok documentation)


You can review or withdraw access at any time from your TikTok for Business account.

Did this answer your question?