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

# Update a targeting expression

Update an existing targeting expression.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Core API Resources",
    "version": "2.0.0",
    "description": "Buzz API v2"
  },
  "paths": {
    "/targeting-expressions/{id}": {
      "put": {
        "operationId": "targeting_expressions_update",
        "description": "Update an existing targeting expression.",
        "summary": "Update a targeting expression",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "description": "A unique integer value identifying this expression.",
            "required": true
          }
        ],
        "tags": [
          "Targeting"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Expression"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Expression"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Expression"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "nestSessionAuth": []
          },
          {
            "nestBasicAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Expression"
                }
              }
            },
            "description": "Targeting expression updated successfully."
          },
          "400": {
            "description": "Invalid request data."
          },
          "401": {
            "description": "Authentication credentials were not provided or are invalid."
          },
          "403": {
            "description": "You do not have permission to access this resource."
          },
          "404": {
            "description": "Targeting expression not found."
          },
          "500": {
            "description": "An error occurred on the server."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Expression": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "modules": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Module"
            },
            "description": "Refer to the [targeting guide](https://docs.beeswax.com/v2.0/docs/targeting) for more information on constructing the modules object"
          },
          "create_date": {
            "type": "string",
            "readOnly": true,
            "nullable": true,
            "description": "The date and time the object was first created",
            "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
            "example": "2025-09-29 00:00:00"
          },
          "update_date": {
            "type": "string",
            "readOnly": true,
            "nullable": true,
            "description": "The date and time the object was last updated",
            "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
            "example": "2025-09-29 00:00:00"
          },
          "active": {
            "type": "boolean",
            "default": true
          },
          "alternative_id": {
            "type": "string",
            "nullable": true,
            "description": "An ID that may be used for any reporting or administrative purpose. Limited to 191 characters.",
            "maxLength": 200
          },
          "notes": {
            "type": "string",
            "nullable": true,
            "description": "Free-form notes of up to 255 characters.",
            "maxLength": 255
          },
          "name": {
            "type": "string",
            "nullable": true,
            "maxLength": 191
          },
          "guaranteed": {
            "type": "boolean",
            "description": "Whether this Expression is being used to configure a Programmatic Guaranteed Line item. Must match the value of guaranteed on the Line Item. When this is true, only 'deal_id' can be targeted."
          },
          "account_id": {
            "type": "integer",
            "description": "Defaults to the account in the active session"
          }
        },
        "required": [
          "account_id",
          "create_date",
          "id",
          "modules",
          "update_date"
        ]
      },
      "Module": {
        "type": "object",
        "properties": {
          "all": {
            "type": "object",
            "additionalProperties": {}
          },
          "any": {
            "type": "object",
            "additionalProperties": {}
          },
          "none": {
            "type": "object",
            "additionalProperties": {}
          }
        }
      }
    },
    "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
  }
}
```