> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/api-reference/datamart-management/audience-features.md).

# Audience Features

Operations related to **Audience Features**, the pre-created parameterized OTQL query templates that transform into user-friendly selectors in the Standard Segment Builder. They enable business users to build segments using **business terminology** instead of complex OTQL syntax, with parameters like date ranges, categories, and custom values that can be searched by final value.

Relevant documentation:

* [Audience features](https://developer.mediarithmics.io/advanced-usages/audiences/audience-features)
* [Audience features](https://userguides.mediarithmics.io/audience/segment-builders/standard-segment-builder/how-to-configure-your-standard-segment-builder/audience-features)

## GET /datamarts/{datamart\_id}/audience\_features

> Fetch audience features

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Audience Features","description":"Operations related to **Audience Features**, the pre-created parameterized OTQL query templates that transform into user-friendly selectors in the Standard Segment Builder. They enable business users to build segments using **business terminology** instead of complex OTQL syntax, with parameters like date ranges, categories, and custom values that can be searched by final value.\n\nRelevant documentation:\n- [Audience features](https://developer.mediarithmics.io/advanced-usages/audiences/audience-features)\n- [Audience features](https://userguides.mediarithmics.io/audience/segment-builders/standard-segment-builder/how-to-configure-your-standard-segment-builder/audience-features)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/audience_features":{"get":{"description":"","tags":["Audience Features"],"operationId":"getAudienceFeatures","parameters":[{"explode":false,"name":"datamart_id","style":"simple","required":true,"in":"path","schema":{"type":"string"}},{"schema":{"type":"string"},"style":"form","explode":true,"in":"query","required":false,"name":"name","description":"The name of the audience feature"},{"required":false,"style":"form","in":"query","name":"token","explode":true,"description":"The token of the audience feature","schema":{"type":"string"}},{"style":"form","explode":true,"name":"addressable_object","required":false,"in":"query","description":"The addressable object of the audience feature","schema":{"type":"string"}},{"schema":{"type":"string"},"explode":true,"name":"object_tree_expression","description":"The object tree expression of the audience feature","in":"query","style":"form","required":false},{"explode":true,"schema":{"type":"string"},"in":"query","required":false,"name":"description","description":"The description of the audience feature","style":"form"},{"in":"query","description":"The variables of the audience feature","schema":{"type":"array","items":{"type":"string"}},"required":false,"style":"form","explode":true,"name":"variableIds"},{"description":"The folder of the audience feature","in":"query","style":"form","name":"folder_id","explode":true,"required":false,"schema":{"type":"string"}},{"in":"query","name":"first_result","style":"form","schema":{"type":"integer","format":"int32"},"explode":true,"required":false,"description":"Offset from which the search must be performed"},{"schema":{"type":"integer","format":"int32"},"in":"query","explode":true,"description":"Number of maximum items that may be returned by this search","style":"form","required":false,"name":"max_results"},{"in":"query","schema":{"type":"array","items":{"type":"string"}},"name":"exclude","explode":true,"style":"form","required":false,"description":"Audience feature ID list to exclude"},{"explode":true,"name":"order_by","style":"form","description":"Fields used to order the result","required":false,"schema":{"type":"array","items":{"type":"string"}},"in":"query"},{"required":false,"style":"form","in":"query","name":"keywords","description":"Word contained in the audience feature name or description","explode":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"max_results":{"type":"integer"},"first_result":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/AudienceFeatureResource"}},"count":{"type":"integer"},"total":{"type":"integer"}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"summary":"Fetch audience features"}}},"components":{"schemas":{"AudienceFeatureResource":{"type":"object","properties":{"variables":{"type":"array","items":{"$ref":"#/components/schemas/AudienceFeatureVariableResource"},"readOnly":true},"addressable_object":{"type":"string","readOnly":false},"creation_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"object_tree_expression":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"folder_id":{"type":"string","readOnly":false},"description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true}},"required":["addressable_object","creation_date","datamart_id","id","name","object_tree_expression","token","variables"]},"AudienceFeatureVariableResource":{"type":"object","properties":{"reference_type":{"type":"string","readOnly":true},"values":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":false},"field_name":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"directive":{"type":"string","readOnly":false},"parameter_name":{"type":"string","readOnly":false},"audience_feature_id":{"type":"string","readOnly":false},"reference_model_type":{"type":"string","readOnly":true},"data_type":{"type":"string","readOnly":true},"container_type":{"type":"string","readOnly":true},"path":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"type":{"type":"string","readOnly":true}},"required":["audience_feature_id","datamart_id","field_name","id","parameter_name","path","type"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /datamarts/{datamart\_id}/audience\_features

> Create a audience feature

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Audience Features","description":"Operations related to **Audience Features**, the pre-created parameterized OTQL query templates that transform into user-friendly selectors in the Standard Segment Builder. They enable business users to build segments using **business terminology** instead of complex OTQL syntax, with parameters like date ranges, categories, and custom values that can be searched by final value.\n\nRelevant documentation:\n- [Audience features](https://developer.mediarithmics.io/advanced-usages/audiences/audience-features)\n- [Audience features](https://userguides.mediarithmics.io/audience/segment-builders/standard-segment-builder/how-to-configure-your-standard-segment-builder/audience-features)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/audience_features":{"post":{"description":"","operationId":"createAudienceFeature","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AudienceFeatureResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"summary":"Create a audience feature","requestBody":{"description":"The audience feature to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceFeatureResource"}}},"required":true},"tags":["Audience Features"],"parameters":[{"style":"simple","in":"path","explode":false,"schema":{"type":"string"},"name":"datamart_id","required":true}]}}},"components":{"schemas":{"AudienceFeatureResource":{"type":"object","properties":{"variables":{"type":"array","items":{"$ref":"#/components/schemas/AudienceFeatureVariableResource"},"readOnly":true},"addressable_object":{"type":"string","readOnly":false},"creation_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"object_tree_expression":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"folder_id":{"type":"string","readOnly":false},"description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true}},"required":["addressable_object","creation_date","datamart_id","id","name","object_tree_expression","token","variables"]},"AudienceFeatureVariableResource":{"type":"object","properties":{"reference_type":{"type":"string","readOnly":true},"values":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":false},"field_name":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"directive":{"type":"string","readOnly":false},"parameter_name":{"type":"string","readOnly":false},"audience_feature_id":{"type":"string","readOnly":false},"reference_model_type":{"type":"string","readOnly":true},"data_type":{"type":"string","readOnly":true},"container_type":{"type":"string","readOnly":true},"path":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"type":{"type":"string","readOnly":true}},"required":["audience_feature_id","datamart_id","field_name","id","parameter_name","path","type"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /datamarts/{datamart\_id}/audience\_features/{audience\_feature\_id}

> Fetch an audience feature

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Audience Features","description":"Operations related to **Audience Features**, the pre-created parameterized OTQL query templates that transform into user-friendly selectors in the Standard Segment Builder. They enable business users to build segments using **business terminology** instead of complex OTQL syntax, with parameters like date ranges, categories, and custom values that can be searched by final value.\n\nRelevant documentation:\n- [Audience features](https://developer.mediarithmics.io/advanced-usages/audiences/audience-features)\n- [Audience features](https://userguides.mediarithmics.io/audience/segment-builders/standard-segment-builder/how-to-configure-your-standard-segment-builder/audience-features)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/audience_features/{audience_feature_id}":{"get":{"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AudienceFeatureResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"description":"","tags":["Audience Features"],"summary":"Fetch an audience feature","parameters":[{"name":"datamart_id","required":true,"style":"simple","schema":{"type":"string"},"explode":false,"in":"path"},{"schema":{"type":"string"},"explode":false,"in":"path","required":true,"style":"simple","name":"audience_feature_id"},{"style":"form","explode":true,"required":false,"in":"query","schema":{"type":"string"},"name":"name","description":"The name of the audience feature"},{"description":"The token of the audience feature","in":"query","explode":true,"name":"token","schema":{"type":"string"},"required":false,"style":"form"},{"schema":{"type":"string"},"description":"The addressable object of the audience feature","in":"query","required":false,"explode":true,"name":"addressable_object","style":"form"},{"schema":{"type":"string"},"name":"object_tree_expression","style":"form","explode":true,"required":false,"description":"The object tree expression of the audience feature","in":"query"},{"required":false,"name":"description","explode":true,"description":"The description of the audience feature","style":"form","in":"query","schema":{"type":"string"}},{"in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"The variables of the audience feature","name":"variableIds","explode":true,"style":"form"}],"operationId":"getAudienceFeature"}}},"components":{"schemas":{"AudienceFeatureResource":{"type":"object","properties":{"variables":{"type":"array","items":{"$ref":"#/components/schemas/AudienceFeatureVariableResource"},"readOnly":true},"addressable_object":{"type":"string","readOnly":false},"creation_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"object_tree_expression":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"folder_id":{"type":"string","readOnly":false},"description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true}},"required":["addressable_object","creation_date","datamart_id","id","name","object_tree_expression","token","variables"]},"AudienceFeatureVariableResource":{"type":"object","properties":{"reference_type":{"type":"string","readOnly":true},"values":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":false},"field_name":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"directive":{"type":"string","readOnly":false},"parameter_name":{"type":"string","readOnly":false},"audience_feature_id":{"type":"string","readOnly":false},"reference_model_type":{"type":"string","readOnly":true},"data_type":{"type":"string","readOnly":true},"container_type":{"type":"string","readOnly":true},"path":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"type":{"type":"string","readOnly":true}},"required":["audience_feature_id","datamart_id","field_name","id","parameter_name","path","type"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## PUT /datamarts/{datamart\_id}/audience\_features/{audience\_feature\_id}

> Update an audience feature

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Audience Features","description":"Operations related to **Audience Features**, the pre-created parameterized OTQL query templates that transform into user-friendly selectors in the Standard Segment Builder. They enable business users to build segments using **business terminology** instead of complex OTQL syntax, with parameters like date ranges, categories, and custom values that can be searched by final value.\n\nRelevant documentation:\n- [Audience features](https://developer.mediarithmics.io/advanced-usages/audiences/audience-features)\n- [Audience features](https://userguides.mediarithmics.io/audience/segment-builders/standard-segment-builder/how-to-configure-your-standard-segment-builder/audience-features)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/audience_features/{audience_feature_id}":{"put":{"tags":["Audience Features"],"operationId":"updateAudienceFeature","requestBody":{"description":"The audience feature to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceFeatureResource"}}},"required":true},"description":"","parameters":[{"name":"datamart_id","schema":{"type":"string"},"in":"path","required":true,"explode":false,"style":"simple"},{"name":"audience_feature_id","in":"path","schema":{"type":"string"},"explode":false,"style":"simple","required":true}],"summary":"Update an audience feature","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AudienceFeatureResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"schemas":{"AudienceFeatureResource":{"type":"object","properties":{"variables":{"type":"array","items":{"$ref":"#/components/schemas/AudienceFeatureVariableResource"},"readOnly":true},"addressable_object":{"type":"string","readOnly":false},"creation_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"object_tree_expression":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"folder_id":{"type":"string","readOnly":false},"description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true}},"required":["addressable_object","creation_date","datamart_id","id","name","object_tree_expression","token","variables"]},"AudienceFeatureVariableResource":{"type":"object","properties":{"reference_type":{"type":"string","readOnly":true},"values":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":false},"field_name":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"directive":{"type":"string","readOnly":false},"parameter_name":{"type":"string","readOnly":false},"audience_feature_id":{"type":"string","readOnly":false},"reference_model_type":{"type":"string","readOnly":true},"data_type":{"type":"string","readOnly":true},"container_type":{"type":"string","readOnly":true},"path":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"type":{"type":"string","readOnly":true}},"required":["audience_feature_id","datamart_id","field_name","id","parameter_name","path","type"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## DELETE /datamarts/{datamart\_id}/audience\_features/{audience\_feature\_id}

> Delete a audience feature

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Audience Features","description":"Operations related to **Audience Features**, the pre-created parameterized OTQL query templates that transform into user-friendly selectors in the Standard Segment Builder. They enable business users to build segments using **business terminology** instead of complex OTQL syntax, with parameters like date ranges, categories, and custom values that can be searched by final value.\n\nRelevant documentation:\n- [Audience features](https://developer.mediarithmics.io/advanced-usages/audiences/audience-features)\n- [Audience features](https://userguides.mediarithmics.io/audience/segment-builders/standard-segment-builder/how-to-configure-your-standard-segment-builder/audience-features)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/audience_features/{audience_feature_id}":{"delete":{"tags":["Audience Features"],"operationId":"deleteAudienceFeature","summary":"Delete a audience feature","responses":{"200":{"$ref":"#/components/responses/simple"},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"datamart_id","style":"simple","explode":false,"required":true},{"explode":false,"schema":{"type":"string"},"name":"audience_feature_id","required":true,"in":"path","style":"simple"}],"description":""}}},"components":{"responses":{"simple":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"]}}}},"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}},"schemas":{"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}}}}
```

## GET /datamarts/{datamart\_id}/audience\_features/extract\_variables

> Deprecated, use POST instead -- Parse an object tree expression and return the audience feature variables

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Audience Features","description":"Operations related to **Audience Features**, the pre-created parameterized OTQL query templates that transform into user-friendly selectors in the Standard Segment Builder. They enable business users to build segments using **business terminology** instead of complex OTQL syntax, with parameters like date ranges, categories, and custom values that can be searched by final value.\n\nRelevant documentation:\n- [Audience features](https://developer.mediarithmics.io/advanced-usages/audiences/audience-features)\n- [Audience features](https://userguides.mediarithmics.io/audience/segment-builders/standard-segment-builder/how-to-configure-your-standard-segment-builder/audience-features)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/audience_features/extract_variables":{"get":{"summary":"Deprecated, use POST instead -- Parse an object tree expression and return the audience feature variables","description":"","tags":["Audience Features"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"max_results":{"type":"integer"},"total":{"type":"integer"},"first_result":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/AudienceFeatureVariableResource"}},"count":{"type":"integer"},"status":{"type":"string","enum":["ok"]}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"operationId":"legacyParseAndValidateObjectTreeExpression","parameters":[{"required":true,"style":"simple","explode":false,"in":"path","schema":{"type":"string"},"name":"datamart_id"},{"explode":true,"name":"addressable_object","required":false,"style":"form","schema":{"type":"string"},"in":"query","description":"The addressable object"},{"schema":{"type":"string"},"explode":true,"in":"query","style":"form","name":"object_tree_expression","required":true,"description":"The object tree expression"}]}}},"components":{"schemas":{"AudienceFeatureVariableResource":{"type":"object","properties":{"reference_type":{"type":"string","readOnly":true},"values":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":false},"field_name":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"directive":{"type":"string","readOnly":false},"parameter_name":{"type":"string","readOnly":false},"audience_feature_id":{"type":"string","readOnly":false},"reference_model_type":{"type":"string","readOnly":true},"data_type":{"type":"string","readOnly":true},"container_type":{"type":"string","readOnly":true},"path":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"type":{"type":"string","readOnly":true}},"required":["audience_feature_id","datamart_id","field_name","id","parameter_name","path","type"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /datamarts/{datamart\_id}/audience\_features/extract\_variables

> Parse an object tree expression and return the audience feature variables

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Audience Features","description":"Operations related to **Audience Features**, the pre-created parameterized OTQL query templates that transform into user-friendly selectors in the Standard Segment Builder. They enable business users to build segments using **business terminology** instead of complex OTQL syntax, with parameters like date ranges, categories, and custom values that can be searched by final value.\n\nRelevant documentation:\n- [Audience features](https://developer.mediarithmics.io/advanced-usages/audiences/audience-features)\n- [Audience features](https://userguides.mediarithmics.io/audience/segment-builders/standard-segment-builder/how-to-configure-your-standard-segment-builder/audience-features)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/audience_features/extract_variables":{"post":{"operationId":"parseAndValidateObjectTreeExpression","summary":"Parse an object tree expression and return the audience feature variables","description":"","parameters":[{"explode":false,"required":true,"schema":{"type":"string"},"in":"path","style":"simple","name":"datamart_id"}],"requestBody":{"description":"The object tree expression to parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceFeatureObjectTreeExpressionResource"}}},"required":true},"tags":["Audience Features"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"max_results":{"type":"integer"},"count":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/AudienceFeatureVariableResource"}},"first_result":{"type":"integer"}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"schemas":{"AudienceFeatureObjectTreeExpressionResource":{"type":"object","properties":{"addressable_object":{"type":"string","readOnly":false},"object_tree_expression":{"type":"string","readOnly":false}},"required":["object_tree_expression"]},"AudienceFeatureVariableResource":{"type":"object","properties":{"reference_type":{"type":"string","readOnly":true},"values":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":false},"field_name":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"directive":{"type":"string","readOnly":false},"parameter_name":{"type":"string","readOnly":false},"audience_feature_id":{"type":"string","readOnly":false},"reference_model_type":{"type":"string","readOnly":true},"data_type":{"type":"string","readOnly":true},"container_type":{"type":"string","readOnly":true},"path":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"type":{"type":"string","readOnly":true}},"required":["audience_feature_id","datamart_id","field_name","id","parameter_name","path","type"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /datamarts/{datamart\_id}/audience\_features/search

> Fetch audience features search

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Audience Features","description":"Operations related to **Audience Features**, the pre-created parameterized OTQL query templates that transform into user-friendly selectors in the Standard Segment Builder. They enable business users to build segments using **business terminology** instead of complex OTQL syntax, with parameters like date ranges, categories, and custom values that can be searched by final value.\n\nRelevant documentation:\n- [Audience features](https://developer.mediarithmics.io/advanced-usages/audiences/audience-features)\n- [Audience features](https://userguides.mediarithmics.io/audience/segment-builders/standard-segment-builder/how-to-configure-your-standard-segment-builder/audience-features)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/audience_features/search":{"get":{"parameters":[{"explode":false,"style":"simple","name":"datamart_id","schema":{"type":"string"},"in":"path","required":true},{"schema":{"type":"string"},"explode":true,"required":false,"name":"name","style":"form","description":"The name of the audience feature","in":"query"},{"name":"token","in":"query","schema":{"type":"string"},"style":"form","description":"The token of the audience feature","explode":true,"required":false},{"style":"form","required":false,"explode":true,"in":"query","name":"addressable_object","description":"The addressable object of the audience feature","schema":{"type":"string"}},{"explode":true,"name":"object_tree_expression","description":"The object tree expression of the audience feature","style":"form","schema":{"type":"string"},"required":false,"in":"query"},{"required":false,"schema":{"type":"string"},"in":"query","explode":true,"name":"description","style":"form","description":"The description of the audience feature"},{"schema":{"type":"array","items":{"type":"string"}},"in":"query","description":"The variables of the audience feature","style":"form","required":false,"name":"variableIds","explode":true},{"style":"form","name":"folder_id","explode":true,"in":"query","required":false,"description":"The folder of the audience feature","schema":{"type":"string"}},{"description":"Offset from which the search must be performed","name":"first_result","explode":true,"style":"form","schema":{"type":"integer","format":"int32"},"required":false,"in":"query"},{"in":"query","name":"max_results","style":"form","explode":true,"description":"Number of maximum items that may be returned by this search","schema":{"type":"integer","format":"int32"},"required":false},{"name":"exclude","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Audience feature ID list to exclude","explode":true,"style":"form"},{"style":"form","required":false,"description":"Fields used to order the result","name":"order_by","explode":true,"schema":{"type":"array","items":{"type":"string"}},"in":"query"},{"name":"keywords","style":"form","required":false,"explode":true,"in":"query","schema":{"type":"string"},"description":"Word contained in the audience feature name or description"},{"description":"Word contained in values that be taken by a variable of the audience feature (treated with a logical OR)","style":"form","explode":true,"required":false,"name":"values","schema":{"type":"string"},"in":"query"}],"description":"","tags":["Audience Features"],"summary":"Fetch audience features search","operationId":"getAudienceFeaturesSearch","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AudienceFeatureSearchResponseResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"schemas":{"AudienceFeatureSearchResponseResource":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AudienceFeaturePagedResultResource"},"infos":{"type":"array","items":{"$ref":"#/components/schemas/AudienceFeatureSearchContextInfoResource"},"readOnly":false}},"required":["data","infos"]},"AudienceFeaturePagedResultResource":{"type":"object","properties":{"elements":{"type":"array","items":{"$ref":"#/components/schemas/AudienceFeatureResource"},"readOnly":false},"limit":{"type":"integer","format":"int32","default":0,"readOnly":false},"offset":{"type":"integer","format":"int32","default":0,"readOnly":false},"total_results":{"type":"integer","format":"int64","default":0,"readOnly":false}},"required":["elements","limit","offset","total_results"]},"AudienceFeatureResource":{"type":"object","properties":{"variables":{"type":"array","items":{"$ref":"#/components/schemas/AudienceFeatureVariableResource"},"readOnly":true},"addressable_object":{"type":"string","readOnly":false},"creation_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"object_tree_expression":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"folder_id":{"type":"string","readOnly":false},"description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true}},"required":["addressable_object","creation_date","datamart_id","id","name","object_tree_expression","token","variables"]},"AudienceFeatureVariableResource":{"type":"object","properties":{"reference_type":{"type":"string","readOnly":true},"values":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":false},"field_name":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"directive":{"type":"string","readOnly":false},"parameter_name":{"type":"string","readOnly":false},"audience_feature_id":{"type":"string","readOnly":false},"reference_model_type":{"type":"string","readOnly":true},"data_type":{"type":"string","readOnly":true},"container_type":{"type":"string","readOnly":true},"path":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"type":{"type":"string","readOnly":true}},"required":["audience_feature_id","datamart_id","field_name","id","parameter_name","path","type"]},"AudienceFeatureSearchContextInfoResource":{"type":"object","properties":{"info_name":{"type":"string","readOnly":false},"info_value":{"type":"string","readOnly":false}},"required":["info_name","info_value"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /datamarts/{datamart\_id}/audience\_features/{audience\_feature\_id}/segments\_mapping

> Get an audience feature segments mapping

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Audience Features","description":"Operations related to **Audience Features**, the pre-created parameterized OTQL query templates that transform into user-friendly selectors in the Standard Segment Builder. They enable business users to build segments using **business terminology** instead of complex OTQL syntax, with parameters like date ranges, categories, and custom values that can be searched by final value.\n\nRelevant documentation:\n- [Audience features](https://developer.mediarithmics.io/advanced-usages/audiences/audience-features)\n- [Audience features](https://userguides.mediarithmics.io/audience/segment-builders/standard-segment-builder/how-to-configure-your-standard-segment-builder/audience-features)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/audience_features/{audience_feature_id}/segments_mapping":{"get":{"description":"","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AudienceFeatureSegmentsMappingResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"parameters":[{"schema":{"type":"string"},"explode":false,"style":"simple","name":"datamart_id","in":"path","required":true},{"explode":false,"style":"simple","in":"path","required":true,"name":"audience_feature_id","schema":{"type":"string"}}],"operationId":"getAudienceFeatureSegmentsMapping","tags":["Audience Features"],"summary":"Get an audience feature segments mapping"}}},"components":{"schemas":{"AudienceFeatureSegmentsMappingResource":{"type":"object","properties":{"audience_feature_id":{"type":"string","readOnly":true},"segments_ids":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":true}},"required":["audience_feature_id","segments_ids"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/api-reference/datamart-management/audience-features.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
