Inputs
SelectItem
Output
Type:Dict
Returns counts of added/removed criteria and the ad group’s resulting targeting criteria with their ids.
Fields: dynamic (depend on the inputs)Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Adds and removes targeting criteria on an X Ads ad group (keywords, locations, interests, demographics, followers, custom audiences and more) using X’s batch endpoint
| App | X Ads |
| Operation ID | x_ads_set_targeting |
| Type | Action |
| Connection | x_ads (required) |
| Credits per run | 1 |
| Agent / MCP tool | Yes |
| Requires approval | Yes (write operation) |
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
account | DynamicAccount | Yes | - | Select the X Ads account that owns the ad group. |
ad_group_id | string or SelectItem | Yes | - | Ad group (line item) whose targeting criteria to change. |
add | array of object or string | No | - | Targeting criteria to add, as a list of objects matching the X Ads API payload: [{“targeting_type”: ”…”, “targeting_value”: ”…”, “operator_type”: “EQ”}]. operator_type defaults to EQ; use NE to exclude (e.g. negated keywords), GTE/LT for AGE style ranges where X documents them. targeting_type values: BROAD_KEYWORD, EXACT_KEYWORD, PHRASE_KEYWORD, UNORDERED_KEYWORD (targeting_value is the keyword text), LOCATION, INTEREST, AGE (e.g. AGE_25_TO_34), GENDER (1 male, 2 female), LANGUAGE, PLATFORM, PLATFORM_VERSION, DEVICE, WIFI_ONLY, EVENT, CONVERSATION, ENGAGEMENT_TYPE, FOLLOWERS_OF_USER, SIMILAR_TO_FOLLOWERS_OF_USER (user ids), CAMPAIGN_ENGAGEMENT, CAMPAIGN_ENGAGEMENT_LOOKALIKE, USER_ENGAGEMENT, USER_ENGAGEMENT_LOOKALIKE, NETWORK_OPERATOR, NETWORK_ACTIVATION_DURATION, TV_SHOW, LIVE_TV_EVENT, CUSTOM_AUDIENCE, CUSTOM_AUDIENCE_EXPANDED, APP_STORE_CATEGORY, APP_STORE_CATEGORY_LOOKALIKE, APP_LIST (NE only). Use x_ads_search_targeting to find ids for LOCATION, INTEREST, EVENT, CONVERSATION, DEVICE, PLATFORM, LANGUAGE, TV_SHOW and the like. Example: [{“targeting_type”: “BROAD_KEYWORD”, “targeting_value”: “marketing analytics”}, {“targeting_type”: “LOCATION”, “targeting_value”: “96683cc9126741d1”}] |
remove | string or array of string | No | - | Targeting criterion IDs to delete (list or comma-separated), from this node’s output or a previous run. Pass the single value ALL to remove every existing criterion, which combined with add replaces the ad group’s targeting. |
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
value | string | Yes | - | The value of the selectable item. |
label | string | Yes | - | The label of the selectable item, used for display purposes. If not provided, defaults to the value. |
Dict
Returns counts of added/removed criteria and the ad group’s resulting targeting criteria with their ids.
Fields: dynamic (depend on the inputs)