# BYOA

# Custom Brain

Custom Brain allows the client to use the BYOA API to upload a set of logistic coefficients corresponding to any of the variables currently in use by the MediaMath Brain.  These coefficients will then be used by participating strategies to calculate the predicted response rate for each impression.  The bidder will calculate bid price by multipling the predicted response rate by the strategy's goal value.  Goal values can be modified using the MediaMath Platform campaign management API.

It is best for you to contact us early in your process by emailing developers@mediamath.com, as it may take about 48 hours before you are granted API access to begin work on your model.

![BYOM](https://mediamath.github.io/api-docs/images/BYOA-CustomBrain.png "BYOM Architecture")

License: Apache 2.0

## Servers

```
https://api.byoa.mediamath.com
```

## Security

### adama-session-header

Authentication is provided through OAuth2. You'll need to request a Client ID and Secret key.

After Authentication is established make a request to https://api.mediamath.com/api/v2.0/session with the Authorization:"Bearer ACCESS_TOKEN header, and copy the adama_session cookie header from the response. Use both the Authorization:"Bearer ACCESS_TOKEN" header and adama_session= cookie in all future requests

Type: apiKey
In: header
Name: adama_session

### oauth2

exchange an Authorization Code for a Token

Type: oauth2
Token URL: https://auth.mediamath.com/oath/token
Scopes:

## Download OpenAPI description

 - [BYOA](https://apidocs.mediamath.com/_bundle/apis/byoa-api.yaml)

## Campaign Settings

 - [GET /campaign_settings/{campaign_id}/strategies/{strategy_id}](https://apidocs.mediamath.com/apis/byoa-api/campaign-settings/get_campaign_settings-campaign_id-strategies-strategy_id.md): Get strategy level Campaign Setting
 - [DELETE /campaign_settings/{campaign_id}/strategies/{strategy_id}](https://apidocs.mediamath.com/apis/byoa-api/campaign-settings/delete_campaign_settings-campaign_id-strategies-strategy_id.md): Delete Campaign Setting with Campaign, Strategy No request body for this type.
 - [PUT /campaign_settings/{campaign_id}/strategies/{strategy_id}](https://apidocs.mediamath.com/apis/byoa-api/campaign-settings/put_campaign_settings-campaign_id-strategies-strategy_id.md): Configure BYOA functionality at a Strategy Level for a Campaign
 - [DELETE /campaign_settings/{campaign_id}](https://apidocs.mediamath.com/apis/byoa-api/campaign-settings/delete_campaign_settings-campaign_id.md): Delete a Campaign There is no request body for this endpoint command.
 - [PUT /campaign_settings/{campaign_id}](https://apidocs.mediamath.com/apis/byoa-api/campaign-settings/put_campaign_settings-campaign_id.md): Configure BYOA functionality at a Campaign Level
 - [GET /campaign_settings/{campaign_id}](https://apidocs.mediamath.com/apis/byoa-api/campaign-settings/get_campaign_settings-campaign_id.md): Get details on BYOA settings for a campaign Query parameters like page_limit and with and sort_by do not work
## Custom Bid Router

 - [GET /custombidrouter/{org_id}/configuration](https://apidocs.mediamath.com/apis/byoa-api/custom-bid-router/summary-bidvaluator-organization.md): Get a summary of the service consisting of the defined executors, environments, and endpoints. This summary will help you identify that you have correctly configured all your endpoints for all the reg
 - [GET /custombidrouter/{org_id}/executors/{executor_id}](https://apidocs.mediamath.com/apis/byoa-api/custom-bid-router/get-executor-details.md): The details of the Custom Bid Router executor and all attached Endpoints
 - [PATCH /custombidrouter/{org_id}/executors/{executor_id}](https://apidocs.mediamath.com/apis/byoa-api/custom-bid-router/patch-executor-details.md): The sample rate defines the percentage of the bid opportunities that are forwarded to your endpoints. The sample rate can be adjusted by the client collectively for all endpoints of an executor. This
## Custom Brain

 - [DELETE /data/{namespace}/models/{model_id}](https://apidocs.mediamath.com/apis/byoa-api/custom-brain/delete_data-namespace-models-model_id.md): Delete a model
 - [GET /data/{namespace}/models/{model_id}](https://apidocs.mediamath.com/apis/byoa-api/custom-brain/get_data-namespace-models-model_id.md): Get Model details
 - [PUT /data/{namespace}/models/{model_id}](https://apidocs.mediamath.com/apis/byoa-api/custom-brain/put_data-namespace-models-model_id.md): Upload Model data
 - [GET /data/decode/{namespace}/models/{model_id}](https://apidocs.mediamath.com/apis/byoa-api/custom-brain/get_data-decode-namespace-models-model_id.md): Get Model details
 - [GET /data/{namespace}](https://apidocs.mediamath.com/apis/byoa-api/custom-brain/get_data-namespace.md): Get all Models and data for a specific namespace
