# REST Resource: customBiddingAlgorithms

> [!WARNING]
> Display \& Video 360 API v2 has sunset.

- [Resource: CustomBiddingAlgorithm](https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#CustomBiddingAlgorithm)
  - [JSON representation](https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#CustomBiddingAlgorithm.SCHEMA_REPRESENTATION)
- [CustomBiddingAlgorithmType](https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#CustomBiddingAlgorithmType)
- [CustomBiddingModelDetails](https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#CustomBiddingModelDetails)
  - [JSON representation](https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#CustomBiddingModelDetails.SCHEMA_REPRESENTATION)
- [ReadinessState](https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#ReadinessState)
- [SuspensionState](https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#SuspensionState)
- [Methods](https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#METHODS_SUMMARY)

## Resource: CustomBiddingAlgorithm

A single custom bidding algorithm.

| JSON representation |
|---|
| ``` { "name": string, "customBiddingAlgorithmId": string, "displayName": string, "entityStatus": enum (`https://developers.google.com/display-video/api/reference/rest/v2/EntityStatus`), "customBiddingAlgorithmType": enum (`https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#CustomBiddingAlgorithmType`), "sharedAdvertiserIds": [ string ], "modelDetails": [ { object (`https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#CustomBiddingModelDetails`) } ], // Union field `owner` can be only one of the following: "partnerId": string, "advertiserId": string // End of list of possible types for union field `owner`. } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. The resource name of the custom bidding algorithm. |
| `customBiddingAlgorithmId` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The unique ID of the custom bidding algorithm. Assigned by the system. |
| `displayName` | `string` Required. The display name of the custom bidding algorithm. Must be UTF-8 encoded with a maximum size of 240 bytes. |
| `entityStatus` | ``enum (`https://developers.google.com/display-video/api/reference/rest/v2/EntityStatus`)`` Controls whether or not the custom bidding algorithm can be used as a bidding strategy. Accepted values are: - `ENTITY_STATUS_ACTIVE` - `ENTITY_STATUS_ARCHIVED` |
| `customBiddingAlgorithmType` | ``enum (`https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#CustomBiddingAlgorithmType`)`` Required. Immutable. The type of custom bidding algorithm. |
| `sharedAdvertiserIds[]` | `string (https://developers.google.com/discovery/v1/type-format format)` The IDs of the advertisers who have access to this algorithm. If `https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#CustomBiddingAlgorithm.FIELDS.advertiser_id` is set, this field will only consist of that value. This field will not be set if the algorithm [`owner`](https://developers.google.com/display-video/api/reference/rest/v1/customBiddingAlgorithms#CustomBiddingAlgorithm.FIELDS.oneof_owner) is a partner and is being retrieved using an advertiser [`accessor`](https://developers.google.com/display-video/api/reference/rest/v1/customBiddingAlgorithms/list#body.QUERY_PARAMETERS.oneof_accessor). |
| `modelDetails[]` | ``object (`https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#CustomBiddingModelDetails`)`` Output only. The details of custom bidding models for each advertiser who has access. This field may only include the details of the queried advertiser if the algorithm [`owner`](https://developers.google.com/display-video/api/reference/rest/v1/customBiddingAlgorithms#CustomBiddingAlgorithm.FIELDS.oneof_owner) is a partner and is being retrieved using an advertiser [`accessor`](https://developers.google.com/display-video/api/reference/rest/v1/customBiddingAlgorithms/list#body.QUERY_PARAMETERS.oneof_accessor). |
| Union field `owner`. Identifies the DV360 entity that owns the custom bidding algorithm. It can be either a partner or an advertiser. `owner` can be only one of the following: ||
| `partnerId` | `string (https://developers.google.com/discovery/v1/type-format format)` Immutable. The unique ID of the partner that owns the custom bidding algorithm. |
| `advertiserId` | `string (https://developers.google.com/discovery/v1/type-format format)` Immutable. The unique ID of the advertiser that owns the custom bidding algorithm. |

## CustomBiddingAlgorithmType

Possible types of custom bidding algorithms.

| Enums ||
|---|---|
| `CUSTOM_BIDDING_ALGORITHM_TYPE_UNSPECIFIED` | Algorithm type is not specified or is unknown in this version. |
| `SCRIPT_BASED` | Algorithm generated through customer-uploaded custom bidding script files. |
| `ADS_DATA_HUB_BASED` | Algorithm created through Ads Data Hub product. |
| `GOAL_BUILDER_BASED` | Algorithm created through goal builder in DV3 UI. |

## CustomBiddingModelDetails

The details of a custom bidding algorithm model for a single shared advertiser.

| JSON representation |
|---|
| ``` { "advertiserId": string, "readinessState": enum (`https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#ReadinessState`), "suspensionState": enum (`https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#SuspensionState`) } ``` |

| Fields ||
|---|---|
| `advertiserId` | `string (https://developers.google.com/discovery/v1/type-format format)` The unique ID of the relevant advertiser. |
| `readinessState` | ``enum (`https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#ReadinessState`)`` The readiness state of custom bidding model. |
| `suspensionState` | ``enum (`https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#SuspensionState`)`` Output only. The suspension state of custom bidding model. |

## ReadinessState

Possible states of model readiness.

| Enums ||
|---|---|
| `READINESS_STATE_UNSPECIFIED` | State is not specified or is unknown in this version. |
| `READINESS_STATE_ACTIVE` | The model is trained and ready for serving. |
| `READINESS_STATE_INSUFFICIENT_DATA` | There is not enough data to train the serving model. |
| `READINESS_STATE_TRAINING` | The model is training and not ready for serving. |
| `READINESS_STATE_NO_VALID_SCRIPT` | A valid custom bidding script has not been provided with which to train the model. This state will only be applied to algorithms whose `https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms#CustomBiddingAlgorithm.FIELDS.custom_bidding_algorithm_type` is `SCRIPT_BASED`. |

## SuspensionState

Possible suspension states of custom bidding models.

| Enums ||
|---|---|
| `SUSPENSION_STATE_UNSPECIFIED` | State is not specified or is unknown in this version. |
| `SUSPENSION_STATE_ENABLED` | Model is enabled, either recently used, currently used or scheduled to be used. The algorithm is actively scoring impressions for this advertiser. |
| `SUSPENSION_STATE_DORMANT` | Model has not been used recently. Although the model still acts as `ENABLED`, it will eventually be suspended if not used. |
| `SUSPENSION_STATE_SUSPENDED` | Model is suspended from scoring impressions and cannot serve. If the algorithm is assigned to a line item under this advertiser or otherwise updated, it will switch back to the `ENABLED` state and require time to prepare the serving model again. |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms/create` | Creates a new custom bidding algorithm. |
| ### `https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms/get` | Gets a custom bidding algorithm. |
| ### `https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms/list` | Lists custom bidding algorithms that are accessible to the current user and can be used in bidding stratgies. |
| ### `https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms/patch` | Updates an existing custom bidding algorithm. |
| ### `https://developers.google.com/display-video/api/reference/rest/v2/customBiddingAlgorithms/uploadScript` | Creates a custom bidding script reference object for a script file. |