> 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/deprecated/audience-segments.md).

# Audience Segments

Operations related to Audience Segments, the user groups defined based on criteria for targeting and activation, supporting multiple types including Standard, Edge, Static, Lookalike, and Activation segments.

## GET /email\_campaigns/{campaign\_id}/email\_blasts/{blast\_id}/audience\_segments

> Get Audience Segment by Blast Campaign

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Audience Segments","description":"Operations related to Audience Segments, the user groups defined based on criteria for targeting and activation, supporting multiple types including Standard, Edge, Static, Lookalike, and Activation segments."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/email_campaigns/{campaign_id}/email_blasts/{blast_id}/audience_segments":{"get":{"tags":["Audience Segments"],"summary":"Get Audience Segment by Blast Campaign","description":"","operationId":"findAudienceSegmentEmailSelections","parameters":[{"required":true,"name":"campaign_id","in":"path","style":"simple","schema":{"type":"integer","format":"int64"},"explode":false},{"explode":false,"schema":{"type":"integer","format":"int64"},"in":"path","name":"blast_id","required":true,"style":"simple"}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"first_result":{"type":"integer"},"count":{"type":"integer"},"total":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/AudienceSegmentSelectionResource"}},"status":{"type":"string","enum":["ok"]},"max_results":{"type":"integer"}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"schemas":{"AudienceSegmentSelectionResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"audience_segment_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":true},"technical_name":{"type":"string","readOnly":true},"exclude":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_segment_id","exclude","id","name","technical_name"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /email\_campaigns/{campaign\_id}/email\_blasts/{blast\_id}/audience\_segments

> Create Audience Segment by Blast Campaign

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Audience Segments","description":"Operations related to Audience Segments, the user groups defined based on criteria for targeting and activation, supporting multiple types including Standard, Edge, Static, Lookalike, and Activation segments."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/email_campaigns/{campaign_id}/email_blasts/{blast_id}/audience_segments":{"post":{"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AudienceSegmentSelectionResource"}},"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":"","operationId":"createAudienceSegmentEmailSelection","summary":"Create Audience Segment by Blast Campaign","requestBody":{"description":"The Audience Segment to Create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceSegmentSelectionResource"}}},"required":true},"parameters":[{"schema":{"type":"integer","format":"int64"},"required":true,"name":"campaign_id","style":"simple","explode":false,"in":"path"},{"name":"blast_id","in":"path","style":"simple","schema":{"type":"integer","format":"int64"},"required":true,"explode":false}],"tags":["Audience Segments"]}}},"components":{"schemas":{"AudienceSegmentSelectionResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"audience_segment_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":true},"technical_name":{"type":"string","readOnly":true},"exclude":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_segment_id","exclude","id","name","technical_name"]},"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 /email\_campaigns/{campaign\_id}/email\_blasts/{blast\_id}/audience\_segments/{id}

> Find Audience Segment by Id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Audience Segments","description":"Operations related to Audience Segments, the user groups defined based on criteria for targeting and activation, supporting multiple types including Standard, Edge, Static, Lookalike, and Activation segments."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/email_campaigns/{campaign_id}/email_blasts/{blast_id}/audience_segments/{id}":{"get":{"description":"","operationId":"findAudienceSegmentEmailSelection","tags":["Audience Segments"],"parameters":[{"style":"simple","explode":false,"schema":{"type":"integer","format":"int64"},"name":"campaign_id","in":"path","required":true},{"style":"simple","name":"blast_id","in":"path","required":true,"explode":false,"schema":{"type":"integer","format":"int64"}},{"schema":{"type":"integer","format":"int64"},"in":"path","explode":false,"style":"simple","name":"id","required":true}],"summary":"Find Audience Segment by Id","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AudienceSegmentSelectionResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"schemas":{"AudienceSegmentSelectionResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"audience_segment_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":true},"technical_name":{"type":"string","readOnly":true},"exclude":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_segment_id","exclude","id","name","technical_name"]},"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 /email\_campaigns/{campaign\_id}/email\_blasts/{blast\_id}/audience\_segments/{id}

> Update Audience Segment by Id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Audience Segments","description":"Operations related to Audience Segments, the user groups defined based on criteria for targeting and activation, supporting multiple types including Standard, Edge, Static, Lookalike, and Activation segments."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/email_campaigns/{campaign_id}/email_blasts/{blast_id}/audience_segments/{id}":{"put":{"summary":"Update Audience Segment by Id","description":"","requestBody":{"description":"The Email Template to Update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceSegmentSelectionResource"}}},"required":true},"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AudienceSegmentSelectionResource"}},"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":true,"in":"path","name":"campaign_id","schema":{"type":"integer","format":"int64"},"style":"simple","explode":false},{"name":"blast_id","style":"simple","explode":false,"required":true,"schema":{"type":"integer","format":"int64"},"in":"path"},{"schema":{"type":"integer","format":"int64"},"in":"path","required":true,"explode":false,"style":"simple","name":"id"}],"operationId":"updateAudienceSegmentEmailSelection","tags":["Audience Segments"]}}},"components":{"schemas":{"AudienceSegmentSelectionResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"audience_segment_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":true},"technical_name":{"type":"string","readOnly":true},"exclude":{"type":"boolean","default":false,"readOnly":false}},"required":["audience_segment_id","exclude","id","name","technical_name"]},"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 /email\_campaigns/{campaign\_id}/email\_blasts/{blast\_id}/audience\_segments/{id}

> Find Audience Segment by Id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Audience Segments","description":"Operations related to Audience Segments, the user groups defined based on criteria for targeting and activation, supporting multiple types including Standard, Edge, Static, Lookalike, and Activation segments."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/email_campaigns/{campaign_id}/email_blasts/{blast_id}/audience_segments/{id}":{"delete":{"tags":["Audience Segments"],"description":"","operationId":"removeAudienceSegmentEmailSelection","parameters":[{"name":"campaign_id","explode":false,"schema":{"type":"integer","format":"int64"},"in":"path","style":"simple","required":true},{"required":true,"style":"simple","in":"path","schema":{"type":"integer","format":"int64"},"name":"blast_id","explode":false},{"explode":false,"required":true,"schema":{"type":"integer","format":"int64"},"in":"path","style":"simple","name":"id"}],"summary":"Find Audience Segment by Id","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"}}}}},"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"]}}}}
```


---

# 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/deprecated/audience-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.
