---
updatedAt: 2026-08-13T23:51:37.000Z
---

# Bulk update targeting expressions

Processes changes to multiple targeting expressions in a single atomic transaction. Each command in the request applies modifications to all specified targeting expressions. If any validation errors occur, the entire operation is rolled back.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Core API Resources",
    "version": "2.0.0",
    "description": "Buzz API v2"
  },
  "paths": {
    "/line-items/bulk-targeting": {
      "post": {
        "operationId": "line_items_bulk_targeting_create",
        "description": "Processes changes to multiple targeting expressions in a single atomic transaction. Each command in the request applies modifications to all specified targeting expressions. If any validation errors occur, the entire operation is rolled back.",
        "summary": "Bulk update targeting expressions",
        "tags": [
          "Targeting"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TargetingBulkUpdateRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/TargetingBulkUpdateRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/TargetingBulkUpdateRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "nestSessionAuth": []
          },
          {
            "nestBasicAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TargetingBulkUpdateResponse"
                  }
                }
              }
            },
            "description": "Successful bulk update of targeting expressions."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TargetingBulkUpdateError"
                }
              }
            },
            "description": "Validation errors occurred during bulk update. No changes were saved."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BulkPredicate": {
        "type": "object",
        "properties": {
          "recency": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NestRecency"
              }
            ],
            "nullable": true,
            "description": "Segment recency object; only valid within \"add\" and if key=\"segment\"."
          },
          "cpm_override": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,3}(?:\\.\\d{0,2})?$",
            "nullable": true
          },
          "comparator": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ComparatorEnum"
              }
            ],
            "description": "Comparator; e.g. `\"equals\"`\n\n* `equals` - Equals\n* `in_range` - In Range\n* `boolean_expression` - Boolean"
          },
          "value": {
            "type": "string",
            "description": "Targeting value."
          }
        },
        "required": [
          "comparator",
          "value"
        ]
      },
      "ComparatorEnum": {
        "enum": [
          "equals",
          "in_range",
          "boolean_expression"
        ],
        "type": "string",
        "description": "* `equals` - Equals\n* `in_range` - In Range\n* `boolean_expression` - Boolean"
      },
      "NestRecency": {
        "type": "object",
        "properties": {
          "start": {
            "type": "integer",
            "maximum": 129600,
            "minimum": 0,
            "nullable": true
          },
          "end": {
            "type": "integer",
            "maximum": 129600,
            "minimum": 0,
            "nullable": true
          }
        }
      },
      "TargetingBulkUpdateCommand": {
        "type": "object",
        "properties": {
          "action": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TargetingBulkUpdateCommandActionEnum"
              }
            ],
            "description": "One of: `\"add\"`, `\"remove\"`, `\"replace\"`\n\n* `add` - Add\n* `remove` - Remove\n* `replace` - Replace"
          },
          "key": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TargetingBulkUpdateCommandKeyEnum"
              }
            ],
            "description": "Targeting key; e.g. `\"city\"`\n\n* `ad_position` - Ad Position\n* `ads_txt` - Ads Txt\n* `app_bundle_list` - App Bundle List\n* `app_id_list` - App ID List\n* `app_name` - App Name\n* `auction_type` - Auction Type\n* `audio_companion_required` - Audio Companion Required\n* `audio_content_genre` - Audio Content Genre\n* `audio_start_delay` - Audio Start Delay\n* `bandwidth` - Bandwidth\n* `browser` - Browser\n* `browser_version` - Browser Version\n* `carrier` - Carrier\n* `city` - City\n* `companion_required` - Companion Required\n* `congressional_district` - Congressional District\n* `content_category` - Content Category\n* `content_genre` - Content Genre\n* `content_rating` - Content Rating\n* `country` - Country\n* `deal_id` - Deal ID\n* `deal_id_list` - Deal ID List\n* `delivery` - Delivery\n* `device_make` - Device Make\n* `device_model` - Device Model\n* `device_screen_size` - Device Screen Size\n* `device_type` - Device Type\n* `domain_list` - Domain List ID\n* `environment_type` - Environment Type\n* `feed` - Feed\n* `interstitial` - Interstitial\n* `interstitial_type` - Interstitial Type\n* `inventory_source` - Inventory Source\n* `ip_address` - IP Address\n* `ipv4_address` - IPv4 address\n* `language` - Language\n* `lat_long_list` - Latitude & Longitude List\n* `lat_long_present` - Latitude & Longitude Present\n* `location_type` - Location Type\n* `metro` - Metro\n* `native_layout` - Native Layout\n* `operating_system` - Operating System\n* `operating_system_version` - Operating System Version\n* `placement` - Placement ID\n* `placement_list` - Placement ID List\n* `playback_method` - Playback Method\n* `player_size` - Player Size\n* `publisher_id` - Publisher ID\n* `publisher_id_list` - Publisher ID List\n* `region` - Region\n* `rewarded` - Rewarded\n* `segment` - Segment\n* `site` - Site ID\n* `site_list` - Site ID List\n* `start_delay` - Video Start Delay\n* `state_house_district` - State House District\n* `state_senate_district` - State Senate District\n* `time_of_week` - Time Of Week\n* `topframe` - Topframe\n* `user_id` - User ID\n* `user_time_of_week` - User Time Of Week\n* `video_api` - Video API\n* `video_placement_type` - Video Placement Type\n* `zip` - Zip\n* `zip_code_list` - Zip Code List"
          },
          "to_group": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToGroupEnum"
            },
            "description": "Key group, predicate group pair; e.g. `[\"all\", \"any\"]`"
          },
          "from_groups": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "enum": [
                  "any",
                  "all",
                  "none"
                ],
                "type": "string",
                "description": "* `any` - Any\n* `all` - All\n* `none` - None"
              }
            },
            "description": "Array of key group, predicate group pairs; e.g. `[[\"all\", \"any\"], [\"none\", \"any\"]]`"
          },
          "add": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BulkPredicate"
            },
            "description": "Predicate objects to add"
          },
          "remove": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BulkPredicate"
            },
            "description": "Predicate objects to remove"
          }
        },
        "required": [
          "action",
          "key"
        ]
      },
      "TargetingBulkUpdateCommandActionEnum": {
        "enum": [
          "add",
          "remove",
          "replace"
        ],
        "type": "string",
        "description": "* `add` - Add\n* `remove` - Remove\n* `replace` - Replace"
      },
      "TargetingBulkUpdateCommandKeyEnum": {
        "enum": [
          "ad_position",
          "ads_txt",
          "app_bundle_list",
          "app_id_list",
          "app_name",
          "auction_type",
          "audio_companion_required",
          "audio_content_genre",
          "audio_start_delay",
          "bandwidth",
          "browser",
          "browser_version",
          "carrier",
          "city",
          "companion_required",
          "congressional_district",
          "content_category",
          "content_genre",
          "content_rating",
          "country",
          "deal_id",
          "deal_id_list",
          "delivery",
          "device_make",
          "device_model",
          "device_screen_size",
          "device_type",
          "domain_list",
          "environment_type",
          "feed",
          "interstitial",
          "interstitial_type",
          "inventory_source",
          "ip_address",
          "ipv4_address",
          "language",
          "lat_long_list",
          "lat_long_present",
          "location_type",
          "metro",
          "native_layout",
          "operating_system",
          "operating_system_version",
          "placement",
          "placement_list",
          "playback_method",
          "player_size",
          "publisher_id",
          "publisher_id_list",
          "region",
          "rewarded",
          "segment",
          "site",
          "site_list",
          "start_delay",
          "state_house_district",
          "state_senate_district",
          "time_of_week",
          "topframe",
          "user_id",
          "user_time_of_week",
          "video_api",
          "video_placement_type",
          "zip",
          "zip_code_list"
        ],
        "type": "string",
        "description": "* `ad_position` - Ad Position\n* `ads_txt` - Ads Txt\n* `app_bundle_list` - App Bundle List\n* `app_id_list` - App ID List\n* `app_name` - App Name\n* `auction_type` - Auction Type\n* `audio_companion_required` - Audio Companion Required\n* `audio_content_genre` - Audio Content Genre\n* `audio_start_delay` - Audio Start Delay\n* `bandwidth` - Bandwidth\n* `browser` - Browser\n* `browser_version` - Browser Version\n* `carrier` - Carrier\n* `city` - City\n* `companion_required` - Companion Required\n* `congressional_district` - Congressional District\n* `content_category` - Content Category\n* `content_genre` - Content Genre\n* `content_rating` - Content Rating\n* `country` - Country\n* `deal_id` - Deal ID\n* `deal_id_list` - Deal ID List\n* `delivery` - Delivery\n* `device_make` - Device Make\n* `device_model` - Device Model\n* `device_screen_size` - Device Screen Size\n* `device_type` - Device Type\n* `domain_list` - Domain List ID\n* `environment_type` - Environment Type\n* `feed` - Feed\n* `interstitial` - Interstitial\n* `interstitial_type` - Interstitial Type\n* `inventory_source` - Inventory Source\n* `ip_address` - IP Address\n* `ipv4_address` - IPv4 address\n* `language` - Language\n* `lat_long_list` - Latitude & Longitude List\n* `lat_long_present` - Latitude & Longitude Present\n* `location_type` - Location Type\n* `metro` - Metro\n* `native_layout` - Native Layout\n* `operating_system` - Operating System\n* `operating_system_version` - Operating System Version\n* `placement` - Placement ID\n* `placement_list` - Placement ID List\n* `playback_method` - Playback Method\n* `player_size` - Player Size\n* `publisher_id` - Publisher ID\n* `publisher_id_list` - Publisher ID List\n* `region` - Region\n* `rewarded` - Rewarded\n* `segment` - Segment\n* `site` - Site ID\n* `site_list` - Site ID List\n* `start_delay` - Video Start Delay\n* `state_house_district` - State House District\n* `state_senate_district` - State Senate District\n* `time_of_week` - Time Of Week\n* `topframe` - Topframe\n* `user_id` - User ID\n* `user_time_of_week` - User Time Of Week\n* `video_api` - Video API\n* `video_placement_type` - Video Placement Type\n* `zip` - Zip\n* `zip_code_list` - Zip Code List"
      },
      "TargetingBulkUpdateError": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "targeting_expression_id": {
            "type": "integer"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "errors",
          "id",
          "targeting_expression_id"
        ]
      },
      "TargetingBulkUpdateRequest": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Array of Line Item ids"
          },
          "commands": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TargetingBulkUpdateCommand"
            }
          }
        },
        "required": [
          "commands",
          "ids"
        ]
      },
      "TargetingBulkUpdateResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "targeting_expression_id": {
            "type": "integer"
          },
          "created": {
            "type": "boolean"
          }
        },
        "required": [
          "created",
          "id",
          "targeting_expression_id"
        ]
      },
      "ToGroupEnum": {
        "enum": [
          "any",
          "all",
          "none"
        ],
        "type": "string",
        "description": "* `any` - Any\n* `all` - All\n* `none` - None"
      }
    },
    "securitySchemes": {
      "nestBasicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Form-based Basic Authentication"
      },
      "nestSessionAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Form-based Basic Authentication"
      }
    }
  },
  "x-explorer-enabled": false,
  "x-samples-languages": [
    "curl",
    "node",
    "ruby",
    "javascript",
    "python",
    "php",
    "java"
  ],
  "servers": [
    {
      "url": "https://{buzz_key}.api.beeswax.com/rest/v2",
      "variables": {
        "buzz_key": {
          "default": "stingersbx",
          "description": "Unique customer ID assigned by the Beeswax"
        }
      }
    }
  ],
  "x-readme": {
    "apply-endpoint-order": true,
    "apply-tag-changes": true
  }
}
```