hermosodocs

create_tiktok_ads_rule

Create a TikTok automated rule (created turned OFF)

Area: AUTOMATED RULES · Ad campaign management. Generated from the running MCP server, like the rest of the tool reference.

Description

AUTOMATED RULES — a standing instruction TikTok runs on the user’s ad account on TIKTOK’S schedule, with nobody watching. WHAT A RULE CAN DO UNATTENDED, depending on its actions: pause a campaign / ad group / ad (TURN_OFF), email a report (MESSAGE), LOWER a daily budget, lifetime budget or bid (DECREASE) — or TURN AN OBJECT BACK ON and RAISE a budget or bid (TURN_ON, INCREASE, ADJUST_TO). The second group is standing permission to spend the user’s money without anyone present, on objects the rule re-selects at every execution, so treat it as such and say so before creating one. EVERY RULE IS CREATED TURNED OFF AND READ BACK TO PROVE IT: TikTok publishes no status field on its create and its own example shows a fresh rule running, so Hermoso creates it and disarms it in a second call — and if that second call fails the reply says LOUDLY that a live rule is on the account and how to switch it off. ARMING IS A SEPARATE ACT (set_tiktok_ads_rule_status), which is what makes the rule inspectable in between. An INCREASE or DECREASE must carry value.limit; TikTok requires it and it IS the safety rail — an increase without a ceiling ratchets upward every time the rule fires. TWO THINGS TIKTOK ITSELF PUBLISHES ABOUT THIS ENDPOINT: it is "supported exclusively for direct advertisers" and says SaaS platforms managing multiple advertisers cannot use it, so it may simply be refused for this account — that is THEIR restriction, not a broken connection and no reconnect changes it; and every notification it generates goes to the developer address registered on the app rather than to the user, so tiktok_ads_rule_results is the only place they will see what a rule did. Free.

Parameters

ParameterTypeDescription
advertiserIdstringTikTok ad account id from list_tiktok_ads_accounts; omit when only one account is shared with this profile
namerequiredstringwhat this rule is called in TikTok Ads Manager — up to 512 characters
applyObjectsrequiredobject[]what the rule watches
applyObjects[].dimensionrequired"CAMPAIGN" | "ADGROUP" | "AD"level the rule watches: CAMPAIGN, ADGROUP or AD
applyObjects[].preConditionTyperequiredstringSELECTED names a FIXED set and requires dimensionIds. Every other value (ALL_ACTIVE_CAMPAIGN, ALL_ACTIVE_AD_GROUP, ALL_ACTIVE_AD, ALL_ACTIVE_AD_GROUP_UNDER_SELECTED, ALL_ACTIVE_AD_UNDER_SELECTED and their ALL_INACTIVE_ twins) is RE-RESOLVED BY TIKTOK AT EVERY RUN, so objects created after today fall inside it.
applyObjects[].dimensionIdsstring[]required when preConditionType is SELECTED
conditionsrequiredobject[]when it fires
conditions[].subjectTyperequiredstringCOST, CPA, CPC, CPM, CTR, CVR, CONVERSION, IMPRESSION, CLICK, RESULT, COST_PER_RESULT, DAILY_BUDGET_SPENDING_RATE, ROAS_PURCHASE, DAYS_SINCE_CREATION, NAME … or NO_CONDITION, which TikTok itself warns about because it matches everything, every run
conditions[].rangeTypestringTODAY | YESTERDAY | PAST_THREE_DAYS | PAST_FIVE_DAYS | PAST_SEVEN_DAYS | LIFETIME
conditions[].matchTypestringGT | LT | BETWEEN | MATCH — plus CONTAINS / NOT_CONTAINS / START_WITH / END_WITH / STRING_EQUAL, which TikTok allows ONLY when subjectType is NAME
conditions[].valuesrequiredstring[]BETWEEN takes exactly two
conditions[].calculationTypestringALL_OBJECTS | OF_EACH_OBJECT — COST only
actionsrequiredobject[]what it does when the conditions match
actions[].subjectTyperequired"TURN_ON" | "TURN_OFF" | "MESSAGE" | "DAILY_BUDGET" | "LIFETIME_BUDGET" | "BID"TURN_OFF, MESSAGE and a DECREASE cannot start or raise spend. TURN_ON, INCREASE and ADJUST_TO can.
actions[].actionType"INCREASE" | "DECREASE" | "ADJUST_TO"required for DAILY_BUDGET / LIFETIME_BUDGET / BID. ADJUST_TO is treated as spend-increasing because it is only a decrease for objects currently above the target, which the rule does not read until it fires.
actions[].valueType"EXACT" | "PERCENT"EXACT (an absolute amount) or PERCENT (a percentage change)
actions[].valueobject{ value, limit } — limit is REQUIRED for INCREASE and DECREASE and is the ceiling (INCREASE) or floor (DECREASE) the rule may never cross
actions[].frequencyInfoobject{ type: ONLY_ONCE | ONCE_IN_24_H | ONCE_IN_48_H | ONCE_IN_1_W | CUSTOM, customFrequencyType, time, count } — how often a budget/bid action may repeat
notificationrequiredobject{ notificationType: TASK_FINISH | ANY_CHANGES | NOT_NOTIFICATION, emailSetting } — note these emails go to the developer address on the app, not to the user
ruleExecInforequiredobject{ execTimeType: PER_HALF_HOUR | CUSTOM | HALF_HOUR_IN_SPECIFIC_TIME_PERIOD | SPECIFIC_TIME_ACCURATE_ONCE, execTime, timePeriodInfo } — PER_HALF_HOUR runs every thirty minutes forever
tzonestringtimezone for the rule's time windows, sent to TikTok as given

Example call

Every required parameter is shown, filled from the schema where it gives a value and otherwise with a placeholder naming the type. Replace the placeholders with real values. The same call works on the MCP server, the CLI and POST https://app.hermoso.ai/v1/tools/create_tiktok_ads_rule.

MCP (tools/call)

{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"create_tiktok_ads_rule","arguments":{"name":"<string>","applyObjects":"<array>","conditions":"<array>","actions":"<array>","notification":"<object>","ruleExecInfo":"<object>"}}}

CLI

hermoso call create_tiktok_ads_rule --json '{"name":"<string>","applyObjects":"<array>","conditions":"<array>","actions":"<array>","notification":"<object>","ruleExecInfo":"<object>"}'

Credits

Credits are spent only on two things: running an AI model (image, video, voice, text, planning, post-production) and Ad Spy research. See Credits & costs.

All 759 Ad campaign management tools · tools.json