# Update parent segment configuration

Update the specified parent segment configuration by its identifier.

Important: Update Behavior and the master Field

This endpoint supports two different update modes depending on whether the master field is included in the request body:

1. Partial Update (without master field): When the master field is omitted, only the scalar fields (e.g., name, description, scheduleType) in the request body are updated. The attributes, behaviors, and audienceFilters collections are left untouched, even if they are omitted or set to null or [] in the request.

2. Full Replacement (with master field): When the master field is included in the request body, the endpoint performs a full replacement of attributes, behaviors, and audienceFilters. All existing entries in these collections are deleted and replaced with exactly what is provided in the request:
   - If attributes, behaviors, or audienceFilters are omitted, set to null, or set to [], those collections will be cleared (all existing entries deleted).
   - Only the items explicitly included in the request body will exist after the update.
   - This is a destructive operation that cannot be undone.

Recommendations:
- For partial updates of scalar fields only: omit the master field from the request body.
- For full replacement: include the master field and provide complete definitions for attributes, behaviors, and audienceFilters to avoid unintended data loss.

Endpoint: PUT /audiences/{audienceId}
Version: 1.0.0
Security: TdApikeyAuth

## Path parameters:

  - `audienceId` (integer, required)
    ID of Master Segment Config that needs to be updated

## Request fields (application/json):

  - `id` (string)

  - `name` (string, required)

  - `description` (string)

  - `scheduleType` (string)
    Enum: "cron", "daily", "hourly", "minutes_interval", "monthly", "none", "weekly"

  - `scheduleOption` (string,null)
    Example: "00:00"

  - `timezone` (string)
    Example: "UTC"

  - `matrixUpdatedAt` (string,null)

  - `workflowHiveOnly` (boolean)
    Whether the workflow mainly use Hive or not. Default is false

  - `hiveEngineVersion` (string)
    Hive engine version used in audience workflows
    Enum: "0.13", "cdpaudience"

  - `hivePoolName` (string,null)

  - `prestoPoolName` (string,null)

  - `allowActivationBehavior` (boolean,null)

  - `maxActivationBehaviorRow` (integer,null)
    Only null is acceptable when allowActivationBehavior is false.

  - `llmEnabled` (boolean,null)
    llmEnabled indicates whether customer has enabled llm (true or false).

  - `llmState` (string)
    llmState indicates more detailed state including updating.
    Enum: "enabling", "enabled", "disabling", "disabled"

  - `population` (integer,null)
    the population of the audience

  - `enrichmentWordTaggingEnabled` (boolean)

  - `enrichmentIpEnabled` (boolean)

  - `enrichmentTdJsSdkEnabled` (boolean)

  - `master` (object)

  - `master.parentDatabaseName` (string, required)
    Source database name of the audience master

  - `master.parentTableName` (string, required)
    Source table name of the audience master

  - `attributes` (array)

  - `attributes.audienceId` (string, required)
    ID of Master Segment for this attribute

  - `attributes.name` (string, required)
    Column name user defined on Master Segment Configuration page of Data Workbench

  - `attributes.type` (string, required)
    Type of the column
    Enum: "string", "number", "timestamp", "date", "string_array", "number_array", "boolean"

  - `attributes.parentDatabaseName` (string, required)
    Database name of the attribute table

  - `attributes.parentTableName` (string, required)
    Table name of the attribute table

  - `attributes.parentColumn` (string, required)
    Column name of the attribute table which is imported into customer table

  - `attributes.parentKey` (string, required)
    Join key of the attribute table

  - `attributes.foreignKey` (string, required)
    Foreign key of the master table

  - `attributes.groupingName` (string,null, required)
    Group name of the attribute

  - `behaviors` (array)

  - `behaviors.id` (string, required)
    ID of Master Segment Config behavior

  - `behaviors.name` (string, required)
    Behavior name user defined on Master Segment Configuration page of Data Workbench

  - `behaviors.parentDatabaseName` (string, required)
    Database name of the behavior table

  - `behaviors.parentTableName` (string, required)
    Table name of the behavior table

  - `behaviors.parentKey` (string, required)
    Join key of the behavior table

  - `behaviors.foreignKey` (string, required)
    Foreign key of the master table

  - `behaviors.schema` (array, required)
    Columns of behavior

  - `behaviors.schema.name` (string, required)
    Column name user defined on Master Segment Configuration page of Data Workbench

  - `behaviors.schema.type` (string, required)
    Type of the column
    Enum: same as `attributes.type` (7 values)

  - `behaviors.schema.parentColumn` (string, required)
    Column name of the behavior table

  - `behaviors.scheduleType` (string)
    Enum: same as `scheduleType` (7 values)

  - `behaviors.scheduleOption` (string,null)

  - `behaviors.defaultTimeFilterEnabled` (boolean)

  - `behaviors.isRealtime` (boolean)

  - `customerGroup` (object)
    A group of customers within an audience

  - `customerGroup.id` (string)

  - `customerGroup.audienceId` (integer)

  - `customerGroup.name` (string, required)
    group name that is to be used for table name

  - `customerGroup.parentDatabaseName` (string, required)
    Database name of the customer_group table

  - `customerGroup.parentTableName` (string, required)
    Table name of the customer_group table

  - `customerGroup.parentKey` (string, required)
    Join key of the customer_group table

  - `customerGroup.foreignKey` (string, required)
    Foreign key of the customers table

  - `customerGroup.customerGroupAttributes` (array)

  - `customerGroup.customerGroupAttributes.name` (string, required)
    Column name

  - `customerGroup.customerGroupAttributes.type` (string, required)
    Type of the column
    Enum: same as `attributes.type` (7 values)

  - `customerGroup.customerGroupAttributes.parentDatabaseName` (string, required)
    Database name of the customer_group attribute table

  - `customerGroup.customerGroupAttributes.parentTableName` (string, required)
    Table name of the customer_group attribute table

  - `customerGroup.customerGroupAttributes.parentColumn` (string, required)
    Column name of the customer_group attribute table which is imported into customer table

  - `customerGroup.customerGroupAttributes.parentKey` (string, required)
    Join key of the customer_group attribute table

  - `customerGroup.customerGroupAttributes.foreignKey` (string, required)
    Foreign key of the customer_group table

  - `customerGroup.customerGroupBehaviors` (array)

  - `customerGroup.customerGroupBehaviors.name` (string, required)
    Behavior name

  - `customerGroup.customerGroupBehaviors.parentDatabaseName` (string, required)
    Database name of the customer_group behavior table

  - `customerGroup.customerGroupBehaviors.parentTableName` (string, required)
    Table name of the customer_group behavior table

  - `customerGroup.customerGroupBehaviors.parentKey` (string, required)
    Join key of the customer_group behavior table

  - `customerGroup.customerGroupBehaviors.foreignKey` (string, required)
    Foreign key of the customer_group table

  - `customerGroup.customerGroupBehaviors.schema` (array, required)
    Columns of behavior

  - `customerGroup.customerGroupBehaviors.schema.name` (string, required)
    Column name

  - `customerGroup.customerGroupBehaviors.schema.type` (string, required)
    Type of the column
    Enum: same as `attributes.type` (7 values)

  - `customerGroup.customerGroupBehaviors.schema.parentColumn` (string, required)
    Column name of the customer_group behavior table

  - `audienceFilters` (array)

  - `audienceFilters.columnName` (string, required)
    Column name to filter source data
    Example: "Country"

  - `audienceFilters.rightValues` (array, required)
    Values of the column to filter source data
    Example: ["Japan"]

  - `createdAt` (string)

  - `updatedAt` (string)

  - `createdBy` (object)

  - `createdBy.id` (string)

  - `createdBy.td_user_id` (string)

  - `createdBy.name` (string)

  - `updatedBy` (object)

## Response 400 fields (application/json):

  - `code` (string, required)

  - `message` (string, required)

## Response 5XX fields (application/json):

  - `status` (integer, required)
    Error status

  - `error` (string, required)
    Error message

  - `details` (string)
    Detailed error message


