update_x_automation_rules
posts:write
Set the rules for the workspace's own published X posts. Pass autoRepost, autoDelete, or both; a kind you leave out is untouched, and within a kind only the fields you pass change. A new rule starts enabled false and dryRun true. autoRepost natively retweets posts that did well: minAgeHours (default 24) and maxAgeDays (default 90) bound how old a post may be, selection is either { mode: 'top_n', n, rankBy: 'impressions' | 'likes' | 'engagement' } or { mode: 'threshold', minImpressions, minLikes, minEngagementRate }, cooldownHoursPerPost and maxRepostsPerPost stop the same post repeating, and maxActionsPerDay caps the day (0 does nothing). selection replaces wholesale, so pass the whole object. autoDelete removes posts that flopped: minAgeHours (default 72), maxAgeDays (default 30), maxImpressions and maxLikes are the ceilings a post must have stayed under, skipIfRepliesGte keeps posts people replied to, and metricsMaxAgeHours requires fresh numbers.
Deleting a post on X cannot be undone, so confirm the thresholds with the user and leave dryRun true until they have seen what a run would do. Leaving a threshold out and passing it as null are different: out keeps the saved number, null clears it so that ceiling or floor stops applying. An autoDelete rule with neither maxImpressions nor maxLikes set matches nothing.
Rules only ever touch posts this workspace published from its own connected X account.
Input
autoRepostobjectFields
channel"x"default
"x"socialAccountIdstring (uuid) | nulldefault
nullenabledbooleandefault
falseminAgeHoursintegermin 1 · default
24maxAgeDaysintegermin 1 · max 365 · default
90selectionobjectdefault
{"mode":"top_n"}Option 1
mode"threshold"requiredminImpressionsinteger | nulldefault
nullminLikesinteger | nulldefault
nullminEngagementRatenumber | nulldefault
null
Option 2
mode"top_n"requirednintegermin 1 · max 20 · default
3rankBystringone of
impressions,likes,engagement· default"impressions"
cooldownHoursPerPostintegermin 1 · default
168maxRepostsPerPostintegermin 1 · max 5 · default
1maxActionsPerDayintegermin 0 · max 50 · default
3action"retweet"default
"retweet"dryRunbooleandefault
true
autoDeleteobjectFields
channel"x"default
"x"socialAccountIdstring (uuid) | nulldefault
nullenabledbooleandefault
falseminAgeHoursintegermin 1 · default
72maxAgeDaysintegermin 1 · max 365 · default
30maxImpressionsinteger | nulldefault
nullmaxLikesinteger | nulldefault
nullrequireMetricsFetchedtruedefault
truemetricsMaxAgeHoursintegermin 1 · default
36skipIfRepliesGteintegermin 0 · default
1maxActionsPerDayintegermin 0 · max 50 · default
5dryRunbooleandefault
true
Permission
Needs the posts:write scope: create drafts. It changes your workspace, so clients may ask you to confirm each call.
Example call
Your assistant sends this for you. It is shown so you can see the shape of a call, with placeholder values for the required fields.
{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "update_x_automation_rules", "arguments": {} }}Same action over the REST API
The tool runs PUT /v1/orgs/{orgId}/automation/x/rules as the signed-in user, with the same validation, approval rules and limits. See it in the X automation API reference.