View as Markdown
TikTok Ads Manager icon

TikTok Ads Manager ACTION

Create Audience

Create a new TikTok custom audience from hashed customer identifiers. Uploads the identifiers first, then creates the audience — both steps happen in one tool call. Provide either identifiers (a list of SHA256-hashed values passed directly) or file_path (a CSV file with one identifier per line). identifier_type controls the hash format: EMAIL_SHA256 for hashed emails, PHONE_SHA256 for hashed phone numbers, IDFA_SHA256 or GAID_SHA256 for device IDs. To add members to an existing audience, use Update Audience instead. See the documentation
  • Action
  • Writes data
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's TikTok Ads Manager account once, then configure and run Create Audience from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "tiktok_ads_manager-create-audience",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    tiktok_ads_manager: { authProvisionId: "apn_xxxxxxx" },
    advertiserId: "Advertiser ID",
    audienceName: "Audience Name",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Audience inputs
Property Type Description
advertiserId Advertiser ID string
Your TikTok Ads Manager advertiser ID. Find it in the Ads Manager URL after aadvid= (e.g., aadvid=7123456789012345678). Also visible under Account Info in Business Center.
Required
audienceName Audience Name string
Display name for the new custom audience.
Required
calculateType Identifier Type string
Hash type and identifier format. EMAIL_SHA256 for SHA256-hashed email addresses (most common). PHONE_SHA256 for SHA256-hashed phone numbers. IDFA_SHA256 / IDFA_MD5 for Apple device IDs. GAID_SHA256 / GAID_MD5 for Android device IDs. MULTIPLE_TYPES when the file contains a mix.
Required
identifiers Identifiers string[]
List of SHA256-hashed identifiers to seed the audience with. Pass these directly instead of a file. Example: ["a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3"]. Use this when you have the hashed values inline; use file_path when the data is in a file.
Optional
filePath File Path or URL string
CSV/text file with one SHA256-hashed identifier per line. Provide a /tmp file path or a publicly accessible URL. Use identifiers instead if you have the values inline.
Optional
retentionDays Retention Days integer
How many days to retain audience members (default: 365, max: 365).
Optional
syncDir SyncDir dir
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
tiktok_ads_manager-create-audience
Version
0.0.2
App
TikTok Ads Manager
Authentication
OAuth
Read-only
No
Destructive
No
Open world
Yes