create_tiktok_ads_rule
Create a TikTok automated rule (created turned OFF)
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
| Parameter | Type | Description |
|---|---|---|
advertiserId | string | TikTok ad account id from list_tiktok_ads_accounts; omit when only one account is shared with this profile |
namerequired | string | what this rule is called in TikTok Ads Manager — up to 512 characters |
applyObjectsrequired | object[] | what the rule watches |
applyObjects[].dimensionrequired | "CAMPAIGN" | "ADGROUP" | "AD" | level the rule watches: CAMPAIGN, ADGROUP or AD |
applyObjects[].preConditionTyperequired | string | SELECTED 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[].dimensionIds | string[] | required when preConditionType is SELECTED |
conditionsrequired | object[] | when it fires |
conditions[].subjectTyperequired | string | COST, 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[].rangeType | string | TODAY | YESTERDAY | PAST_THREE_DAYS | PAST_FIVE_DAYS | PAST_SEVEN_DAYS | LIFETIME |
conditions[].matchType | string | GT | LT | BETWEEN | MATCH — plus CONTAINS / NOT_CONTAINS / START_WITH / END_WITH / STRING_EQUAL, which TikTok allows ONLY when subjectType is NAME |
conditions[].valuesrequired | string[] | BETWEEN takes exactly two |
conditions[].calculationType | string | ALL_OBJECTS | OF_EACH_OBJECT — COST only |
actionsrequired | object[] | 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[].value | object | { value, limit } — limit is REQUIRED for INCREASE and DECREASE and is the ceiling (INCREASE) or floor (DECREASE) the rule may never cross |
actions[].frequencyInfo | object | { 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 |
notificationrequired | object | { notificationType: TASK_FINISH | ANY_CHANGES | NOT_NOTIFICATION, emailSetting } — note these emails go to the developer address on the app, not to the user |
ruleExecInforequired | object | { 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 |
tzone | string | timezone 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.
Related tools
set_tiktok_ads_rule_statusArm, disarm or delete a TikTok automated ruletiktok_ads_rule_resultsWhat TikTok’s automated rules actually didupdate_tiktok_ads_ruleReplace a TikTok automated rule’s definitionlist_tiktok_ads_rulesList TikTok automated rules, classified by whether they can spendbind_tiktok_ads_rulePut objects under a TikTok automated rule, or take them out