> 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/display-campaign/goal-selections.md).

# Goal Selections

Operations related to Goal Selections that define conversion tracking and optimization objectives for campaigns. Enable association of specific Goals with campaigns for performance measurement, attribution modeling, and bid optimization. Support multiple goal selections per campaign with different weightings for multi-objective optimization strategies.

## GET /campaigns/{campaign\_id}/goal\_selections

> Search goal selections

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Goal Selections","description":"Operations related to Goal Selections that define conversion tracking and optimization objectives for campaigns. Enable association of specific Goals with campaigns for performance measurement, attribution modeling, and bid optimization. Support multiple goal selections per campaign with different weightings for multi-objective optimization strategies."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/campaigns/{campaign_id}/goal_selections":{"get":{"description":"","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GoalSelectionResource"}},"first_result":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"total":{"type":"integer"},"max_results":{"type":"integer"},"count":{"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"}},"operationId":"findGoalSelections","tags":["Goal Selections"],"summary":"Search goal selections","parameters":[{"explode":false,"in":"path","name":"campaign_id","description":"The campaign owning the goal selections","schema":{"type":"integer","format":"int64"},"style":"simple","required":true},{"style":"form","in":"query","name":"first_result","required":false,"schema":{"type":"integer","format":"int32"},"explode":true,"description":"Offset from which the search must be performed"},{"explode":true,"name":"max_results","required":false,"description":"Number of maximum items that shall be return by this search","schema":{"type":"integer","format":"int32"},"style":"form","in":"query"}]}}},"components":{"schemas":{"GoalSelectionResource":{"type":"object","properties":{"goal_selection_type":{"$ref":"#/components/schemas/GoalSelectionType"},"default":{"type":"boolean","default":false,"readOnly":false},"goal_id":{"type":"string","readOnly":false},"goal_name":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true}},"required":["default","goal_id","goal_name","goal_selection_type","id"]},"GoalSelectionType":{"type":"string","enum":["CLICK_ON_AD","VISIT_SITE","CONVERSION"],"readOnly":false},"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 /campaigns/{campaign\_id}/goal\_selections

> Create goal selection

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Goal Selections","description":"Operations related to Goal Selections that define conversion tracking and optimization objectives for campaigns. Enable association of specific Goals with campaigns for performance measurement, attribution modeling, and bid optimization. Support multiple goal selections per campaign with different weightings for multi-objective optimization strategies."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/campaigns/{campaign_id}/goal_selections":{"post":{"summary":"Create goal selection","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/GoalSelectionResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"description":"","tags":["Goal Selections"],"requestBody":{"description":"The goal selection to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoalSelectionResource"}}},"required":true},"operationId":"createGoalSelection","parameters":[{"name":"campaign_id","style":"simple","explode":false,"in":"path","description":"The campaign owning the goal selections","schema":{"type":"integer","format":"int64"},"required":true}]}}},"components":{"schemas":{"GoalSelectionResource":{"type":"object","properties":{"goal_selection_type":{"$ref":"#/components/schemas/GoalSelectionType"},"default":{"type":"boolean","default":false,"readOnly":false},"goal_id":{"type":"string","readOnly":false},"goal_name":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true}},"required":["default","goal_id","goal_name","goal_selection_type","id"]},"GoalSelectionType":{"type":"string","enum":["CLICK_ON_AD","VISIT_SITE","CONVERSION"],"readOnly":false},"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 /campaigns/{campaign\_id}/goal\_selections/{id}

> Get goal selection by id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Goal Selections","description":"Operations related to Goal Selections that define conversion tracking and optimization objectives for campaigns. Enable association of specific Goals with campaigns for performance measurement, attribution modeling, and bid optimization. Support multiple goal selections per campaign with different weightings for multi-objective optimization strategies."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/campaigns/{campaign_id}/goal_selections/{id}":{"get":{"tags":["Goal Selections"],"operationId":"getGoalSelection","summary":"Get goal selection by id","parameters":[{"schema":{"type":"integer","format":"int64"},"description":"The campaign owning the goal selections","in":"path","name":"campaign_id","required":true,"explode":false,"style":"simple"},{"in":"path","required":true,"schema":{"type":"integer","format":"int64"},"style":"simple","name":"id","description":"The id of the goal selection the campaign","explode":false}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/GoalSelectionResource"}},"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":{"GoalSelectionResource":{"type":"object","properties":{"goal_selection_type":{"$ref":"#/components/schemas/GoalSelectionType"},"default":{"type":"boolean","default":false,"readOnly":false},"goal_id":{"type":"string","readOnly":false},"goal_name":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true}},"required":["default","goal_id","goal_name","goal_selection_type","id"]},"GoalSelectionType":{"type":"string","enum":["CLICK_ON_AD","VISIT_SITE","CONVERSION"],"readOnly":false},"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 /campaigns/{campaign\_id}/goal\_selections/{id}

> Update goal selection

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Goal Selections","description":"Operations related to Goal Selections that define conversion tracking and optimization objectives for campaigns. Enable association of specific Goals with campaigns for performance measurement, attribution modeling, and bid optimization. Support multiple goal selections per campaign with different weightings for multi-objective optimization strategies."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/campaigns/{campaign_id}/goal_selections/{id}":{"put":{"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/GoalSelectionResource"}},"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"}},"requestBody":{"description":"The goal selection to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoalSelectionResource"}}},"required":true},"parameters":[{"schema":{"type":"integer","format":"int64"},"explode":false,"description":"The campaign owning the goal selections","style":"simple","in":"path","name":"campaign_id","required":true},{"explode":false,"style":"simple","schema":{"type":"integer","format":"int64"},"name":"id","in":"path","description":"The id of the goal selection the campaign","required":true}],"operationId":"updateGoalSelection","tags":["Goal Selections"],"description":"","summary":"Update goal selection"}}},"components":{"schemas":{"GoalSelectionResource":{"type":"object","properties":{"goal_selection_type":{"$ref":"#/components/schemas/GoalSelectionType"},"default":{"type":"boolean","default":false,"readOnly":false},"goal_id":{"type":"string","readOnly":false},"goal_name":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true}},"required":["default","goal_id","goal_name","goal_selection_type","id"]},"GoalSelectionType":{"type":"string","enum":["CLICK_ON_AD","VISIT_SITE","CONVERSION"],"readOnly":false},"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 /campaigns/{campaign\_id}/goal\_selections/{id}

> Delete goal selection

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Goal Selections","description":"Operations related to Goal Selections that define conversion tracking and optimization objectives for campaigns. Enable association of specific Goals with campaigns for performance measurement, attribution modeling, and bid optimization. Support multiple goal selections per campaign with different weightings for multi-objective optimization strategies."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/campaigns/{campaign_id}/goal_selections/{id}":{"delete":{"tags":["Goal Selections"],"description":"","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"}},"summary":"Delete goal selection","parameters":[{"name":"campaign_id","required":true,"description":"The campaign owning the goal selections","style":"simple","schema":{"type":"integer","format":"int64"},"in":"path","explode":false},{"description":"The id of the goal selection the campaign","explode":false,"name":"id","schema":{"type":"integer","format":"int64"},"in":"path","style":"simple","required":true}],"operationId":"deleteGoalSelection"}}},"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/display-campaign/goal-selections.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.
