> 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-segment-and-feed-operations/segments.md).

# Segments

Operations related to **Segments**, the groups of UserPoints who share common characteristics, behaviors, or interests. Supports multiple types:

* **User Query** (OTQL-based)
* **Edge** (client-side evaluation)
* **User List** (static import)
* **User Partition** (random distribution for A/B testing)
* **User Lookalike** (ML-generated expansion)
* **User Activation** (campaign interaction tracking)
* **User Pixel** (pixel-based collection)

Relevant documentation:

* [Segments](https://userguides.mediarithmics.io/audience/segments)

## GET /audience\_segments/{segment\_id}

> Get audience segment

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Segments","description":"Operations related to **Segments**, the groups of UserPoints who share common characteristics, behaviors, or interests. Supports multiple types:\n- **User Query** (OTQL-based)\n- **Edge** (client-side evaluation)\n- **User List** (static import)\n- **User Partition** (random distribution for A/B testing)\n- **User Lookalike** (ML-generated expansion)\n- **User Activation** (campaign interaction tracking)\n- **User Pixel** (pixel-based collection)\n\nRelevant documentation:\n- [Segments](https://userguides.mediarithmics.io/audience/segments)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/audience_segments/{segment_id}":{"get":{"operationId":"getAudienceSegment","description":"","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AudienceSegmentResource"}},"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"}},"tags":["Segments"],"parameters":[{"explode":false,"name":"segment_id","style":"simple","schema":{"type":"string"},"in":"path","required":true}],"summary":"Get audience segment"}}},"components":{"schemas":{"AudienceSegmentResource":{"discriminator":{"propertyName":"type","mapping":{"CLEAN_ROOM":"#/components/schemas/CleanRoomAudienceSegmentResource","USER_LIST":"#/components/schemas/UserListSegmentResource","USER_LOOKALIKE":"#/components/schemas/UserLookalikePartitionBasedSegmentResource","USER_ACTIVATION":"#/components/schemas/UserActivationSegmentResource","USER_QUERY":"#/components/schemas/UserQuerySegmentResource","USER_LOOKALIKE_BY_COHORTS":"#/components/schemas/UserLookalikeCohortBasedSegmentResource","USER_DATA_SUBSCRIPTION":"#/components/schemas/UserDataSubscriptionSegmentResource","USER_PARTITION":"#/components/schemas/UserPartitionSegmentResource"}},"oneOf":[{"$ref":"#/components/schemas/UserDataSubscriptionSegmentResource"},{"$ref":"#/components/schemas/UserActivationSegmentResource"},{"$ref":"#/components/schemas/UserQuerySegmentResource"},{"$ref":"#/components/schemas/UserPartitionSegmentResource"},{"$ref":"#/components/schemas/UserLookalikeCohortBasedSegmentResource"},{"$ref":"#/components/schemas/UserListSegmentResource"},{"$ref":"#/components/schemas/CleanRoomAudienceSegmentResource"},{"$ref":"#/components/schemas/UserLookalikePartitionBasedSegmentResource"}],"properties":{"type":{"type":"string","enum":["USER_DATA_SUBSCRIPTION","USER_ACTIVATION","USER_QUERY","USER_PARTITION","USER_LOOKALIKE_BY_COHORTS","USER_LIST","CLEAN_ROOM","USER_LOOKALIKE"]}},"required":["type"]},"UserDataSubscriptionSegmentResource":{"type":"object","properties":{"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"origin_segment_id":{"type":"integer","format":"int64","default":0,"readOnly":false},"technical_name":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"name":{"type":"string","readOnly":false},"short_description":{"type":"string","readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","name","organisation_id","origin_segment_id","paused","persisted","provider_name","short_description","technical_name","token"]},"Duration":{"type":"number","description":"a length of time in milliseconds"},"AudienceMetricResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"display_name":{"type":"string","readOnly":true},"count":{"type":"integer","format":"int64","default":0,"readOnly":true},"count_last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["display_name","id"]},"AudienceSegmentEvaluationMode":{"type":"string","enum":["REAL_TIME","AUTOMATIC","ON_DEMAND","LIVE","PERIODIC"],"readOnly":false},"UserActivationSegmentResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"campaign_id":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"scenario_id":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"exposed":{"type":"boolean","default":false,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"token":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"provider_name":{"type":"string","readOnly":false},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":true},"clickers":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_metrics","auto_description","campaign_id","clickers","creation_ts","datamart_id","evaluation_mode","exposed","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","scenario_id","short_description","technical_name","token"]},"UserQuerySegmentResource":{"allOf":[{"$ref":"#/components/schemas/QuerySegmentResource"},{"type":"object","properties":{"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"segment_editor":{"$ref":"#/components/schemas/UserQuerySegmentEditor"},"weight":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"token":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"stats_query_precision_override":{"$ref":"#/components/schemas/QueryPrecisionMode1"},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"target_metric":{"$ref":"#/components/schemas/ABTestingExperimentTargetMetric"},"subtype":{"$ref":"#/components/schemas/UserQuerySubtype"},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"technical_name":{"type":"string","readOnly":false},"evaluation_period":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"provider_name":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"evaluation_period_unit":{"$ref":"#/components/schemas/UserQueryEvaluationPeriodUnit"},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"control_group_id":{"type":"string","readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","evaluation_period","evaluation_period_unit","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","query_id","segment_editor","short_description","subtype","technical_name","token"]}]},"QuerySegmentResource":{"type":"object"},"UserQuerySegmentEditor":{"type":"string","enum":["ADVANCED_SEGMENT_BUILDER","STANDARD_SEGMENT_BUILDER"],"readOnly":false},"QueryPrecisionMode1":{"type":"string","enum":["LOW_PRECISION","MEDIUM_PRECISION","FULL_PRECISION"],"readOnly":false},"ABTestingExperimentTargetMetric":{"type":"string","enum":["E_COMMERCE_ENGAGEMENT","CHANNEL_ENGAGEMENT"],"readOnly":false},"UserQuerySubtype":{"type":"string","enum":["STANDARD","AB_TESTING_CONTROL_GROUP","AB_TESTING_EXPERIMENT","UPLIFT_CONTROL_GROUP","UPLIFT_EXPERIMENT","EXPERIMENT_GROUP"],"readOnly":false},"UserQueryEvaluationPeriodUnit":{"type":"string","enum":["HOUR","DAY","WEEK","MONTH"],"readOnly":false},"UserPartitionSegmentResource":{"type":"object","properties":{"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"persisted":{"type":"boolean","default":false,"readOnly":false},"organisation_id":{"type":"string","readOnly":false},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_partition_id":{"type":"string","readOnly":false},"auto_description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"token":{"type":"string","readOnly":true},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"part_number":{"type":"integer","format":"int32","default":0,"readOnly":false},"short_description":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true}},"required":["audience_metrics","audience_partition_id","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","name","organisation_id","part_number","paused","persisted","provider_name","short_description","technical_name","token"]},"UserLookalikeCohortBasedSegmentResource":{"allOf":[{"$ref":"#/components/schemas/UserLookalikeSegmentResource"},{"type":"object","properties":{"token":{"type":"string","readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"source_segment_id":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"user_points_target":{"type":"integer","format":"int32","default":0,"readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":false},"provider_name":{"type":"string","readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"lookalike_algorithm":{"$ref":"#/components/schemas/AudienceLookalikeAlgorithm"},"datamart_id":{"type":"string","readOnly":false},"include_seed_segment":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/AudienceLookalikeStatus"},"auto_description":{"type":"string","readOnly":false},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"similarity_index":{"type":"number","format":"float","default":0,"readOnly":false},"min_overlap":{"type":"number","format":"float","default":0,"readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","id","include_seed_segment","last_modified_ts","lookalike_algorithm","name","organisation_id","paused","persisted","provider_name","query_id","short_description","source_segment_id","status","technical_name","token"]}]},"UserLookalikeSegmentResource":{"allOf":[{"$ref":"#/components/schemas/QuerySegmentResource"},{"type":"object"}]},"AudienceLookalikeAlgorithm":{"type":"string","enum":["CLUSTER_OVERLAP","FIELD_SCORE","MULTI_VARIATE_DISTANCE","COHORT_OVERLAP"],"readOnly":false},"AudienceLookalikeStatus":{"type":"string","enum":["DRAFT","CALIBRATING","CALIBRATION_ERROR","CALIBRATED","DEFINITION_ERROR"],"readOnly":false},"UserListSegmentResource":{"type":"object","properties":{"short_description":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"desktop_cookie_ids_count":{"default":0,"readOnly":false,"format":"int32","type":"integer"},"name":{"type":"string","readOnly":false},"subtype":{"$ref":"#/components/schemas/UserListSubtype"},"auto_description":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"user_accounts_count":{"format":"int32","readOnly":false,"type":"integer","default":0},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"emails_count":{"format":"int32","readOnly":false,"type":"integer","default":0},"datamart_id":{"type":"string","readOnly":false},"standard_segment_builder_id":{"type":"string","readOnly":false},"feed_type":{"$ref":"#/components/schemas/UserListFeedType"},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"query_id":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_points_count":{"readOnly":false,"default":0,"format":"int32","type":"integer"},"provider_name":{"type":"string","readOnly":false},"persisted":{"type":"boolean","default":false,"readOnly":false},"token":{"type":"string","readOnly":true},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","feed_type","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","query_id","short_description","subtype","technical_name","token"]},"UserListSubtype":{"type":"string","enum":["STANDARD","USER_PIXEL","EDGE","EXPERIMENT_GROUP"],"readOnly":false},"UserListFeedType":{"type":"string","enum":["FILE_IMPORT","TAG","SCENARIO","SCENARIO_FEED"],"readOnly":false},"CleanRoomAudienceSegmentResource":{"type":"object","properties":{"from_dataset_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"clean_room_id":{"type":"string","readOnly":false},"short_description":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"datasets_matching_id":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"to_dataset_id":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":false},"datasets_matching_selection":{"$ref":"#/components/schemas/CleanRoomSegmentDatasetsMatchingSelection"},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["clean_room_id","creation_ts","datamart_id","datasets_matching_id","datasets_matching_selection","from_dataset_id","id","last_modified_ts","name","organisation_id","short_description","technical_name","to_dataset_id","token"]},"CleanRoomSegmentDatasetsMatchingSelection":{"type":"string","enum":["COMMON","EXCLUSIVE"],"readOnly":false},"UserLookalikePartitionBasedSegmentResource":{"allOf":[{"$ref":"#/components/schemas/UserLookalikeSegmentResource"},{"type":"object","properties":{"minimum_score":{"type":"number","format":"float","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"persisted":{"type":"boolean","default":false,"readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"source_segment_id":{"type":"string","readOnly":false},"query_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"status":{"$ref":"#/components/schemas/AudienceLookalikeStatus"},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"short_description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"lookalike_algorithm":{"$ref":"#/components/schemas/AudienceLookalikeAlgorithm"},"extension_factor":{"type":"number","format":"float","default":0,"readOnly":false},"token":{"type":"string","readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_partition_id":{"type":"string","readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","audience_partition_id","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","lookalike_algorithm","name","organisation_id","paused","persisted","provider_name","query_id","short_description","source_segment_id","status","technical_name","token"]}]},"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 /audience\_segments/{segment\_id}

> Update audience segment

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Segments","description":"Operations related to **Segments**, the groups of UserPoints who share common characteristics, behaviors, or interests. Supports multiple types:\n- **User Query** (OTQL-based)\n- **Edge** (client-side evaluation)\n- **User List** (static import)\n- **User Partition** (random distribution for A/B testing)\n- **User Lookalike** (ML-generated expansion)\n- **User Activation** (campaign interaction tracking)\n- **User Pixel** (pixel-based collection)\n\nRelevant documentation:\n- [Segments](https://userguides.mediarithmics.io/audience/segments)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/audience_segments/{segment_id}":{"put":{"operationId":"updateAudienceSegment","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AudienceSegmentResource"}},"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":"Update audience segment","parameters":[{"style":"simple","name":"segment_id","required":true,"explode":false,"schema":{"type":"string"},"in":"path"}],"tags":["Segments"],"description":"","requestBody":{"description":"Audience segment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceSegmentResource"}}},"required":true}}}},"components":{"schemas":{"AudienceSegmentResource":{"discriminator":{"propertyName":"type","mapping":{"CLEAN_ROOM":"#/components/schemas/CleanRoomAudienceSegmentResource","USER_LIST":"#/components/schemas/UserListSegmentResource","USER_LOOKALIKE":"#/components/schemas/UserLookalikePartitionBasedSegmentResource","USER_ACTIVATION":"#/components/schemas/UserActivationSegmentResource","USER_QUERY":"#/components/schemas/UserQuerySegmentResource","USER_LOOKALIKE_BY_COHORTS":"#/components/schemas/UserLookalikeCohortBasedSegmentResource","USER_DATA_SUBSCRIPTION":"#/components/schemas/UserDataSubscriptionSegmentResource","USER_PARTITION":"#/components/schemas/UserPartitionSegmentResource"}},"oneOf":[{"$ref":"#/components/schemas/UserDataSubscriptionSegmentResource"},{"$ref":"#/components/schemas/UserActivationSegmentResource"},{"$ref":"#/components/schemas/UserQuerySegmentResource"},{"$ref":"#/components/schemas/UserPartitionSegmentResource"},{"$ref":"#/components/schemas/UserLookalikeCohortBasedSegmentResource"},{"$ref":"#/components/schemas/UserListSegmentResource"},{"$ref":"#/components/schemas/CleanRoomAudienceSegmentResource"},{"$ref":"#/components/schemas/UserLookalikePartitionBasedSegmentResource"}],"properties":{"type":{"type":"string","enum":["USER_DATA_SUBSCRIPTION","USER_ACTIVATION","USER_QUERY","USER_PARTITION","USER_LOOKALIKE_BY_COHORTS","USER_LIST","CLEAN_ROOM","USER_LOOKALIKE"]}},"required":["type"]},"UserDataSubscriptionSegmentResource":{"type":"object","properties":{"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"origin_segment_id":{"type":"integer","format":"int64","default":0,"readOnly":false},"technical_name":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"name":{"type":"string","readOnly":false},"short_description":{"type":"string","readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","name","organisation_id","origin_segment_id","paused","persisted","provider_name","short_description","technical_name","token"]},"Duration":{"type":"number","description":"a length of time in milliseconds"},"AudienceMetricResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"display_name":{"type":"string","readOnly":true},"count":{"type":"integer","format":"int64","default":0,"readOnly":true},"count_last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["display_name","id"]},"AudienceSegmentEvaluationMode":{"type":"string","enum":["REAL_TIME","AUTOMATIC","ON_DEMAND","LIVE","PERIODIC"],"readOnly":false},"UserActivationSegmentResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"campaign_id":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"scenario_id":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"exposed":{"type":"boolean","default":false,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"token":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"provider_name":{"type":"string","readOnly":false},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":true},"clickers":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_metrics","auto_description","campaign_id","clickers","creation_ts","datamart_id","evaluation_mode","exposed","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","scenario_id","short_description","technical_name","token"]},"UserQuerySegmentResource":{"allOf":[{"$ref":"#/components/schemas/QuerySegmentResource"},{"type":"object","properties":{"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"segment_editor":{"$ref":"#/components/schemas/UserQuerySegmentEditor"},"weight":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"token":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"stats_query_precision_override":{"$ref":"#/components/schemas/QueryPrecisionMode1"},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"target_metric":{"$ref":"#/components/schemas/ABTestingExperimentTargetMetric"},"subtype":{"$ref":"#/components/schemas/UserQuerySubtype"},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"technical_name":{"type":"string","readOnly":false},"evaluation_period":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"provider_name":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"evaluation_period_unit":{"$ref":"#/components/schemas/UserQueryEvaluationPeriodUnit"},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"control_group_id":{"type":"string","readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","evaluation_period","evaluation_period_unit","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","query_id","segment_editor","short_description","subtype","technical_name","token"]}]},"QuerySegmentResource":{"type":"object"},"UserQuerySegmentEditor":{"type":"string","enum":["ADVANCED_SEGMENT_BUILDER","STANDARD_SEGMENT_BUILDER"],"readOnly":false},"QueryPrecisionMode1":{"type":"string","enum":["LOW_PRECISION","MEDIUM_PRECISION","FULL_PRECISION"],"readOnly":false},"ABTestingExperimentTargetMetric":{"type":"string","enum":["E_COMMERCE_ENGAGEMENT","CHANNEL_ENGAGEMENT"],"readOnly":false},"UserQuerySubtype":{"type":"string","enum":["STANDARD","AB_TESTING_CONTROL_GROUP","AB_TESTING_EXPERIMENT","UPLIFT_CONTROL_GROUP","UPLIFT_EXPERIMENT","EXPERIMENT_GROUP"],"readOnly":false},"UserQueryEvaluationPeriodUnit":{"type":"string","enum":["HOUR","DAY","WEEK","MONTH"],"readOnly":false},"UserPartitionSegmentResource":{"type":"object","properties":{"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"persisted":{"type":"boolean","default":false,"readOnly":false},"organisation_id":{"type":"string","readOnly":false},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_partition_id":{"type":"string","readOnly":false},"auto_description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"token":{"type":"string","readOnly":true},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"part_number":{"type":"integer","format":"int32","default":0,"readOnly":false},"short_description":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true}},"required":["audience_metrics","audience_partition_id","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","name","organisation_id","part_number","paused","persisted","provider_name","short_description","technical_name","token"]},"UserLookalikeCohortBasedSegmentResource":{"allOf":[{"$ref":"#/components/schemas/UserLookalikeSegmentResource"},{"type":"object","properties":{"token":{"type":"string","readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"source_segment_id":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"user_points_target":{"type":"integer","format":"int32","default":0,"readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":false},"provider_name":{"type":"string","readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"lookalike_algorithm":{"$ref":"#/components/schemas/AudienceLookalikeAlgorithm"},"datamart_id":{"type":"string","readOnly":false},"include_seed_segment":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/AudienceLookalikeStatus"},"auto_description":{"type":"string","readOnly":false},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"similarity_index":{"type":"number","format":"float","default":0,"readOnly":false},"min_overlap":{"type":"number","format":"float","default":0,"readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","id","include_seed_segment","last_modified_ts","lookalike_algorithm","name","organisation_id","paused","persisted","provider_name","query_id","short_description","source_segment_id","status","technical_name","token"]}]},"UserLookalikeSegmentResource":{"allOf":[{"$ref":"#/components/schemas/QuerySegmentResource"},{"type":"object"}]},"AudienceLookalikeAlgorithm":{"type":"string","enum":["CLUSTER_OVERLAP","FIELD_SCORE","MULTI_VARIATE_DISTANCE","COHORT_OVERLAP"],"readOnly":false},"AudienceLookalikeStatus":{"type":"string","enum":["DRAFT","CALIBRATING","CALIBRATION_ERROR","CALIBRATED","DEFINITION_ERROR"],"readOnly":false},"UserListSegmentResource":{"type":"object","properties":{"short_description":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"desktop_cookie_ids_count":{"default":0,"readOnly":false,"format":"int32","type":"integer"},"name":{"type":"string","readOnly":false},"subtype":{"$ref":"#/components/schemas/UserListSubtype"},"auto_description":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"user_accounts_count":{"format":"int32","readOnly":false,"type":"integer","default":0},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"emails_count":{"format":"int32","readOnly":false,"type":"integer","default":0},"datamart_id":{"type":"string","readOnly":false},"standard_segment_builder_id":{"type":"string","readOnly":false},"feed_type":{"$ref":"#/components/schemas/UserListFeedType"},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"query_id":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_points_count":{"readOnly":false,"default":0,"format":"int32","type":"integer"},"provider_name":{"type":"string","readOnly":false},"persisted":{"type":"boolean","default":false,"readOnly":false},"token":{"type":"string","readOnly":true},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","feed_type","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","query_id","short_description","subtype","technical_name","token"]},"UserListSubtype":{"type":"string","enum":["STANDARD","USER_PIXEL","EDGE","EXPERIMENT_GROUP"],"readOnly":false},"UserListFeedType":{"type":"string","enum":["FILE_IMPORT","TAG","SCENARIO","SCENARIO_FEED"],"readOnly":false},"CleanRoomAudienceSegmentResource":{"type":"object","properties":{"from_dataset_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"clean_room_id":{"type":"string","readOnly":false},"short_description":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"datasets_matching_id":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"to_dataset_id":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":false},"datasets_matching_selection":{"$ref":"#/components/schemas/CleanRoomSegmentDatasetsMatchingSelection"},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["clean_room_id","creation_ts","datamart_id","datasets_matching_id","datasets_matching_selection","from_dataset_id","id","last_modified_ts","name","organisation_id","short_description","technical_name","to_dataset_id","token"]},"CleanRoomSegmentDatasetsMatchingSelection":{"type":"string","enum":["COMMON","EXCLUSIVE"],"readOnly":false},"UserLookalikePartitionBasedSegmentResource":{"allOf":[{"$ref":"#/components/schemas/UserLookalikeSegmentResource"},{"type":"object","properties":{"minimum_score":{"type":"number","format":"float","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"persisted":{"type":"boolean","default":false,"readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"source_segment_id":{"type":"string","readOnly":false},"query_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"status":{"$ref":"#/components/schemas/AudienceLookalikeStatus"},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"short_description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"lookalike_algorithm":{"$ref":"#/components/schemas/AudienceLookalikeAlgorithm"},"extension_factor":{"type":"number","format":"float","default":0,"readOnly":false},"token":{"type":"string","readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_partition_id":{"type":"string","readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","audience_partition_id","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","lookalike_algorithm","name","organisation_id","paused","persisted","provider_name","query_id","short_description","source_segment_id","status","technical_name","token"]}]},"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 /audience\_segments/{segment\_id}

> Delete audience segment

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Segments","description":"Operations related to **Segments**, the groups of UserPoints who share common characteristics, behaviors, or interests. Supports multiple types:\n- **User Query** (OTQL-based)\n- **Edge** (client-side evaluation)\n- **User List** (static import)\n- **User Partition** (random distribution for A/B testing)\n- **User Lookalike** (ML-generated expansion)\n- **User Activation** (campaign interaction tracking)\n- **User Pixel** (pixel-based collection)\n\nRelevant documentation:\n- [Segments](https://userguides.mediarithmics.io/audience/segments)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/audience_segments/{segment_id}":{"delete":{"summary":"Delete audience segment","operationId":"deleteAudienceSegment","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"}},"tags":["Segments"],"parameters":[{"explode":false,"in":"path","required":true,"schema":{"type":"string"},"style":"simple","name":"segment_id"}],"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"]}}}}
```

## POST /audience\_segments/{segment\_id}/clone

> Duplicate audience segment

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Segments","description":"Operations related to **Segments**, the groups of UserPoints who share common characteristics, behaviors, or interests. Supports multiple types:\n- **User Query** (OTQL-based)\n- **Edge** (client-side evaluation)\n- **User List** (static import)\n- **User Partition** (random distribution for A/B testing)\n- **User Lookalike** (ML-generated expansion)\n- **User Activation** (campaign interaction tracking)\n- **User Pixel** (pixel-based collection)\n\nRelevant documentation:\n- [Segments](https://userguides.mediarithmics.io/audience/segments)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/audience_segments/{segment_id}/clone":{"post":{"tags":["Segments"],"operationId":"duplicateAudienceSegment","summary":"Duplicate audience segment","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceSegmentResource"}}},"required":true},"description":"","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AudienceSegmentResource"}},"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":[{"style":"simple","schema":{"type":"string"},"name":"segment_id","required":true,"in":"path","explode":false}]}}},"components":{"schemas":{"AudienceSegmentResource":{"discriminator":{"propertyName":"type","mapping":{"CLEAN_ROOM":"#/components/schemas/CleanRoomAudienceSegmentResource","USER_LIST":"#/components/schemas/UserListSegmentResource","USER_LOOKALIKE":"#/components/schemas/UserLookalikePartitionBasedSegmentResource","USER_ACTIVATION":"#/components/schemas/UserActivationSegmentResource","USER_QUERY":"#/components/schemas/UserQuerySegmentResource","USER_LOOKALIKE_BY_COHORTS":"#/components/schemas/UserLookalikeCohortBasedSegmentResource","USER_DATA_SUBSCRIPTION":"#/components/schemas/UserDataSubscriptionSegmentResource","USER_PARTITION":"#/components/schemas/UserPartitionSegmentResource"}},"oneOf":[{"$ref":"#/components/schemas/UserDataSubscriptionSegmentResource"},{"$ref":"#/components/schemas/UserActivationSegmentResource"},{"$ref":"#/components/schemas/UserQuerySegmentResource"},{"$ref":"#/components/schemas/UserPartitionSegmentResource"},{"$ref":"#/components/schemas/UserLookalikeCohortBasedSegmentResource"},{"$ref":"#/components/schemas/UserListSegmentResource"},{"$ref":"#/components/schemas/CleanRoomAudienceSegmentResource"},{"$ref":"#/components/schemas/UserLookalikePartitionBasedSegmentResource"}],"properties":{"type":{"type":"string","enum":["USER_DATA_SUBSCRIPTION","USER_ACTIVATION","USER_QUERY","USER_PARTITION","USER_LOOKALIKE_BY_COHORTS","USER_LIST","CLEAN_ROOM","USER_LOOKALIKE"]}},"required":["type"]},"UserDataSubscriptionSegmentResource":{"type":"object","properties":{"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"origin_segment_id":{"type":"integer","format":"int64","default":0,"readOnly":false},"technical_name":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"name":{"type":"string","readOnly":false},"short_description":{"type":"string","readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","name","organisation_id","origin_segment_id","paused","persisted","provider_name","short_description","technical_name","token"]},"Duration":{"type":"number","description":"a length of time in milliseconds"},"AudienceMetricResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"display_name":{"type":"string","readOnly":true},"count":{"type":"integer","format":"int64","default":0,"readOnly":true},"count_last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["display_name","id"]},"AudienceSegmentEvaluationMode":{"type":"string","enum":["REAL_TIME","AUTOMATIC","ON_DEMAND","LIVE","PERIODIC"],"readOnly":false},"UserActivationSegmentResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"campaign_id":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"scenario_id":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"exposed":{"type":"boolean","default":false,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"token":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"provider_name":{"type":"string","readOnly":false},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":true},"clickers":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_metrics","auto_description","campaign_id","clickers","creation_ts","datamart_id","evaluation_mode","exposed","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","scenario_id","short_description","technical_name","token"]},"UserQuerySegmentResource":{"allOf":[{"$ref":"#/components/schemas/QuerySegmentResource"},{"type":"object","properties":{"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"segment_editor":{"$ref":"#/components/schemas/UserQuerySegmentEditor"},"weight":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"token":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"stats_query_precision_override":{"$ref":"#/components/schemas/QueryPrecisionMode1"},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"target_metric":{"$ref":"#/components/schemas/ABTestingExperimentTargetMetric"},"subtype":{"$ref":"#/components/schemas/UserQuerySubtype"},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"technical_name":{"type":"string","readOnly":false},"evaluation_period":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"provider_name":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"evaluation_period_unit":{"$ref":"#/components/schemas/UserQueryEvaluationPeriodUnit"},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"control_group_id":{"type":"string","readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","evaluation_period","evaluation_period_unit","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","query_id","segment_editor","short_description","subtype","technical_name","token"]}]},"QuerySegmentResource":{"type":"object"},"UserQuerySegmentEditor":{"type":"string","enum":["ADVANCED_SEGMENT_BUILDER","STANDARD_SEGMENT_BUILDER"],"readOnly":false},"QueryPrecisionMode1":{"type":"string","enum":["LOW_PRECISION","MEDIUM_PRECISION","FULL_PRECISION"],"readOnly":false},"ABTestingExperimentTargetMetric":{"type":"string","enum":["E_COMMERCE_ENGAGEMENT","CHANNEL_ENGAGEMENT"],"readOnly":false},"UserQuerySubtype":{"type":"string","enum":["STANDARD","AB_TESTING_CONTROL_GROUP","AB_TESTING_EXPERIMENT","UPLIFT_CONTROL_GROUP","UPLIFT_EXPERIMENT","EXPERIMENT_GROUP"],"readOnly":false},"UserQueryEvaluationPeriodUnit":{"type":"string","enum":["HOUR","DAY","WEEK","MONTH"],"readOnly":false},"UserPartitionSegmentResource":{"type":"object","properties":{"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"persisted":{"type":"boolean","default":false,"readOnly":false},"organisation_id":{"type":"string","readOnly":false},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_partition_id":{"type":"string","readOnly":false},"auto_description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"token":{"type":"string","readOnly":true},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"part_number":{"type":"integer","format":"int32","default":0,"readOnly":false},"short_description":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true}},"required":["audience_metrics","audience_partition_id","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","name","organisation_id","part_number","paused","persisted","provider_name","short_description","technical_name","token"]},"UserLookalikeCohortBasedSegmentResource":{"allOf":[{"$ref":"#/components/schemas/UserLookalikeSegmentResource"},{"type":"object","properties":{"token":{"type":"string","readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"source_segment_id":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"user_points_target":{"type":"integer","format":"int32","default":0,"readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":false},"provider_name":{"type":"string","readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"lookalike_algorithm":{"$ref":"#/components/schemas/AudienceLookalikeAlgorithm"},"datamart_id":{"type":"string","readOnly":false},"include_seed_segment":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/AudienceLookalikeStatus"},"auto_description":{"type":"string","readOnly":false},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"similarity_index":{"type":"number","format":"float","default":0,"readOnly":false},"min_overlap":{"type":"number","format":"float","default":0,"readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","id","include_seed_segment","last_modified_ts","lookalike_algorithm","name","organisation_id","paused","persisted","provider_name","query_id","short_description","source_segment_id","status","technical_name","token"]}]},"UserLookalikeSegmentResource":{"allOf":[{"$ref":"#/components/schemas/QuerySegmentResource"},{"type":"object"}]},"AudienceLookalikeAlgorithm":{"type":"string","enum":["CLUSTER_OVERLAP","FIELD_SCORE","MULTI_VARIATE_DISTANCE","COHORT_OVERLAP"],"readOnly":false},"AudienceLookalikeStatus":{"type":"string","enum":["DRAFT","CALIBRATING","CALIBRATION_ERROR","CALIBRATED","DEFINITION_ERROR"],"readOnly":false},"UserListSegmentResource":{"type":"object","properties":{"short_description":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"desktop_cookie_ids_count":{"default":0,"readOnly":false,"format":"int32","type":"integer"},"name":{"type":"string","readOnly":false},"subtype":{"$ref":"#/components/schemas/UserListSubtype"},"auto_description":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"user_accounts_count":{"format":"int32","readOnly":false,"type":"integer","default":0},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"emails_count":{"format":"int32","readOnly":false,"type":"integer","default":0},"datamart_id":{"type":"string","readOnly":false},"standard_segment_builder_id":{"type":"string","readOnly":false},"feed_type":{"$ref":"#/components/schemas/UserListFeedType"},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"query_id":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_points_count":{"readOnly":false,"default":0,"format":"int32","type":"integer"},"provider_name":{"type":"string","readOnly":false},"persisted":{"type":"boolean","default":false,"readOnly":false},"token":{"type":"string","readOnly":true},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","feed_type","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","query_id","short_description","subtype","technical_name","token"]},"UserListSubtype":{"type":"string","enum":["STANDARD","USER_PIXEL","EDGE","EXPERIMENT_GROUP"],"readOnly":false},"UserListFeedType":{"type":"string","enum":["FILE_IMPORT","TAG","SCENARIO","SCENARIO_FEED"],"readOnly":false},"CleanRoomAudienceSegmentResource":{"type":"object","properties":{"from_dataset_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"clean_room_id":{"type":"string","readOnly":false},"short_description":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"datasets_matching_id":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"to_dataset_id":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":false},"datasets_matching_selection":{"$ref":"#/components/schemas/CleanRoomSegmentDatasetsMatchingSelection"},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["clean_room_id","creation_ts","datamart_id","datasets_matching_id","datasets_matching_selection","from_dataset_id","id","last_modified_ts","name","organisation_id","short_description","technical_name","to_dataset_id","token"]},"CleanRoomSegmentDatasetsMatchingSelection":{"type":"string","enum":["COMMON","EXCLUSIVE"],"readOnly":false},"UserLookalikePartitionBasedSegmentResource":{"allOf":[{"$ref":"#/components/schemas/UserLookalikeSegmentResource"},{"type":"object","properties":{"minimum_score":{"type":"number","format":"float","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"persisted":{"type":"boolean","default":false,"readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"source_segment_id":{"type":"string","readOnly":false},"query_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"status":{"$ref":"#/components/schemas/AudienceLookalikeStatus"},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"short_description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"lookalike_algorithm":{"$ref":"#/components/schemas/AudienceLookalikeAlgorithm"},"extension_factor":{"type":"number","format":"float","default":0,"readOnly":false},"token":{"type":"string","readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_partition_id":{"type":"string","readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","audience_partition_id","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","lookalike_algorithm","name","organisation_id","paused","persisted","provider_name","query_id","short_description","source_segment_id","status","technical_name","token"]}]},"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 /audience\_segments

> Get all audience segments

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Mediarithmics most used API","description":"These operations where flagged by mediarithmics teams as most useful."},{"name":"Segments","description":"Operations related to **Segments**, the groups of UserPoints who share common characteristics, behaviors, or interests. Supports multiple types:\n- **User Query** (OTQL-based)\n- **Edge** (client-side evaluation)\n- **User List** (static import)\n- **User Partition** (random distribution for A/B testing)\n- **User Lookalike** (ML-generated expansion)\n- **User Activation** (campaign interaction tracking)\n- **User Pixel** (pixel-based collection)\n\nRelevant documentation:\n- [Segments](https://userguides.mediarithmics.io/audience/segments)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/audience_segments":{"get":{"summary":"Get all audience segments","tags":["Segments","Mediarithmics most used API"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"max_results":{"type":"integer"},"count":{"type":"integer"},"total":{"type":"integer"},"first_result":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/AudienceSegmentResource"}}},"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"}},"description":"","operationId":"getAudienceSegments","parameters":[{"schema":{"type":"integer","format":"int64"},"explode":true,"name":"organisation_id","style":"form","in":"query","required":false},{"explode":true,"required":false,"in":"query","name":"datamart_id","schema":{"type":"integer","format":"int64"},"style":"form"},{"required":false,"in":"query","schema":{"type":"string"},"explode":true,"style":"form","name":"keywords"},{"style":"form","in":"query","required":false,"name":"name","schema":{"type":"string"},"explode":true},{"schema":{"type":"string"},"style":"form","name":"technical_name","required":false,"in":"query","explode":true},{"name":"type","schema":{"type":"array","items":{"$ref":"#/components/schemas/AudienceSegmentType"}},"explode":true,"style":"form","in":"query","required":false},{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserListFeedType"}},"name":"feed_type","style":"form","explode":true,"in":"query","required":false},{"name":"subtype","style":"form","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserListSubtype"}},"explode":true},{"name":"evaluation_mode","schema":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"in":"query","explode":true,"style":"form","required":false},{"explode":true,"schema":{"type":"array","items":{"type":"string"}},"required":false,"style":"form","name":"order_by","in":"query"},{"required":false,"explode":true,"style":"form","name":"first_result","schema":{"type":"integer","format":"int32"},"in":"query"},{"in":"query","explode":true,"name":"max_results","required":false,"schema":{"type":"integer","format":"int32"},"style":"form"},{"schema":{"type":"integer","format":"int64"},"explode":true,"in":"query","name":"campaign_id","required":false,"style":"form"},{"required":false,"name":"audience_partition_id","explode":true,"schema":{"type":"integer","format":"int64"},"style":"form","in":"query"},{"schema":{"type":"array","items":{"type":"integer","format":"int64"}},"name":"label_id","style":"form","in":"query","required":false,"explode":true},{"schema":{"type":"boolean"},"in":"query","style":"form","name":"persisted","explode":true,"required":false},{"required":false,"name":"segment_ids","in":"query","schema":{"type":"array","items":{"type":"integer","format":"int64"}},"description":"List of audience segment Ids we want to query","explode":true,"style":"form"},{"required":false,"explode":true,"schema":{"type":"integer","format":"int32"},"name":"user_points_count_le","in":"query","style":"form"},{"name":"user_points_count_ge","explode":true,"style":"form","required":false,"schema":{"type":"integer","format":"int32"},"in":"query"},{"in":"query","explode":true,"required":false,"style":"form","name":"user_accounts_count_le","schema":{"type":"integer","format":"int32"}},{"in":"query","explode":true,"required":false,"style":"form","schema":{"type":"integer","format":"int32"},"name":"user_accounts_count_ge"},{"style":"form","name":"emails_count_le","in":"query","required":false,"explode":true,"schema":{"type":"integer","format":"int32"}},{"style":"form","in":"query","schema":{"type":"integer","format":"int32"},"explode":true,"required":false,"name":"emails_count_ge"},{"style":"form","name":"desktop_cookie_ids_count_le","schema":{"type":"integer","format":"int32"},"required":false,"explode":true,"in":"query"},{"explode":true,"required":false,"style":"form","in":"query","schema":{"type":"integer","format":"int32"},"name":"desktop_cookie_ids_count_ge"},{"explode":true,"schema":{"$ref":"#/components/schemas/QueryLanguage"},"in":"query","required":false,"name":"query_language","description":"Query language","style":"form"},{"explode":true,"required":false,"style":"form","description":"Query language subtype","schema":{"$ref":"#/components/schemas/QueryLanguageSubtype"},"in":"query","name":"query_language_subtype"},{"explode":true,"required":false,"in":"query","style":"form","description":"Filter USER_QUERY segments by their subtype (e.g. STANDARD)","schema":{"type":"array","items":{"$ref":"#/components/schemas/UserQuerySubtype"}},"name":"user_query_subtype"},{"in":"query","description":"Get only segments created on or after (Unix timestamp)","name":"created_from","explode":true,"required":false,"style":"form","schema":{"type":"string"}},{"description":"Get only segments created on or before (Unix timestamp)","explode":true,"required":false,"name":"created_to","in":"query","style":"form","schema":{"type":"string"}},{"schema":{"type":"boolean"},"style":"form","description":"Segment used for a clean room dataset","name":"used_for_clean_room_dataset","required":false,"in":"query","explode":true}]}}},"components":{"schemas":{"AudienceSegmentResource":{"discriminator":{"propertyName":"type","mapping":{"CLEAN_ROOM":"#/components/schemas/CleanRoomAudienceSegmentResource","USER_LIST":"#/components/schemas/UserListSegmentResource","USER_LOOKALIKE":"#/components/schemas/UserLookalikePartitionBasedSegmentResource","USER_ACTIVATION":"#/components/schemas/UserActivationSegmentResource","USER_QUERY":"#/components/schemas/UserQuerySegmentResource","USER_LOOKALIKE_BY_COHORTS":"#/components/schemas/UserLookalikeCohortBasedSegmentResource","USER_DATA_SUBSCRIPTION":"#/components/schemas/UserDataSubscriptionSegmentResource","USER_PARTITION":"#/components/schemas/UserPartitionSegmentResource"}},"oneOf":[{"$ref":"#/components/schemas/UserDataSubscriptionSegmentResource"},{"$ref":"#/components/schemas/UserActivationSegmentResource"},{"$ref":"#/components/schemas/UserQuerySegmentResource"},{"$ref":"#/components/schemas/UserPartitionSegmentResource"},{"$ref":"#/components/schemas/UserLookalikeCohortBasedSegmentResource"},{"$ref":"#/components/schemas/UserListSegmentResource"},{"$ref":"#/components/schemas/CleanRoomAudienceSegmentResource"},{"$ref":"#/components/schemas/UserLookalikePartitionBasedSegmentResource"}],"properties":{"type":{"type":"string","enum":["USER_DATA_SUBSCRIPTION","USER_ACTIVATION","USER_QUERY","USER_PARTITION","USER_LOOKALIKE_BY_COHORTS","USER_LIST","CLEAN_ROOM","USER_LOOKALIKE"]}},"required":["type"]},"UserDataSubscriptionSegmentResource":{"type":"object","properties":{"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"origin_segment_id":{"type":"integer","format":"int64","default":0,"readOnly":false},"technical_name":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"name":{"type":"string","readOnly":false},"short_description":{"type":"string","readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","name","organisation_id","origin_segment_id","paused","persisted","provider_name","short_description","technical_name","token"]},"Duration":{"type":"number","description":"a length of time in milliseconds"},"AudienceMetricResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"display_name":{"type":"string","readOnly":true},"count":{"type":"integer","format":"int64","default":0,"readOnly":true},"count_last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["display_name","id"]},"AudienceSegmentEvaluationMode":{"type":"string","enum":["REAL_TIME","AUTOMATIC","ON_DEMAND","LIVE","PERIODIC"],"readOnly":false},"UserActivationSegmentResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"campaign_id":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"scenario_id":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"exposed":{"type":"boolean","default":false,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"token":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"provider_name":{"type":"string","readOnly":false},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":true},"clickers":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_metrics","auto_description","campaign_id","clickers","creation_ts","datamart_id","evaluation_mode","exposed","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","scenario_id","short_description","technical_name","token"]},"UserQuerySegmentResource":{"allOf":[{"$ref":"#/components/schemas/QuerySegmentResource"},{"type":"object","properties":{"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"segment_editor":{"$ref":"#/components/schemas/UserQuerySegmentEditor"},"weight":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"token":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"stats_query_precision_override":{"$ref":"#/components/schemas/QueryPrecisionMode1"},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"target_metric":{"$ref":"#/components/schemas/ABTestingExperimentTargetMetric"},"subtype":{"$ref":"#/components/schemas/UserQuerySubtype"},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"technical_name":{"type":"string","readOnly":false},"evaluation_period":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"provider_name":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"evaluation_period_unit":{"$ref":"#/components/schemas/UserQueryEvaluationPeriodUnit"},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"control_group_id":{"type":"string","readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","evaluation_period","evaluation_period_unit","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","query_id","segment_editor","short_description","subtype","technical_name","token"]}]},"QuerySegmentResource":{"type":"object"},"UserQuerySegmentEditor":{"type":"string","enum":["ADVANCED_SEGMENT_BUILDER","STANDARD_SEGMENT_BUILDER"],"readOnly":false},"QueryPrecisionMode1":{"type":"string","enum":["LOW_PRECISION","MEDIUM_PRECISION","FULL_PRECISION"],"readOnly":false},"ABTestingExperimentTargetMetric":{"type":"string","enum":["E_COMMERCE_ENGAGEMENT","CHANNEL_ENGAGEMENT"],"readOnly":false},"UserQuerySubtype":{"type":"string","enum":["STANDARD","AB_TESTING_CONTROL_GROUP","AB_TESTING_EXPERIMENT","UPLIFT_CONTROL_GROUP","UPLIFT_EXPERIMENT","EXPERIMENT_GROUP"],"readOnly":false},"UserQueryEvaluationPeriodUnit":{"type":"string","enum":["HOUR","DAY","WEEK","MONTH"],"readOnly":false},"UserPartitionSegmentResource":{"type":"object","properties":{"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"persisted":{"type":"boolean","default":false,"readOnly":false},"organisation_id":{"type":"string","readOnly":false},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_partition_id":{"type":"string","readOnly":false},"auto_description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"token":{"type":"string","readOnly":true},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"part_number":{"type":"integer","format":"int32","default":0,"readOnly":false},"short_description":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true}},"required":["audience_metrics","audience_partition_id","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","name","organisation_id","part_number","paused","persisted","provider_name","short_description","technical_name","token"]},"UserLookalikeCohortBasedSegmentResource":{"allOf":[{"$ref":"#/components/schemas/UserLookalikeSegmentResource"},{"type":"object","properties":{"token":{"type":"string","readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"source_segment_id":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"user_points_target":{"type":"integer","format":"int32","default":0,"readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":false},"provider_name":{"type":"string","readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"lookalike_algorithm":{"$ref":"#/components/schemas/AudienceLookalikeAlgorithm"},"datamart_id":{"type":"string","readOnly":false},"include_seed_segment":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/AudienceLookalikeStatus"},"auto_description":{"type":"string","readOnly":false},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"similarity_index":{"type":"number","format":"float","default":0,"readOnly":false},"min_overlap":{"type":"number","format":"float","default":0,"readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","id","include_seed_segment","last_modified_ts","lookalike_algorithm","name","organisation_id","paused","persisted","provider_name","query_id","short_description","source_segment_id","status","technical_name","token"]}]},"UserLookalikeSegmentResource":{"allOf":[{"$ref":"#/components/schemas/QuerySegmentResource"},{"type":"object"}]},"AudienceLookalikeAlgorithm":{"type":"string","enum":["CLUSTER_OVERLAP","FIELD_SCORE","MULTI_VARIATE_DISTANCE","COHORT_OVERLAP"],"readOnly":false},"AudienceLookalikeStatus":{"type":"string","enum":["DRAFT","CALIBRATING","CALIBRATION_ERROR","CALIBRATED","DEFINITION_ERROR"],"readOnly":false},"UserListSegmentResource":{"type":"object","properties":{"short_description":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"desktop_cookie_ids_count":{"default":0,"readOnly":false,"format":"int32","type":"integer"},"name":{"type":"string","readOnly":false},"subtype":{"$ref":"#/components/schemas/UserListSubtype"},"auto_description":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"user_accounts_count":{"format":"int32","readOnly":false,"type":"integer","default":0},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"emails_count":{"format":"int32","readOnly":false,"type":"integer","default":0},"datamart_id":{"type":"string","readOnly":false},"standard_segment_builder_id":{"type":"string","readOnly":false},"feed_type":{"$ref":"#/components/schemas/UserListFeedType"},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"query_id":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_points_count":{"readOnly":false,"default":0,"format":"int32","type":"integer"},"provider_name":{"type":"string","readOnly":false},"persisted":{"type":"boolean","default":false,"readOnly":false},"token":{"type":"string","readOnly":true},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","feed_type","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","query_id","short_description","subtype","technical_name","token"]},"UserListSubtype":{"type":"string","enum":["STANDARD","USER_PIXEL","EDGE","EXPERIMENT_GROUP"],"readOnly":false},"UserListFeedType":{"type":"string","enum":["FILE_IMPORT","TAG","SCENARIO","SCENARIO_FEED"],"readOnly":false},"CleanRoomAudienceSegmentResource":{"type":"object","properties":{"from_dataset_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"clean_room_id":{"type":"string","readOnly":false},"short_description":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"datasets_matching_id":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"to_dataset_id":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":false},"datasets_matching_selection":{"$ref":"#/components/schemas/CleanRoomSegmentDatasetsMatchingSelection"},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["clean_room_id","creation_ts","datamart_id","datasets_matching_id","datasets_matching_selection","from_dataset_id","id","last_modified_ts","name","organisation_id","short_description","technical_name","to_dataset_id","token"]},"CleanRoomSegmentDatasetsMatchingSelection":{"type":"string","enum":["COMMON","EXCLUSIVE"],"readOnly":false},"UserLookalikePartitionBasedSegmentResource":{"allOf":[{"$ref":"#/components/schemas/UserLookalikeSegmentResource"},{"type":"object","properties":{"minimum_score":{"type":"number","format":"float","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"persisted":{"type":"boolean","default":false,"readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"source_segment_id":{"type":"string","readOnly":false},"query_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"status":{"$ref":"#/components/schemas/AudienceLookalikeStatus"},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"short_description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"lookalike_algorithm":{"$ref":"#/components/schemas/AudienceLookalikeAlgorithm"},"extension_factor":{"type":"number","format":"float","default":0,"readOnly":false},"token":{"type":"string","readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_partition_id":{"type":"string","readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","audience_partition_id","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","lookalike_algorithm","name","organisation_id","paused","persisted","provider_name","query_id","short_description","source_segment_id","status","technical_name","token"]}]},"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"]},"AudienceSegmentType":{"type":"string","enum":["USER_LIST","USER_QUERY","USER_LOOKALIKE_BY_COHORTS","USER_LOOKALIKE","USER_ACTIVATION","USER_PARTITION","USER_DATA_SUBSCRIPTION","CLEAN_ROOM"],"readOnly":false},"QueryLanguage":{"type":"string","enum":["SELECTORQL","JSON_OTQL","OTQL","GRAPHQL","SQL"],"readOnly":false},"QueryLanguageSubtype":{"type":"string","enum":["PARAMETRIC"],"readOnly":false}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /audience\_segments

> Create audience segment

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Mediarithmics most used API","description":"These operations where flagged by mediarithmics teams as most useful."},{"name":"Segments","description":"Operations related to **Segments**, the groups of UserPoints who share common characteristics, behaviors, or interests. Supports multiple types:\n- **User Query** (OTQL-based)\n- **Edge** (client-side evaluation)\n- **User List** (static import)\n- **User Partition** (random distribution for A/B testing)\n- **User Lookalike** (ML-generated expansion)\n- **User Activation** (campaign interaction tracking)\n- **User Pixel** (pixel-based collection)\n\nRelevant documentation:\n- [Segments](https://userguides.mediarithmics.io/audience/segments)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/audience_segments":{"post":{"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AudienceSegmentResource"}},"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":[{"required":false,"style":"form","name":"organisation_id","schema":{"type":"integer","format":"int64"},"in":"query","explode":true}],"tags":["Segments","Mediarithmics most used API"],"requestBody":{"description":"Audience segment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatamartAudienceSegmentResource"}}},"required":true},"description":"","summary":"Create audience segment","operationId":"createAudienceSegment"}}},"components":{"schemas":{"AudienceSegmentResource":{"discriminator":{"propertyName":"type","mapping":{"CLEAN_ROOM":"#/components/schemas/CleanRoomAudienceSegmentResource","USER_LIST":"#/components/schemas/UserListSegmentResource","USER_LOOKALIKE":"#/components/schemas/UserLookalikePartitionBasedSegmentResource","USER_ACTIVATION":"#/components/schemas/UserActivationSegmentResource","USER_QUERY":"#/components/schemas/UserQuerySegmentResource","USER_LOOKALIKE_BY_COHORTS":"#/components/schemas/UserLookalikeCohortBasedSegmentResource","USER_DATA_SUBSCRIPTION":"#/components/schemas/UserDataSubscriptionSegmentResource","USER_PARTITION":"#/components/schemas/UserPartitionSegmentResource"}},"oneOf":[{"$ref":"#/components/schemas/UserDataSubscriptionSegmentResource"},{"$ref":"#/components/schemas/UserActivationSegmentResource"},{"$ref":"#/components/schemas/UserQuerySegmentResource"},{"$ref":"#/components/schemas/UserPartitionSegmentResource"},{"$ref":"#/components/schemas/UserLookalikeCohortBasedSegmentResource"},{"$ref":"#/components/schemas/UserListSegmentResource"},{"$ref":"#/components/schemas/CleanRoomAudienceSegmentResource"},{"$ref":"#/components/schemas/UserLookalikePartitionBasedSegmentResource"}],"properties":{"type":{"type":"string","enum":["USER_DATA_SUBSCRIPTION","USER_ACTIVATION","USER_QUERY","USER_PARTITION","USER_LOOKALIKE_BY_COHORTS","USER_LIST","CLEAN_ROOM","USER_LOOKALIKE"]}},"required":["type"]},"UserDataSubscriptionSegmentResource":{"type":"object","properties":{"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"origin_segment_id":{"type":"integer","format":"int64","default":0,"readOnly":false},"technical_name":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"name":{"type":"string","readOnly":false},"short_description":{"type":"string","readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","name","organisation_id","origin_segment_id","paused","persisted","provider_name","short_description","technical_name","token"]},"Duration":{"type":"number","description":"a length of time in milliseconds"},"AudienceMetricResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"display_name":{"type":"string","readOnly":true},"count":{"type":"integer","format":"int64","default":0,"readOnly":true},"count_last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["display_name","id"]},"AudienceSegmentEvaluationMode":{"type":"string","enum":["REAL_TIME","AUTOMATIC","ON_DEMAND","LIVE","PERIODIC"],"readOnly":false},"UserActivationSegmentResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"campaign_id":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"scenario_id":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"exposed":{"type":"boolean","default":false,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"token":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"provider_name":{"type":"string","readOnly":false},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":true},"clickers":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_metrics","auto_description","campaign_id","clickers","creation_ts","datamart_id","evaluation_mode","exposed","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","scenario_id","short_description","technical_name","token"]},"UserQuerySegmentResource":{"allOf":[{"$ref":"#/components/schemas/QuerySegmentResource"},{"type":"object","properties":{"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"segment_editor":{"$ref":"#/components/schemas/UserQuerySegmentEditor"},"weight":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"token":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"stats_query_precision_override":{"$ref":"#/components/schemas/QueryPrecisionMode1"},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"target_metric":{"$ref":"#/components/schemas/ABTestingExperimentTargetMetric"},"subtype":{"$ref":"#/components/schemas/UserQuerySubtype"},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"technical_name":{"type":"string","readOnly":false},"evaluation_period":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"provider_name":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"evaluation_period_unit":{"$ref":"#/components/schemas/UserQueryEvaluationPeriodUnit"},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"control_group_id":{"type":"string","readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","evaluation_period","evaluation_period_unit","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","query_id","segment_editor","short_description","subtype","technical_name","token"]}]},"QuerySegmentResource":{"type":"object"},"UserQuerySegmentEditor":{"type":"string","enum":["ADVANCED_SEGMENT_BUILDER","STANDARD_SEGMENT_BUILDER"],"readOnly":false},"QueryPrecisionMode1":{"type":"string","enum":["LOW_PRECISION","MEDIUM_PRECISION","FULL_PRECISION"],"readOnly":false},"ABTestingExperimentTargetMetric":{"type":"string","enum":["E_COMMERCE_ENGAGEMENT","CHANNEL_ENGAGEMENT"],"readOnly":false},"UserQuerySubtype":{"type":"string","enum":["STANDARD","AB_TESTING_CONTROL_GROUP","AB_TESTING_EXPERIMENT","UPLIFT_CONTROL_GROUP","UPLIFT_EXPERIMENT","EXPERIMENT_GROUP"],"readOnly":false},"UserQueryEvaluationPeriodUnit":{"type":"string","enum":["HOUR","DAY","WEEK","MONTH"],"readOnly":false},"UserPartitionSegmentResource":{"type":"object","properties":{"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"persisted":{"type":"boolean","default":false,"readOnly":false},"organisation_id":{"type":"string","readOnly":false},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_partition_id":{"type":"string","readOnly":false},"auto_description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"token":{"type":"string","readOnly":true},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"part_number":{"type":"integer","format":"int32","default":0,"readOnly":false},"short_description":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true}},"required":["audience_metrics","audience_partition_id","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","name","organisation_id","part_number","paused","persisted","provider_name","short_description","technical_name","token"]},"UserLookalikeCohortBasedSegmentResource":{"allOf":[{"$ref":"#/components/schemas/UserLookalikeSegmentResource"},{"type":"object","properties":{"token":{"type":"string","readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"source_segment_id":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"user_points_target":{"type":"integer","format":"int32","default":0,"readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":false},"provider_name":{"type":"string","readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"lookalike_algorithm":{"$ref":"#/components/schemas/AudienceLookalikeAlgorithm"},"datamart_id":{"type":"string","readOnly":false},"include_seed_segment":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/AudienceLookalikeStatus"},"auto_description":{"type":"string","readOnly":false},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"similarity_index":{"type":"number","format":"float","default":0,"readOnly":false},"min_overlap":{"type":"number","format":"float","default":0,"readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","id","include_seed_segment","last_modified_ts","lookalike_algorithm","name","organisation_id","paused","persisted","provider_name","query_id","short_description","source_segment_id","status","technical_name","token"]}]},"UserLookalikeSegmentResource":{"allOf":[{"$ref":"#/components/schemas/QuerySegmentResource"},{"type":"object"}]},"AudienceLookalikeAlgorithm":{"type":"string","enum":["CLUSTER_OVERLAP","FIELD_SCORE","MULTI_VARIATE_DISTANCE","COHORT_OVERLAP"],"readOnly":false},"AudienceLookalikeStatus":{"type":"string","enum":["DRAFT","CALIBRATING","CALIBRATION_ERROR","CALIBRATED","DEFINITION_ERROR"],"readOnly":false},"UserListSegmentResource":{"type":"object","properties":{"short_description":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"desktop_cookie_ids_count":{"default":0,"readOnly":false,"format":"int32","type":"integer"},"name":{"type":"string","readOnly":false},"subtype":{"$ref":"#/components/schemas/UserListSubtype"},"auto_description":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"user_accounts_count":{"format":"int32","readOnly":false,"type":"integer","default":0},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"emails_count":{"format":"int32","readOnly":false,"type":"integer","default":0},"datamart_id":{"type":"string","readOnly":false},"standard_segment_builder_id":{"type":"string","readOnly":false},"feed_type":{"$ref":"#/components/schemas/UserListFeedType"},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"query_id":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_points_count":{"readOnly":false,"default":0,"format":"int32","type":"integer"},"provider_name":{"type":"string","readOnly":false},"persisted":{"type":"boolean","default":false,"readOnly":false},"token":{"type":"string","readOnly":true},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","feed_type","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","query_id","short_description","subtype","technical_name","token"]},"UserListSubtype":{"type":"string","enum":["STANDARD","USER_PIXEL","EDGE","EXPERIMENT_GROUP"],"readOnly":false},"UserListFeedType":{"type":"string","enum":["FILE_IMPORT","TAG","SCENARIO","SCENARIO_FEED"],"readOnly":false},"CleanRoomAudienceSegmentResource":{"type":"object","properties":{"from_dataset_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"clean_room_id":{"type":"string","readOnly":false},"short_description":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"datasets_matching_id":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"to_dataset_id":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":false},"datasets_matching_selection":{"$ref":"#/components/schemas/CleanRoomSegmentDatasetsMatchingSelection"},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["clean_room_id","creation_ts","datamart_id","datasets_matching_id","datasets_matching_selection","from_dataset_id","id","last_modified_ts","name","organisation_id","short_description","technical_name","to_dataset_id","token"]},"CleanRoomSegmentDatasetsMatchingSelection":{"type":"string","enum":["COMMON","EXCLUSIVE"],"readOnly":false},"UserLookalikePartitionBasedSegmentResource":{"allOf":[{"$ref":"#/components/schemas/UserLookalikeSegmentResource"},{"type":"object","properties":{"minimum_score":{"type":"number","format":"float","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"persisted":{"type":"boolean","default":false,"readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"source_segment_id":{"type":"string","readOnly":false},"query_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"status":{"$ref":"#/components/schemas/AudienceLookalikeStatus"},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"short_description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"lookalike_algorithm":{"$ref":"#/components/schemas/AudienceLookalikeAlgorithm"},"extension_factor":{"type":"number","format":"float","default":0,"readOnly":false},"token":{"type":"string","readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_partition_id":{"type":"string","readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","audience_partition_id","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","lookalike_algorithm","name","organisation_id","paused","persisted","provider_name","query_id","short_description","source_segment_id","status","technical_name","token"]}]},"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"]},"DatamartAudienceSegmentResource":{"discriminator":{"propertyName":"type","mapping":{"USER_PARTITION":"#/components/schemas/UserPartitionSegmentResource","USER_LOOKALIKE":"#/components/schemas/UserLookalikePartitionBasedSegmentResource","USER_LIST":"#/components/schemas/UserListSegmentResource","USER_QUERY":"#/components/schemas/UserQuerySegmentResource","USER_LOOKALIKE_BY_COHORTS":"#/components/schemas/UserLookalikeCohortBasedSegmentResource","USER_ACTIVATION":"#/components/schemas/UserActivationSegmentResource","USER_DATA_SUBSCRIPTION":"#/components/schemas/UserDataSubscriptionSegmentResource"}},"oneOf":[{"$ref":"#/components/schemas/UserDataSubscriptionSegmentResource"},{"$ref":"#/components/schemas/UserLookalikePartitionBasedSegmentResource"},{"$ref":"#/components/schemas/UserActivationSegmentResource"},{"$ref":"#/components/schemas/UserQuerySegmentResource"},{"$ref":"#/components/schemas/UserPartitionSegmentResource"},{"$ref":"#/components/schemas/UserLookalikeCohortBasedSegmentResource"},{"$ref":"#/components/schemas/UserListSegmentResource"}],"properties":{"type":{"type":"string","enum":["USER_DATA_SUBSCRIPTION","USER_LOOKALIKE","USER_ACTIVATION","USER_QUERY","USER_PARTITION","USER_LOOKALIKE_BY_COHORTS","USER_LIST"]}},"required":["type"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /audience\_segment\_limits

> Segment usage limits for an organisation

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Segments","description":"Operations related to **Segments**, the groups of UserPoints who share common characteristics, behaviors, or interests. Supports multiple types:\n- **User Query** (OTQL-based)\n- **Edge** (client-side evaluation)\n- **User List** (static import)\n- **User Partition** (random distribution for A/B testing)\n- **User Lookalike** (ML-generated expansion)\n- **User Activation** (campaign interaction tracking)\n- **User Pixel** (pixel-based collection)\n\nRelevant documentation:\n- [Segments](https://userguides.mediarithmics.io/audience/segments)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/audience_segment_limits":{"get":{"tags":["Segments"],"summary":"Segment usage limits for an organisation","operationId":"getAudienceSegmentLimits","parameters":[{"schema":{"type":"string"},"description":"The organisation to retrieve segment usage limits for","in":"query","explode":true,"name":"organisation_id","required":true,"style":"form"}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/SegmentUsageLimitsResource"}},"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":""}}},"components":{"schemas":{"SegmentUsageLimitsResource":{"type":"object","properties":{"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"last_modified_by":{"type":"string","readOnly":true},"max_activated_segments":{"type":"integer","format":"int64","default":0,"readOnly":false},"created_by":{"type":"string","readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"max_total_segments":{"type":"integer","format":"int64","default":0,"readOnly":false}},"required":["organisation_id"]},"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 /clean\_room\_audience\_segments

> Get clean room audience segments

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Segments","description":"Operations related to **Segments**, the groups of UserPoints who share common characteristics, behaviors, or interests. Supports multiple types:\n- **User Query** (OTQL-based)\n- **Edge** (client-side evaluation)\n- **User List** (static import)\n- **User Partition** (random distribution for A/B testing)\n- **User Lookalike** (ML-generated expansion)\n- **User Activation** (campaign interaction tracking)\n- **User Pixel** (pixel-based collection)\n\nRelevant documentation:\n- [Segments](https://userguides.mediarithmics.io/audience/segments)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/clean_room_audience_segments":{"get":{"parameters":[{"explode":true,"name":"dataset_matching_id","style":"form","required":false,"in":"query","schema":{"type":"string"}},{"in":"query","schema":{"type":"string"},"name":"clean_room_id","required":true,"explode":true,"style":"form"}],"tags":["Segments"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"total":{"type":"integer"},"max_results":{"type":"integer"},"first_result":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/AudienceSegmentResource"}},"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":"getCleanRoomAudienceSegments","summary":"Get clean room audience segments","description":""}}},"components":{"schemas":{"AudienceSegmentResource":{"discriminator":{"propertyName":"type","mapping":{"CLEAN_ROOM":"#/components/schemas/CleanRoomAudienceSegmentResource","USER_LIST":"#/components/schemas/UserListSegmentResource","USER_LOOKALIKE":"#/components/schemas/UserLookalikePartitionBasedSegmentResource","USER_ACTIVATION":"#/components/schemas/UserActivationSegmentResource","USER_QUERY":"#/components/schemas/UserQuerySegmentResource","USER_LOOKALIKE_BY_COHORTS":"#/components/schemas/UserLookalikeCohortBasedSegmentResource","USER_DATA_SUBSCRIPTION":"#/components/schemas/UserDataSubscriptionSegmentResource","USER_PARTITION":"#/components/schemas/UserPartitionSegmentResource"}},"oneOf":[{"$ref":"#/components/schemas/UserDataSubscriptionSegmentResource"},{"$ref":"#/components/schemas/UserActivationSegmentResource"},{"$ref":"#/components/schemas/UserQuerySegmentResource"},{"$ref":"#/components/schemas/UserPartitionSegmentResource"},{"$ref":"#/components/schemas/UserLookalikeCohortBasedSegmentResource"},{"$ref":"#/components/schemas/UserListSegmentResource"},{"$ref":"#/components/schemas/CleanRoomAudienceSegmentResource"},{"$ref":"#/components/schemas/UserLookalikePartitionBasedSegmentResource"}],"properties":{"type":{"type":"string","enum":["USER_DATA_SUBSCRIPTION","USER_ACTIVATION","USER_QUERY","USER_PARTITION","USER_LOOKALIKE_BY_COHORTS","USER_LIST","CLEAN_ROOM","USER_LOOKALIKE"]}},"required":["type"]},"UserDataSubscriptionSegmentResource":{"type":"object","properties":{"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"origin_segment_id":{"type":"integer","format":"int64","default":0,"readOnly":false},"technical_name":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"name":{"type":"string","readOnly":false},"short_description":{"type":"string","readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","name","organisation_id","origin_segment_id","paused","persisted","provider_name","short_description","technical_name","token"]},"Duration":{"type":"number","description":"a length of time in milliseconds"},"AudienceMetricResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"display_name":{"type":"string","readOnly":true},"count":{"type":"integer","format":"int64","default":0,"readOnly":true},"count_last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["display_name","id"]},"AudienceSegmentEvaluationMode":{"type":"string","enum":["REAL_TIME","AUTOMATIC","ON_DEMAND","LIVE","PERIODIC"],"readOnly":false},"UserActivationSegmentResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"campaign_id":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"scenario_id":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"exposed":{"type":"boolean","default":false,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"token":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"provider_name":{"type":"string","readOnly":false},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":true},"clickers":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_metrics","auto_description","campaign_id","clickers","creation_ts","datamart_id","evaluation_mode","exposed","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","scenario_id","short_description","technical_name","token"]},"UserQuerySegmentResource":{"allOf":[{"$ref":"#/components/schemas/QuerySegmentResource"},{"type":"object","properties":{"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"segment_editor":{"$ref":"#/components/schemas/UserQuerySegmentEditor"},"weight":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"token":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"stats_query_precision_override":{"$ref":"#/components/schemas/QueryPrecisionMode1"},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"target_metric":{"$ref":"#/components/schemas/ABTestingExperimentTargetMetric"},"subtype":{"$ref":"#/components/schemas/UserQuerySubtype"},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"technical_name":{"type":"string","readOnly":false},"evaluation_period":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"provider_name":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"evaluation_period_unit":{"$ref":"#/components/schemas/UserQueryEvaluationPeriodUnit"},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"control_group_id":{"type":"string","readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","evaluation_period","evaluation_period_unit","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","query_id","segment_editor","short_description","subtype","technical_name","token"]}]},"QuerySegmentResource":{"type":"object"},"UserQuerySegmentEditor":{"type":"string","enum":["ADVANCED_SEGMENT_BUILDER","STANDARD_SEGMENT_BUILDER"],"readOnly":false},"QueryPrecisionMode1":{"type":"string","enum":["LOW_PRECISION","MEDIUM_PRECISION","FULL_PRECISION"],"readOnly":false},"ABTestingExperimentTargetMetric":{"type":"string","enum":["E_COMMERCE_ENGAGEMENT","CHANNEL_ENGAGEMENT"],"readOnly":false},"UserQuerySubtype":{"type":"string","enum":["STANDARD","AB_TESTING_CONTROL_GROUP","AB_TESTING_EXPERIMENT","UPLIFT_CONTROL_GROUP","UPLIFT_EXPERIMENT","EXPERIMENT_GROUP"],"readOnly":false},"UserQueryEvaluationPeriodUnit":{"type":"string","enum":["HOUR","DAY","WEEK","MONTH"],"readOnly":false},"UserPartitionSegmentResource":{"type":"object","properties":{"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"persisted":{"type":"boolean","default":false,"readOnly":false},"organisation_id":{"type":"string","readOnly":false},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_partition_id":{"type":"string","readOnly":false},"auto_description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"token":{"type":"string","readOnly":true},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"part_number":{"type":"integer","format":"int32","default":0,"readOnly":false},"short_description":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true}},"required":["audience_metrics","audience_partition_id","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","name","organisation_id","part_number","paused","persisted","provider_name","short_description","technical_name","token"]},"UserLookalikeCohortBasedSegmentResource":{"allOf":[{"$ref":"#/components/schemas/UserLookalikeSegmentResource"},{"type":"object","properties":{"token":{"type":"string","readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"source_segment_id":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"user_points_target":{"type":"integer","format":"int32","default":0,"readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":false},"provider_name":{"type":"string","readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"lookalike_algorithm":{"$ref":"#/components/schemas/AudienceLookalikeAlgorithm"},"datamart_id":{"type":"string","readOnly":false},"include_seed_segment":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/AudienceLookalikeStatus"},"auto_description":{"type":"string","readOnly":false},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"similarity_index":{"type":"number","format":"float","default":0,"readOnly":false},"min_overlap":{"type":"number","format":"float","default":0,"readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","id","include_seed_segment","last_modified_ts","lookalike_algorithm","name","organisation_id","paused","persisted","provider_name","query_id","short_description","source_segment_id","status","technical_name","token"]}]},"UserLookalikeSegmentResource":{"allOf":[{"$ref":"#/components/schemas/QuerySegmentResource"},{"type":"object"}]},"AudienceLookalikeAlgorithm":{"type":"string","enum":["CLUSTER_OVERLAP","FIELD_SCORE","MULTI_VARIATE_DISTANCE","COHORT_OVERLAP"],"readOnly":false},"AudienceLookalikeStatus":{"type":"string","enum":["DRAFT","CALIBRATING","CALIBRATION_ERROR","CALIBRATED","DEFINITION_ERROR"],"readOnly":false},"UserListSegmentResource":{"type":"object","properties":{"short_description":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"desktop_cookie_ids_count":{"default":0,"readOnly":false,"format":"int32","type":"integer"},"name":{"type":"string","readOnly":false},"subtype":{"$ref":"#/components/schemas/UserListSubtype"},"auto_description":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"user_accounts_count":{"format":"int32","readOnly":false,"type":"integer","default":0},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"emails_count":{"format":"int32","readOnly":false,"type":"integer","default":0},"datamart_id":{"type":"string","readOnly":false},"standard_segment_builder_id":{"type":"string","readOnly":false},"feed_type":{"$ref":"#/components/schemas/UserListFeedType"},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"query_id":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_points_count":{"readOnly":false,"default":0,"format":"int32","type":"integer"},"provider_name":{"type":"string","readOnly":false},"persisted":{"type":"boolean","default":false,"readOnly":false},"token":{"type":"string","readOnly":true},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","feed_type","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","query_id","short_description","subtype","technical_name","token"]},"UserListSubtype":{"type":"string","enum":["STANDARD","USER_PIXEL","EDGE","EXPERIMENT_GROUP"],"readOnly":false},"UserListFeedType":{"type":"string","enum":["FILE_IMPORT","TAG","SCENARIO","SCENARIO_FEED"],"readOnly":false},"CleanRoomAudienceSegmentResource":{"type":"object","properties":{"from_dataset_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"clean_room_id":{"type":"string","readOnly":false},"short_description":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"datasets_matching_id":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"to_dataset_id":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":false},"datasets_matching_selection":{"$ref":"#/components/schemas/CleanRoomSegmentDatasetsMatchingSelection"},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["clean_room_id","creation_ts","datamart_id","datasets_matching_id","datasets_matching_selection","from_dataset_id","id","last_modified_ts","name","organisation_id","short_description","technical_name","to_dataset_id","token"]},"CleanRoomSegmentDatasetsMatchingSelection":{"type":"string","enum":["COMMON","EXCLUSIVE"],"readOnly":false},"UserLookalikePartitionBasedSegmentResource":{"allOf":[{"$ref":"#/components/schemas/UserLookalikeSegmentResource"},{"type":"object","properties":{"minimum_score":{"type":"number","format":"float","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"persisted":{"type":"boolean","default":false,"readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"source_segment_id":{"type":"string","readOnly":false},"query_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"status":{"$ref":"#/components/schemas/AudienceLookalikeStatus"},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"short_description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"lookalike_algorithm":{"$ref":"#/components/schemas/AudienceLookalikeAlgorithm"},"extension_factor":{"type":"number","format":"float","default":0,"readOnly":false},"token":{"type":"string","readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_partition_id":{"type":"string","readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","audience_partition_id","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","lookalike_algorithm","name","organisation_id","paused","persisted","provider_name","query_id","short_description","source_segment_id","status","technical_name","token"]}]},"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 /clean\_room\_audience\_segments/{segment\_id}

> Get clean room audience segment

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Segments","description":"Operations related to **Segments**, the groups of UserPoints who share common characteristics, behaviors, or interests. Supports multiple types:\n- **User Query** (OTQL-based)\n- **Edge** (client-side evaluation)\n- **User List** (static import)\n- **User Partition** (random distribution for A/B testing)\n- **User Lookalike** (ML-generated expansion)\n- **User Activation** (campaign interaction tracking)\n- **User Pixel** (pixel-based collection)\n\nRelevant documentation:\n- [Segments](https://userguides.mediarithmics.io/audience/segments)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/clean_room_audience_segments/{segment_id}":{"get":{"operationId":"getCleanRoomAudienceSegment","summary":"Get clean room audience segment","tags":["Segments"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AudienceSegmentResource"}},"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":[{"in":"path","name":"segment_id","required":true,"schema":{"type":"integer","format":"int64"},"style":"simple","explode":false}],"description":""}}},"components":{"schemas":{"AudienceSegmentResource":{"discriminator":{"propertyName":"type","mapping":{"CLEAN_ROOM":"#/components/schemas/CleanRoomAudienceSegmentResource","USER_LIST":"#/components/schemas/UserListSegmentResource","USER_LOOKALIKE":"#/components/schemas/UserLookalikePartitionBasedSegmentResource","USER_ACTIVATION":"#/components/schemas/UserActivationSegmentResource","USER_QUERY":"#/components/schemas/UserQuerySegmentResource","USER_LOOKALIKE_BY_COHORTS":"#/components/schemas/UserLookalikeCohortBasedSegmentResource","USER_DATA_SUBSCRIPTION":"#/components/schemas/UserDataSubscriptionSegmentResource","USER_PARTITION":"#/components/schemas/UserPartitionSegmentResource"}},"oneOf":[{"$ref":"#/components/schemas/UserDataSubscriptionSegmentResource"},{"$ref":"#/components/schemas/UserActivationSegmentResource"},{"$ref":"#/components/schemas/UserQuerySegmentResource"},{"$ref":"#/components/schemas/UserPartitionSegmentResource"},{"$ref":"#/components/schemas/UserLookalikeCohortBasedSegmentResource"},{"$ref":"#/components/schemas/UserListSegmentResource"},{"$ref":"#/components/schemas/CleanRoomAudienceSegmentResource"},{"$ref":"#/components/schemas/UserLookalikePartitionBasedSegmentResource"}],"properties":{"type":{"type":"string","enum":["USER_DATA_SUBSCRIPTION","USER_ACTIVATION","USER_QUERY","USER_PARTITION","USER_LOOKALIKE_BY_COHORTS","USER_LIST","CLEAN_ROOM","USER_LOOKALIKE"]}},"required":["type"]},"UserDataSubscriptionSegmentResource":{"type":"object","properties":{"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"origin_segment_id":{"type":"integer","format":"int64","default":0,"readOnly":false},"technical_name":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"name":{"type":"string","readOnly":false},"short_description":{"type":"string","readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","name","organisation_id","origin_segment_id","paused","persisted","provider_name","short_description","technical_name","token"]},"Duration":{"type":"number","description":"a length of time in milliseconds"},"AudienceMetricResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"display_name":{"type":"string","readOnly":true},"count":{"type":"integer","format":"int64","default":0,"readOnly":true},"count_last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["display_name","id"]},"AudienceSegmentEvaluationMode":{"type":"string","enum":["REAL_TIME","AUTOMATIC","ON_DEMAND","LIVE","PERIODIC"],"readOnly":false},"UserActivationSegmentResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"campaign_id":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"scenario_id":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"exposed":{"type":"boolean","default":false,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"token":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"provider_name":{"type":"string","readOnly":false},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":true},"clickers":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_metrics","auto_description","campaign_id","clickers","creation_ts","datamart_id","evaluation_mode","exposed","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","scenario_id","short_description","technical_name","token"]},"UserQuerySegmentResource":{"allOf":[{"$ref":"#/components/schemas/QuerySegmentResource"},{"type":"object","properties":{"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"segment_editor":{"$ref":"#/components/schemas/UserQuerySegmentEditor"},"weight":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"token":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"stats_query_precision_override":{"$ref":"#/components/schemas/QueryPrecisionMode1"},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"target_metric":{"$ref":"#/components/schemas/ABTestingExperimentTargetMetric"},"subtype":{"$ref":"#/components/schemas/UserQuerySubtype"},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"technical_name":{"type":"string","readOnly":false},"evaluation_period":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"provider_name":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"evaluation_period_unit":{"$ref":"#/components/schemas/UserQueryEvaluationPeriodUnit"},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"control_group_id":{"type":"string","readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","evaluation_period","evaluation_period_unit","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","query_id","segment_editor","short_description","subtype","technical_name","token"]}]},"QuerySegmentResource":{"type":"object"},"UserQuerySegmentEditor":{"type":"string","enum":["ADVANCED_SEGMENT_BUILDER","STANDARD_SEGMENT_BUILDER"],"readOnly":false},"QueryPrecisionMode1":{"type":"string","enum":["LOW_PRECISION","MEDIUM_PRECISION","FULL_PRECISION"],"readOnly":false},"ABTestingExperimentTargetMetric":{"type":"string","enum":["E_COMMERCE_ENGAGEMENT","CHANNEL_ENGAGEMENT"],"readOnly":false},"UserQuerySubtype":{"type":"string","enum":["STANDARD","AB_TESTING_CONTROL_GROUP","AB_TESTING_EXPERIMENT","UPLIFT_CONTROL_GROUP","UPLIFT_EXPERIMENT","EXPERIMENT_GROUP"],"readOnly":false},"UserQueryEvaluationPeriodUnit":{"type":"string","enum":["HOUR","DAY","WEEK","MONTH"],"readOnly":false},"UserPartitionSegmentResource":{"type":"object","properties":{"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"persisted":{"type":"boolean","default":false,"readOnly":false},"organisation_id":{"type":"string","readOnly":false},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_partition_id":{"type":"string","readOnly":false},"auto_description":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"token":{"type":"string","readOnly":true},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"part_number":{"type":"integer","format":"int32","default":0,"readOnly":false},"short_description":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true}},"required":["audience_metrics","audience_partition_id","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","name","organisation_id","part_number","paused","persisted","provider_name","short_description","technical_name","token"]},"UserLookalikeCohortBasedSegmentResource":{"allOf":[{"$ref":"#/components/schemas/UserLookalikeSegmentResource"},{"type":"object","properties":{"token":{"type":"string","readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"source_segment_id":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"short_description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"user_points_target":{"type":"integer","format":"int32","default":0,"readOnly":false},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"persisted":{"type":"boolean","default":false,"readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"name":{"type":"string","readOnly":false},"provider_name":{"type":"string","readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"lookalike_algorithm":{"$ref":"#/components/schemas/AudienceLookalikeAlgorithm"},"datamart_id":{"type":"string","readOnly":false},"include_seed_segment":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/AudienceLookalikeStatus"},"auto_description":{"type":"string","readOnly":false},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"similarity_index":{"type":"number","format":"float","default":0,"readOnly":false},"min_overlap":{"type":"number","format":"float","default":0,"readOnly":false},"paused":{"type":"boolean","default":false,"readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","id","include_seed_segment","last_modified_ts","lookalike_algorithm","name","organisation_id","paused","persisted","provider_name","query_id","short_description","source_segment_id","status","technical_name","token"]}]},"UserLookalikeSegmentResource":{"allOf":[{"$ref":"#/components/schemas/QuerySegmentResource"},{"type":"object"}]},"AudienceLookalikeAlgorithm":{"type":"string","enum":["CLUSTER_OVERLAP","FIELD_SCORE","MULTI_VARIATE_DISTANCE","COHORT_OVERLAP"],"readOnly":false},"AudienceLookalikeStatus":{"type":"string","enum":["DRAFT","CALIBRATING","CALIBRATION_ERROR","CALIBRATED","DEFINITION_ERROR"],"readOnly":false},"UserListSegmentResource":{"type":"object","properties":{"short_description":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"desktop_cookie_ids_count":{"default":0,"readOnly":false,"format":"int32","type":"integer"},"name":{"type":"string","readOnly":false},"subtype":{"$ref":"#/components/schemas/UserListSubtype"},"auto_description":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"user_accounts_count":{"format":"int32","readOnly":false,"type":"integer","default":0},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"},"emails_count":{"format":"int32","readOnly":false,"type":"integer","default":0},"datamart_id":{"type":"string","readOnly":false},"standard_segment_builder_id":{"type":"string","readOnly":false},"feed_type":{"$ref":"#/components/schemas/UserListFeedType"},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"default_ttl":{"$ref":"#/components/schemas/Duration"},"query_id":{"type":"string","readOnly":false},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"technical_name":{"type":"string","readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_points_count":{"readOnly":false,"default":0,"format":"int32","type":"integer"},"provider_name":{"type":"string","readOnly":false},"persisted":{"type":"boolean","default":false,"readOnly":false},"token":{"type":"string","readOnly":true},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true}},"required":["audience_metrics","auto_description","creation_ts","datamart_id","evaluation_mode","feed_type","id","last_modified_ts","name","organisation_id","paused","persisted","provider_name","query_id","short_description","subtype","technical_name","token"]},"UserListSubtype":{"type":"string","enum":["STANDARD","USER_PIXEL","EDGE","EXPERIMENT_GROUP"],"readOnly":false},"UserListFeedType":{"type":"string","enum":["FILE_IMPORT","TAG","SCENARIO","SCENARIO_FEED"],"readOnly":false},"CleanRoomAudienceSegmentResource":{"type":"object","properties":{"from_dataset_id":{"type":"string","readOnly":false},"token":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"clean_room_id":{"type":"string","readOnly":false},"short_description":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"datasets_matching_id":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"to_dataset_id":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":false},"datasets_matching_selection":{"$ref":"#/components/schemas/CleanRoomSegmentDatasetsMatchingSelection"},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["clean_room_id","creation_ts","datamart_id","datasets_matching_id","datasets_matching_selection","from_dataset_id","id","last_modified_ts","name","organisation_id","short_description","technical_name","to_dataset_id","token"]},"CleanRoomSegmentDatasetsMatchingSelection":{"type":"string","enum":["COMMON","EXCLUSIVE"],"readOnly":false},"UserLookalikePartitionBasedSegmentResource":{"allOf":[{"$ref":"#/components/schemas/UserLookalikeSegmentResource"},{"type":"object","properties":{"minimum_score":{"type":"number","format":"float","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"provider_name":{"type":"string","readOnly":false},"mobile_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"organisation_id":{"type":"string","readOnly":false},"persisted":{"type":"boolean","default":false,"readOnly":false},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"last_warm_up_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"source_segment_id":{"type":"string","readOnly":false},"query_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"default_ttl":{"$ref":"#/components/schemas/Duration"},"status":{"$ref":"#/components/schemas/AudienceLookalikeStatus"},"emails_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"auto_description":{"type":"string","readOnly":false},"user_accounts_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"user_points_count_on_last_warm_up":{"type":"integer","format":"int32","default":0,"readOnly":true},"short_description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"default_lifetime":{"type":"integer","format":"int32","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"lookalike_algorithm":{"$ref":"#/components/schemas/AudienceLookalikeAlgorithm"},"extension_factor":{"type":"number","format":"float","default":0,"readOnly":false},"token":{"type":"string","readOnly":true},"paused":{"type":"boolean","default":false,"readOnly":false},"audience_metrics":{"type":"array","items":{"$ref":"#/components/schemas/AudienceMetricResource"},"readOnly":true},"mobile_ad_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"audience_partition_id":{"type":"string","readOnly":false},"desktop_cookie_ids_count":{"type":"integer","format":"int32","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"evaluation_mode":{"$ref":"#/components/schemas/AudienceSegmentEvaluationMode"}},"required":["audience_metrics","audience_partition_id","auto_description","creation_ts","datamart_id","evaluation_mode","id","last_modified_ts","lookalike_algorithm","name","organisation_id","paused","persisted","provider_name","query_id","short_description","source_segment_id","status","technical_name","token"]}]},"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-segment-and-feed-operations/segments.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.
