TikTok Ads Manager ACTION
Update Audience
Update a TikTok custom audience — rename it, or add/remove/replace members via a file of hashed identifiers. To rename only, provide
audience_name and omit identifiers/file_path. To modify members, provide identifiers or file_path and set action (APPEND, REMOVE, or REPLACE). The file upload and audience update happen in one tool call. Audience size must remain ≥ 1,000 after the operation. Use List Audiences to find the audience_id. 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 Update 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-update-audience",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
tiktok_ads_manager: { authProvisionId: "apn_xxxxxxx" },
advertiserId: "Advertiser ID",
audienceId: "Audience ID",
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "tiktok_ads_manager-update-audience",
"configured_props": {
"tiktok_ads_manager": { "authProvisionId": "apn_xxxxxxx" },
"advertiserId": "Advertiser ID",
"audienceId": "Audience ID"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "tiktok_ads_manager",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "tiktok_ads_manager-update-audience",
arguments: {
advertiserId: "Advertiser ID",
audienceId: "Audience ID",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| 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 |
audienceId Audience ID | string | ID of the custom audience to update. Use List Audiences to find the ID. Required |
audienceName New Audience Name | string | New display name for the audience (max 128 characters). Required if identifiers and file_path are both omitted. Optional |
action Action | string | How to modify audience members. APPEND adds new identifiers. REMOVE removes matching identifiers. REPLACE replaces all members. Required when providing identifiers or file_path. Default: REPLACE. Optional |
calculateType Identifier Type | string | Hash type of the identifiers in the upload. Must match the type used when the audience was created. Optional |
identifiers Identifiers | string[] | List of SHA256-hashed identifiers to add/remove/replace. Pass these directly instead of a file. Example: ["a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3"]. Optional |
filePath File Path or URL | string | CSV/text file with one SHA256-hashed identifier per line. Use identifiers instead if you have the values inline. 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-update-audience
- Version
- 0.0.2
- App
- TikTok Ads Manager
- Authentication
- OAuth
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗