> [!WARNING]
> Display \& Video 360 API v5 is currently in beta.

- [Resource: CustomBiddingAlgorithmRules](https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#CustomBiddingAlgorithmRules)
  - [JSON representation](https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#CustomBiddingAlgorithmRules.SCHEMA_REPRESENTATION)
- [State](https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#State)
- [CustomBiddingAlgorithmRulesError](https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#CustomBiddingAlgorithmRulesError)
  - [JSON representation](https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#CustomBiddingAlgorithmRulesError.SCHEMA_REPRESENTATION)
- [ErrorCode](https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#ErrorCode)
- [CustomBiddingAlgorithmRulesRef](https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#CustomBiddingAlgorithmRulesRef)
  - [JSON representation](https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#CustomBiddingAlgorithmRulesRef.SCHEMA_REPRESENTATION)
- [Methods](https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#METHODS_SUMMARY)

## Resource: CustomBiddingAlgorithmRules

A single custom bidding algorithm rules.

| JSON representation |
|---|
| ``` { "name": string, "customBiddingAlgorithmId": string, "customBiddingAlgorithmRulesId": string, "createTime": string, "active": boolean, "state": enum (`https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#State`), "error": { object (`https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#CustomBiddingAlgorithmRulesError`) }, "rules": { object (`https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#CustomBiddingAlgorithmRulesRef`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. The resource name of the rules resource. |
| `customBiddingAlgorithmId` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The unique ID of the custom bidding algorithm that the rules resource belongs to. |
| `customBiddingAlgorithmRulesId` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The unique ID of the rules resource. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time when the rules resource was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `active` | `boolean` Output only. Whether the rules resource is currently being used for scoring by the parent algorithm. |
| `state` | ``enum (`https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#State`)`` Output only. The state of the rules resource. |
| `error` | ``object (`https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#CustomBiddingAlgorithmRulesError`)`` Output only. Error code of the rejected rules resource. This field will only be populated when the state is `REJECTED`. |
| `rules` | ``object (`https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#CustomBiddingAlgorithmRulesRef`)`` Required. Immutable. The reference to the uploaded `https://developers.google.com/display-video/api/reference/rest/v5/AlgorithmRules` file. |

## State

Possible states of a `https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#CustomBiddingAlgorithmRules` resource.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | The rules state are unspecified or unknown in this version. |
| `ACCEPTED` | The rules have been accepted for scoring impressions. |
| `REJECTED` | The rules have been rejected by backend pipelines. They may have errors. |

## CustomBiddingAlgorithmRulesError

An error message for a `https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#CustomBiddingAlgorithmRules` resource.

| JSON representation |
|---|
| ``` { "errorCode": enum (`https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#ErrorCode`) } ``` |

| Fields ||
|---|---|
| `errorCode` | ``enum (`https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#ErrorCode`)`` The type of error. |

## ErrorCode

Possible error codes of a `https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules#CustomBiddingAlgorithmRules` resource.

| Enums ||
|---|---|
| `ERROR_CODE_UNSPECIFIED` | The error is not specified or is unknown in this version. |
| `SYNTAX_ERROR` | The rules have a syntax error. |
| `CONSTRAINT_VIOLATION_ERROR` | The rules have a constraint violation error. |
| `INTERNAL_ERROR` | Internal errors were thrown while processing the rules. |

## CustomBiddingAlgorithmRulesRef

The reference to the uploaded `https://developers.google.com/display-video/api/reference/rest/v5/AlgorithmRules` file. Retrieve the location to upload new `https://developers.google.com/display-video/api/reference/rest/v5/AlgorithmRules` file to using `https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms/uploadRules#google.ads.displayvideo.v5.CustomBiddingAlgorithmRulesService.StartUploadAlgorithmRules`.

| JSON representation |
|---|
| ``` { "resourceName": string } ``` |

| Fields ||
|---|---|
| `resourceName` | `string` A resource name to be used in `https://developers.google.com/display-video/api/reference/rest/v5/media/download#google.bytestream.RestByteStream.GetMedia` to download the rules files. Or `https://developers.google.com/display-video/api/reference/rest/v5/media/upload#google.bytestream.RestByteStream.UpdateMedia` to upload the rules files. Resource names have the format `customBiddingAlgorithms/{customBiddingAlgorithmId}/rulesRef/{ref_id}`. |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules/create` | Creates a new rules resource. |
| ### `https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules/get` | Retrieves a rules resource. |
| ### `https://developers.google.com/display-video/api/reference/rest/v5/customBiddingAlgorithms.rules/list` | Lists rules resources that belong to the given algorithm. |