# Parent Segment Configurations

Defining a data model for customer data is done by defining parent segments. Parent segments give you an ability to build a single view of a customer, including capturing all interactions, such as attributes and behaviors associated with your brand. In parent segments, you unify your customer data. When the customer data is unified, you can create customer segments without writing any SQL queries. You can personalize customer communications and conversations of any size and in any channel.<br> <br> <br>_Treasure Data is making an effort to use more inclusive language in its product, content, and customer solutions. As we gradually make the move to replace insensitive language beginning in our UI, you may continue to see parent segments in the UI, for example, referenced as master segment in portions of Treasure Data APIs._

## Retrieve list of parent segment configurations

 - [GET /audiences](https://docs.treasure.ai/apis/td_cdp_api-public/parent-segment-configurations/audiences_index.md): Retrieve a list of parent segment configurations by name. You can get the parent segment's schedules, created_by, the parent database name and tables, its attributes and behaviors, as well as the population for the retrieved Parent Segment.

## Create new parent segment configuration

 - [POST /audiences](https://docs.treasure.ai/apis/td_cdp_api-public/parent-segment-configurations/audiences_create.md): Create a new parent segment configuration.

## Retrieve parent segment configuration by ID

 - [GET /audiences/{audienceId}](https://docs.treasure.ai/apis/td_cdp_api-public/parent-segment-configurations/audiences_show.md): Search and find a specified parent segment configuration by its identifier.

## Update parent segment configuration

 - [PUT /audiences/{audienceId}](https://docs.treasure.ai/apis/td_cdp_api-public/parent-segment-configurations/audiences_update.md): 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.

## Delete parent segment configuration

 - [DELETE /audiences/{audienceId}](https://docs.treasure.ai/apis/td_cdp_api-public/parent-segment-configurations/audiences_delete.md): Delete a previously created parent segment configuration.

## Retrieve list of audience attributes

 - [GET /audiences/{audienceId}/attributes](https://docs.treasure.ai/apis/td_cdp_api-public/parent-segment-configurations/audience_attributes_index.md): Retrieve a list of parent segment attributes. You can also specify the visibility level for sensitive attributes.

## Retrieve list of audience behaviors

 - [GET /audiences/{audienceId}/behaviors](https://docs.treasure.ai/apis/td_cdp_api-public/parent-segment-configurations/audience_behaviors_index.md): Retrieve a list of parent segment behaviors.

## Run workflow to (re)generate parent segment

 - [POST /audiences/{audienceId}/run](https://docs.treasure.ai/apis/td_cdp_api-public/parent-segment-configurations/audiences_run.md): Run the workflow to generate or regenerate a parent segment.

## Retrieve list of executions using audienceId

 - [GET /audiences/{audienceId}/executions](https://docs.treasure.ai/apis/td_cdp_api-public/parent-segment-configurations/audiences_executions.md): Retrieve a list of workflow executions, whether they were succesful or not, and their status.

## Retrieve population statistics audience

 - [GET /audiences/{audienceId}/statistics](https://docs.treasure.ai/apis/td_cdp_api-public/parent-segment-configurations/audiences_statistics.md): Retrieve the population history of the audience. The history is returned per day and those days are calculated in the timezone of the audience.

## Retrieve list of values for a parent segment configuration's attribute

 - [GET /audiences/{audienceId}/sample_values](https://docs.treasure.ai/apis/td_cdp_api-public/parent-segment-configurations/audiences_sample_values.md): Retrieve a list of sample values associated with the attributes of a parent segment configuration.

## Retrieve list of sample values for a parent segment configuration's behavior

 - [GET /audiences/{audienceId}/behaviors/{audienceBehaviorId}/sample_values](https://docs.treasure.ai/apis/td_cdp_api-public/parent-segment-configurations/audiences_behaviors_sample_values.md): Retrieve a list of sample values for a parent segment's behavior that are useful in understanding data syntax or patterns for further analysis or activation.

