X automation API
Rules that repost or delete the workspace's own X posts, and their runs.
4 endpoints. Every path is relative to the API base URL and needs a bearer token unless it is marked public. See the REST API overview for authentication, errors and pagination.
GET/v1/orgs/{orgId}/automation/x/rules
The workspace's rules for looking after its own published X posts: reposting the ones that did well (autoRepost) and deleting the ones that didn't (autoDelete). Null means that rule has never been set up.
Path parameters
orgIdstring (uuid)required
Responses
200The workspace's rules for looking after its own published X posts: reposting the ones that did well (autoRepost) and deleting the ones that didn't (autoDelete). Null means that rule has never been set up.
dataobjectrequiredFields
autoRepostobject | nullrequiredFields
channel"x"socialAccountIdstring (uuid) | nullenabledbooleanminAgeHoursintegermaxAgeDaysintegerselectionobjectOption 1
mode"threshold"requiredminImpressionsinteger | nullminLikesinteger | nullminEngagementRatenumber | null
Option 2
mode"top_n"requirednintegerrankBystringone of
impressions,likes,engagement
cooldownHoursPerPostintegermaxRepostsPerPostintegermaxActionsPerDayintegeraction"retweet"dryRunboolean
autoDeleteobject | nullrequiredFields
channel"x"socialAccountIdanyenabledbooleanminAgeHoursintegermaxAgeDaysintegermaxImpressionsinteger | nullmaxLikesinteger | nullrequireMetricsFetchedtruemetricsMaxAgeHoursintegerskipIfRepliesGteintegermaxActionsPerDayintegerdryRunboolean
updatedAtstring | nullrequiredupdatedBystring | nullrequired
curl -X GET "https://api.adventur.ai/v1/orgs/$ORG_ID/automation/x/rules" \ -H "Authorization: Bearer $ADVENTURAI_TOKEN"PUT/v1/orgs/{orgId}/automation/x/rules
Sets the auto-repost and auto-delete rules for the workspace's own published X posts. One kind at a time: a kind left out keeps its saved rule, and fields left out of a kind keep their values, or take safe defaults (off, dry run) the first time. Passing null for a threshold clears it.
Path parameters
orgIdstring (uuid)required
Request body application/json
autoRepostobjectFields
channel"x"socialAccountIdstring (uuid) | nullenabledbooleanminAgeHoursintegermaxAgeDaysintegerselectionobjectOption 1
mode"threshold"requiredminImpressionsinteger | nullminLikesinteger | nullminEngagementRatenumber | null
Option 2
mode"top_n"requirednintegerrankBystringone of
impressions,likes,engagement
cooldownHoursPerPostintegermaxRepostsPerPostintegermaxActionsPerDayintegeraction"retweet"dryRunboolean
autoDeleteobjectFields
channel"x"socialAccountIdanyenabledbooleanminAgeHoursintegermaxAgeDaysintegermaxImpressionsinteger | nullmaxLikesinteger | nullrequireMetricsFetchedtruemetricsMaxAgeHoursintegerskipIfRepliesGteintegermaxActionsPerDayintegerdryRunboolean
Responses
200Sets the auto-repost and auto-delete rules for the workspace's own published X posts. One kind at a time: a kind left out keeps its saved rule, and fields left out of a kind keep their values, or take safe defaults (off, dry run) the first time. Passing null for a threshold clears it.
dataobjectrequiredFields
autoRepostobject | nullrequiredFields
channel"x"socialAccountIdstring (uuid) | nullenabledbooleanminAgeHoursintegermaxAgeDaysintegerselectionobjectOption 1
mode"threshold"requiredminImpressionsinteger | nullminLikesinteger | nullminEngagementRatenumber | null
Option 2
mode"top_n"requirednintegerrankBystringone of
impressions,likes,engagement
cooldownHoursPerPostintegermaxRepostsPerPostintegermaxActionsPerDayintegeraction"retweet"dryRunboolean
autoDeleteobject | nullrequiredFields
channel"x"socialAccountIdanyenabledbooleanminAgeHoursintegermaxAgeDaysintegermaxImpressionsinteger | nullmaxLikesinteger | nullrequireMetricsFetchedtruemetricsMaxAgeHoursintegerskipIfRepliesGteintegermaxActionsPerDayintegerdryRunboolean
updatedAtstring | nullrequiredupdatedBystring | nullrequired
curl -X PUT "https://api.adventur.ai/v1/orgs/$ORG_ID/automation/x/rules" \ -H "Authorization: Bearer $ADVENTURAI_TOKEN" \ -H "Content-Type: application/json" \ -d '{}'POST/v1/orgs/{orgId}/automation/x/run
Applies the workspace's X automation rules to its own published X posts straight away, instead of waiting for the nightly sweep. Only rules that are switched on are considered, and a rule in dry run records what it would have done without touching X.
Path parameters
orgIdstring (uuid)required
Request body application/json
kindsarray<string>dryRunboolean
Responses
200Applies the workspace's X automation rules to its own published X posts straight away, instead of waiting for the nightly sweep. Only rules that are switched on are considered, and a rule in dry run records what it would have done without touching X.
dataobjectrequiredFields
dryRunbooleanrequiredkindsarray<string>requiredcountsobjectrequiredFields
evaluatedintegerrequiredmatchedintegerrequiredactedintegerrequiredskippedintegerrequiredfailedintegerrequired
actionsarray<object>requiredItem fields
idstring (uuid)requiredkindstringrequiredone of
auto_repost,auto_deletesocialAccountIdstring (uuid) | nullrequiredsourcePostIdstring (uuid) | nullrequiredexternalTweetIdstring | nullrequiredstatusstringrequiredone of
planned,succeeded,failed,skippedreasonstring | nullrequireddryRunbooleanrequirederrorstring | nullrequiredcreatedAtstringrequired
warningsarray<string>required
curl -X POST "https://api.adventur.ai/v1/orgs/$ORG_ID/automation/x/run" \ -H "Authorization: Bearer $ADVENTURAI_TOKEN" \ -H "Content-Type: application/json" \ -d '{}'GET/v1/orgs/{orgId}/automation/x/runs
What the workspace's X automation rules decided about its own published posts, newest first: reposted, deleted, left alone, or — in dry run — what would have happened.
Path parameters
orgIdstring (uuid)required
Query parameters
limitinteger
Responses
200What the workspace's X automation rules decided about its own published posts, newest first: reposted, deleted, left alone, or — in dry run — what would have happened.
dataobjectrequiredFields
itemsarray<object>requiredItem fields
idstring (uuid)requiredkindstringrequiredone of
auto_repost,auto_deletesocialAccountIdstring (uuid) | nullrequiredsourcePostIdstring (uuid) | nullrequiredexternalTweetIdstring | nullrequiredstatusstringrequiredone of
planned,succeeded,failed,skippedreasonstring | nullrequireddryRunbooleanrequirederrorstring | nullrequiredcreatedAtstringrequired
curl -X GET "https://api.adventur.ai/v1/orgs/$ORG_ID/automation/x/runs" \ -H "Authorization: Bearer $ADVENTURAI_TOKEN"