# 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/_spec/apis/byoa-api.yaml) ## Campaign Settings BYOA (Bring Your Own Algorithm) allows advertisers to apply their own bidding algorithms within MediaMath. The participating campaigns and strategies are configured with the BYOA Campaign Settings ### Strategy based Campaign Details - [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 ### Strategy based Campaign Delete - [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. ### Strategy based Campaign Create/Modify - [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 ### Campaign Delete - [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. ### Campaign Create/Modify - [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 ### Campaign Details - [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 Custom Bid Router further extends the BYOA architecture allowing advertisers to apply their own bidding algorithms in their own ecosystem. The MediaMath system will invoke an external call to the client with the bid request and await a response that MediaMath can use in our internal auction. Forwarded bid requests adhere to OpenRTB v2.4 format and may be enriched with certain information such as segment membership and pixel recency. ### Configuration Summary - [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 regions ### Executor Details - [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 ### Executor Update - [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 feature is useful to manage and budget system utilization. ## Custom Brain In Customized Brain, the client uses 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 multiplying the predicted response rate by the strategy's goal value. Goal values can be modified using the T1 campaign management API. ### Model Data Delete - [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 ### Model Data Details - [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 ### Model Data Create/Modify - [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 ### Model Data Decode - [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 ### Model Data Details for Namespace - [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