> 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/ad-exchanges.md).

# Ad Exchanges

Operations related to Ad Exchanges, the programmatic advertising platforms where ad inventory is bought and sold through Real Time Bidding (RTB). Enable connection to multiple ad exchanges for accessing diverse inventory sources, supporting bidding strategies, and executing Display Campaigns across DSPs, SSPs, and direct publisher integrations.

## GET /display\_campaigns/{campaign\_id}/ad\_groups/{ad\_group\_id}/ad\_exchanges

> find AdExchanges

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Ad Exchanges","description":"Operations related to Ad Exchanges, the programmatic advertising platforms where ad inventory is bought and sold through Real Time Bidding (RTB). Enable connection to multiple ad exchanges for accessing diverse inventory sources, supporting bidding strategies, and executing Display Campaigns across DSPs, SSPs, and direct publisher integrations."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/display_campaigns/{campaign_id}/ad_groups/{ad_group_id}/ad_exchanges":{"get":{"description":"","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"first_result":{"type":"integer"},"count":{"type":"integer"},"max_results":{"type":"integer"},"total":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/AdExchangeSelectionResource"}}},"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"}},"tags":["Ad Exchanges"],"summary":"find AdExchanges","operationId":"findAdExchangeSelections","parameters":[{"schema":{"type":"integer","format":"int64"},"required":true,"style":"simple","explode":false,"name":"campaign_id","in":"path"},{"style":"simple","explode":false,"in":"path","required":true,"schema":{"type":"integer","format":"int64"},"name":"ad_group_id"}]}}},"components":{"schemas":{"AdExchangeSelectionResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"ad_group_id":{"type":"string","readOnly":false},"ad_exchange_id":{"type":"string","readOnly":false},"exclude":{"type":"boolean","default":false,"readOnly":false}},"required":["ad_exchange_id","ad_group_id","exclude","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"}}}}}}}
```

## POST /display\_campaigns/{campaign\_id}/ad\_groups/{ad\_group\_id}/ad\_exchanges

> Create an AdExchange

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Ad Exchanges","description":"Operations related to Ad Exchanges, the programmatic advertising platforms where ad inventory is bought and sold through Real Time Bidding (RTB). Enable connection to multiple ad exchanges for accessing diverse inventory sources, supporting bidding strategies, and executing Display Campaigns across DSPs, SSPs, and direct publisher integrations."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/display_campaigns/{campaign_id}/ad_groups/{ad_group_id}/ad_exchanges":{"post":{"requestBody":{"description":"The ad exchange selection to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdExchangeSelectionResource"}}},"required":true},"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AdExchangeSelectionResource"}},"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":["Ad Exchanges"],"summary":"Create an AdExchange","operationId":"createAdExchangeSelection","parameters":[{"schema":{"type":"integer","format":"int64"},"name":"campaign_id","explode":false,"required":true,"style":"simple","in":"path"},{"in":"path","required":true,"schema":{"type":"integer","format":"int64"},"explode":false,"name":"ad_group_id","style":"simple"}],"description":""}}},"components":{"schemas":{"AdExchangeSelectionResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"ad_group_id":{"type":"string","readOnly":false},"ad_exchange_id":{"type":"string","readOnly":false},"exclude":{"type":"boolean","default":false,"readOnly":false}},"required":["ad_exchange_id","ad_group_id","exclude","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 /display\_campaigns/{campaign\_id}/ad\_groups/{ad\_group\_id}/ad\_exchanges/{id}

> find an ad exchange selection

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Ad Exchanges","description":"Operations related to Ad Exchanges, the programmatic advertising platforms where ad inventory is bought and sold through Real Time Bidding (RTB). Enable connection to multiple ad exchanges for accessing diverse inventory sources, supporting bidding strategies, and executing Display Campaigns across DSPs, SSPs, and direct publisher integrations."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/display_campaigns/{campaign_id}/ad_groups/{ad_group_id}/ad_exchanges/{id}":{"get":{"tags":["Ad Exchanges"],"operationId":"findAdExchangeSelection","description":"","summary":"find an ad exchange selection","parameters":[{"in":"path","style":"simple","required":true,"name":"campaign_id","schema":{"type":"integer","format":"int64"},"explode":false},{"required":true,"style":"simple","in":"path","explode":false,"name":"ad_group_id","schema":{"type":"integer","format":"int64"}},{"in":"path","style":"simple","name":"id","explode":false,"required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AdExchangeSelectionResource"}},"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":{"AdExchangeSelectionResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"ad_group_id":{"type":"string","readOnly":false},"ad_exchange_id":{"type":"string","readOnly":false},"exclude":{"type":"boolean","default":false,"readOnly":false}},"required":["ad_exchange_id","ad_group_id","exclude","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"}}}}}}}
```

## PUT /display\_campaigns/{campaign\_id}/ad\_groups/{ad\_group\_id}/ad\_exchanges/{id}

> Update an a ad exchange selection

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Ad Exchanges","description":"Operations related to Ad Exchanges, the programmatic advertising platforms where ad inventory is bought and sold through Real Time Bidding (RTB). Enable connection to multiple ad exchanges for accessing diverse inventory sources, supporting bidding strategies, and executing Display Campaigns across DSPs, SSPs, and direct publisher integrations."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/display_campaigns/{campaign_id}/ad_groups/{ad_group_id}/ad_exchanges/{id}":{"put":{"summary":"Update an a ad exchange selection","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AdExchangeSelectionResource"}},"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":"","requestBody":{"description":"The ad exchange selection to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdExchangeSelectionResource"}}},"required":true},"parameters":[{"style":"simple","in":"path","name":"campaign_id","required":true,"explode":false,"schema":{"type":"integer","format":"int64"}},{"style":"simple","in":"path","schema":{"type":"integer","format":"int64"},"required":true,"explode":false,"name":"ad_group_id"},{"in":"path","style":"simple","schema":{"type":"integer","format":"int64"},"required":true,"explode":false,"name":"id"}],"operationId":"updateAdExchangeSelection","tags":["Ad Exchanges"]}}},"components":{"schemas":{"AdExchangeSelectionResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"ad_group_id":{"type":"string","readOnly":false},"ad_exchange_id":{"type":"string","readOnly":false},"exclude":{"type":"boolean","default":false,"readOnly":false}},"required":["ad_exchange_id","ad_group_id","exclude","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"}}}}}}}
```

## DELETE /display\_campaigns/{campaign\_id}/ad\_groups/{ad\_group\_id}/ad\_exchanges/{id}

> Removes an ad exchange selection

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Ad Exchanges","description":"Operations related to Ad Exchanges, the programmatic advertising platforms where ad inventory is bought and sold through Real Time Bidding (RTB). Enable connection to multiple ad exchanges for accessing diverse inventory sources, supporting bidding strategies, and executing Display Campaigns across DSPs, SSPs, and direct publisher integrations."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/display_campaigns/{campaign_id}/ad_groups/{ad_group_id}/ad_exchanges/{id}":{"delete":{"parameters":[{"name":"campaign_id","in":"path","explode":false,"style":"simple","required":true,"schema":{"type":"integer","format":"int64"}},{"schema":{"type":"integer","format":"int64"},"name":"ad_group_id","explode":false,"in":"path","style":"simple","required":true},{"schema":{"type":"integer","format":"int64"},"in":"path","required":true,"explode":false,"name":"id","style":"simple"}],"operationId":"removeAdExchangeSelection","summary":"Removes an ad exchange selection","tags":["Ad Exchanges"],"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"}},"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"]}}}}
```


---

# 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/ad-exchanges.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.
