---
title: "POST /v4/customBiddingAlgorithms/{+customBiddingAlgorithmId}/rules"
method: POST
path: "/v4/customBiddingAlgorithms/{+customBiddingAlgorithmId}/rules"
tags: ["customBiddingAlgorithms"]
---

# POST /v4/customBiddingAlgorithms/{+customBiddingAlgorithmId}/rules

`POST /v4/customBiddingAlgorithms/{+customBiddingAlgorithmId}/rules`

Creates a new rules resource. Returns the newly created rules resource if successful. Requests creating a custom bidding rules resource under an algorithm assigned to a line item will return an error.

## Path parameters

- `customBiddingAlgorithmId` string, required

## Query parameters

- `advertiserId` string
- `partnerId` string

## Request body

- CustomBiddingAlgorithmRules — A single custom bidding algorithm rules.
  - `customBiddingAlgorithmId` string, int64 — Output only. The unique ID of the custom bidding algorithm that the rules resource belongs to.
  - `createTime` string, google-datetime — Output only. The time when the rules resource was created.
  - `error` CustomBiddingAlgorithmRulesError — An error message for a CustomBiddingAlgorithmRules resource.
    - `errorCode` 'ERROR_CODE_UNSPECIFIED' | 'SYNTAX_ERROR' | 'CONSTRAINT_VIOLATION_ERROR' | 'INTERNAL_ERROR' — The type of error.
  - `customBiddingAlgorithmRulesId` string, int64 — Output only. The unique ID of the rules resource.
  - `name` string — Output only. The resource name of the rules resource.
  - `state` 'STATE_UNSPECIFIED' | 'ACCEPTED' | 'REJECTED' — Output only. The state of the rules resource.
  - `active` boolean — Output only. Whether the rules resource is currently being used for scoring by the parent algorithm.
  - `rules` CustomBiddingAlgorithmRulesRef — The reference to the uploaded AlgorithmRules file. Retrieve the location to upload new AlgorithmRules file to using customBiddingAlgorithms.uploadRules.
    - `resourceName` string — A resource name to be used in media.download to download the rules files. Or media.upload to upload the rules files. Resource names have the format `customBiddingAlgorithms/{custom_bidding_algorithm_id}/rulesRef/{ref_id}`.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/displayvideo.md) · [All operations](https://skmtc.dev/google/apis/displayvideo/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/displayvideo/revisions/68b64e49eced/schema)
