Skip to content

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

  • autoRepostobject
    Fields
    • channel"x"

      default "x"

    • socialAccountIdstring (uuid) | null

      default null

    • enabledboolean

      default false

    • minAgeHoursinteger

      min 1 · default 24

    • maxAgeDaysinteger

      min 1 · max 365 · default 90

    • selectionobject

      default {"mode":"top_n"}

      Option 1
      • mode"threshold"required
      • minImpressionsinteger | null

        default null

      • minLikesinteger | null

        default null

      • minEngagementRatenumber | null

        default null

      Option 2
      • mode"top_n"required
      • ninteger

        min 1 · max 20 · default 3

      • rankBystring

        one of impressions, likes, engagement · default "impressions"

    • cooldownHoursPerPostinteger

      min 1 · default 168

    • maxRepostsPerPostinteger

      min 1 · max 5 · default 1

    • maxActionsPerDayinteger

      min 0 · max 50 · default 3

    • action"retweet"

      default "retweet"

    • dryRunboolean

      default true

  • autoDeleteobject
    Fields
    • channel"x"

      default "x"

    • socialAccountIdstring (uuid) | null

      default null

    • enabledboolean

      default false

    • minAgeHoursinteger

      min 1 · default 72

    • maxAgeDaysinteger

      min 1 · max 365 · default 30

    • maxImpressionsinteger | null

      default null

    • maxLikesinteger | null

      default null

    • requireMetricsFetchedtrue

      default true

    • metricsMaxAgeHoursinteger

      min 1 · default 36

    • skipIfRepliesGteinteger

      min 0 · default 1

    • maxActionsPerDayinteger

      min 0 · max 50 · default 5

    • dryRunboolean

      default 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.

tools/call
{
"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.