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

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

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

Creates a new custom bidding script. Returns the newly created script if successful. Requests creating a custom bidding script 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

- CustomBiddingScript — A single custom bidding script.
  - `script` CustomBiddingScriptRef — The reference to the uploaded custom bidding script file.
    - `resourceName` string — A resource name to be used in media.download to Download the script files. Or media.upload to Upload the script files. Resource names have the format `customBiddingAlgorithms/{custom_bidding_algorithm_id}/scriptRef/{ref_id}`.
  - `customBiddingAlgorithmId` string, int64 — Output only. The unique ID of the custom bidding algorithm the script belongs to.
  - `customBiddingScriptId` string, int64 — Output only. The unique ID of the custom bidding script.
  - `createTime` string, google-datetime — Output only. The time when the script was created.
  - `active` boolean — Output only. Whether the script is currently being used for scoring by the parent algorithm.
  - `errors` ScriptError[] — Output only. Error details of a rejected custom bidding script. This field will only be populated when state is REJECTED.
    - `errorCode` 'ERROR_CODE_UNSPECIFIED' | 'SYNTAX_ERROR' | 'DEPRECATED_SYNTAX' | 'INTERNAL_ERROR' — The type of error.
    - `line` string, int64 — The line number in the script where the error was thrown.
    - `column` string, int64 — The column number in the script where the error was thrown.
    - `errorMessage` string — The detailed error message.
  - `name` string — Output only. The resource name of the custom bidding script.
  - `state` 'STATE_UNSPECIFIED' | 'ACCEPTED' | 'REJECTED' | 'PENDING' — Output only. The state of the custom bidding script.

## 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)
