Use the Custom Bidding API, available as an endpoint on the trafficking API, to create a custom bidding rule that can be assigned to a line.
The following HTTP methods can be used:
Use the
GETmethod to read existing custom bidding rules by Account ID, Name or ID.Use the
GETmethod to read lines associated with a custom bidding rule.Use the
POSTmethod to create a custom bidding rule.Use the
PUTmethod to update an existing custom bidding rule.Use the
DELETEmethod to remove an existing custom bidding rule.Use the
PUTmethod on thelinesendpoint to assign or remove a custom bidding rule from a line.
Resources
traffic/v3/byoa
The byoa object contains the following fields.
Request Parameters
Parameter | Definition | Data Type | Create | Update |
|---|---|---|---|---|
| The unique identifier for the custom bidding rule. |
| Not Required / NA | Required |
| The base64 encoded rule file. |
| Required | Required |
| The ID of the advertiser. |
| Required | Required |
| The name of the custom bidding rule. |
| Required | Required |
| The name of the uploaded file. |
| Required | Required |
Response Parameters
Parameter | Definition | Data Type |
|---|---|---|
| This is the status of your custom bidding rule.
|
|
| This is the version of the uploaded rule. The most recent version will have the larger version number. |
|
| This is a list of lines that are using the custom bidding rule. Will be a list of Line IDs |
|
| The unique identifier for the custom bidding rule. |
|
| The ID of the advertiser. |
|
| The name of the custom bidding rule. |
|
| The URL of the file used for this rule. |
|
Read Custom Bidding Rules by Account ID, Name or ID
Read All Custom Bidding Rules for an Advertiser by Account ID With Max Version
Get all custom bidding rules for an advertiser by account ID. The latest version of each rule is returned.
GET traffic/v3/byoa/account/{accountId}Parameters
Parameters | Parameter Type | Description | Data Type | Required |
|---|---|---|---|---|
| path | The ID of the advertiser. |
| Y |
Sample Request
GET traffic/v3/byoa/account/987654321Sample Response
[
{"id": 1,accountId:2397,name:"cb_nyc_apr-2018",version: 1, inputFileUrl:"http://yahooo.s3/file1.rule"},
{"id": 2,accountId:2397,name:"cb_nyc_mar_2018",version: 1, inputFileUrl:"http://yahooo.s3/file2.rule"},
{"id": 3,accountId:2397,name:"cb_nyc_103_2018",version: 1, inputFileUrl:"http://yahooo.s3/file3.rule"} ]Read All Custom Bidding Rules by Name
Get a list of all custom bidding rules by name for the account. In case the custom bidding rule has been modified, all the different versions will be returned.
GET traffic/v3/byoa/account/{account_id}/name/{name}Parameters
Parameters | Parameter Type | Description | Data Type | Required |
|---|---|---|---|---|
| path | The ID of the advertiser. |
| Y |
| path | The custom bidding rule name. |
| Y |
Sample Request
GET traffic/v3/byoa/account/987654321/name/rule-1223424Sample Response
For a rule that only has one version:
["bYOAResponses": [
{
"id": 987, //LONG (custom bidding id of this particular upload)
"name": "testname",
"inputFileUrl": "https://s.yimg.com/ar/1234567abc_v3.rule",
"version": 1,
"accountId": 87654,
"assignmentStatus": "FAILED",
"linesTargetingBYOA": [987654,876546]
}]
]For a rule that has multiple versions:
"bYOAResponses": [
{
"id": 987, //LONG (custom bidding id of latest upload)
"name": "testname",
"inputFileUrl": "https://s.yimg.com/ar/1234567abc_v3.rule",
"version": 2,
"accountId": 87654,
"assignmentStatus": "FAILED",
"linesTargetingBYOA": [987654,876546]
},
{
"id": 986, //LONG (custom bidding id of this previous upload)
"name": "testname",
"inputFileUrl": "https://s.yimg.com/ar/1234568abc_v2.rule",
"version": 1,
"accountId": 87654,
"assignmentStatus": "FAILED",
"linesTargetingBYOA": [987654,876546]
}]
Read Custom Bidding Rule by ID
Get a custom bidding rule by ID. The latest version of the rule will be returned.
GET traffic/v3/byoa/{byoa_id}Parameters
Parameters | Parameter Type | Description | Data Type | Required |
|---|---|---|---|---|
| path | The custom bidding ID. |
| Y |
Sample Request
GET traffic/v3/byoa/12345966Sample Response
{
id : 978937432, // LONG (id of this particular upload)
name : 'nyc-2018',
version : 3,
inputFileUrl : 'http://yahoo.s2/file2.rule', // STRING (name of file uploaded - received from FE)
accountId: 34567,
assignmentStatus: NOT_ASSIGNED, // NOT_ASSIGNED, PENDING , FAILED, SUCCESS
linesTargetingBYOA: [987654,876543]
}Read Lines Associated With the Custom Bidding Rule
Get all lines associated with a custom bidding rule.
GET traffic/v3/byoa/{byoa_id}/linesParameters
Parameters | Parameter Type | Description | Data Type | Required |
|---|---|---|---|---|
| path | The custom bidding ID. |
| Y |
Sample Request
GET traffic/v3/byoa/6766876/linesSample Response
{
"lines": [
{
"id": 675765764,
"name": "Test Custom Bidding",
"mediaType": "DISPLAY", (DISPLAY, VIDEO, NATIVE, AUDIO)
"deliveryStatus": "ENDED", (RUNNING, PAUSED, ENDED, TOTAL_BUDGET_REACHED, DAILY_BUDGET_REACHED, NOT_STARTED_YET, LIVE_SOON, NOT_ACTIVE)
"accountId": 90980978,
"advertiserName": "Custom Bidding Test Advertiser",
"clientStatus": "PAUSE", (PLAY, PAUSE, STOP, STOP_TOTAL_BUDGET, STOP_DAILY_BUDGET, STOP_START_DATE, STOP_END_DATE)
"seatName": "Test Seat",
"startDate": "2024-05-29T00:00:00-07:00"
},
{
"id": 675765765,
"name": "test line Package",
"mediaType": "DISPLAY",
"deliveryStatus": "ENDED",
"accountId": 90980978,
"advertiserName": "Custom Bidding Test Advertiser",
"clientStatus": "PAUSE",
"seatName": "Test Seat",
"startDate": "2024-07-31T00:00:00-07:00"
},
{
"id": 675765766,
"name": "testees",
"mediaType": "DISPLAY",
"deliveryStatus": "PAUSED",
"accountId": 90980978,
"advertiserName": "Custom Bidding Test Advertiser",
"clientStatus": "PAUSE",
"seatName": "Test Seat",
"startDate": "2024-09-30T00:00:00-07:00"
}
]
}Create / Import Custom Bidding Rule
Create or import a new custom bidding rule.
POST traffic/v3/byoaParameters
All fields are specified in the request body.
Sample Request
POST traffic/v3/byoaSample Request Body
{
payload : '....', // STRING (base64 encoded rule file). Encoded
accountId : 1232424, // INTEGER (Current advertiser-id)
name :'rule-1234', ' // STRING (name of the algorithm rule created)
}Sample Response
{
id: 123456,
name: "rule-1234",
inputFileUrl: "https://yahoo.s3/rule.txt",
version: 1,
accountId: 34567,
assignmentStatus: NOT_ASSIGNED,
linesTargetingBYOA: [987654,876543]
}Update a Custom Bidding Rule
Update an existing custom bidding rule.
PUT traffic/v3/byoaParameters
All fields are specified in the request body.
Sample Request URL
PUT traffic/v3/byoa/{byoa_id}Sample Request Body
{
payload : '....', // STRING (base64 encoded rule file). Encoded string?
accountId : 1232424, // INTEGER (Current advertiser-id)
name : 'rule-1234' // STRING (name of the custom bidding rule uploaded)
}Sample Response
{
id: 123456,
name: "rule-1233344",
inputFileUrl: "https://yahoo.s3/rule.txt",
version: 1,
accountId: 3456457,
assignmentStatus: NOT_ASSIGNED, // NOT_ASSIGNED, PENDING, FAILED, SUCCESS
linesTargetingBYOA: [987654,876543]
}Delete a Custom Bidding Rule
Delete an existing custom bidding rule.
If the rule is associated with a line, delete will throw an error.
DELETE traffic/v3/byoa/{byoa_id}Parameters
Parameters | Parameter Type | Description | Data Type | Required |
|---|---|---|---|---|
| path | The custom bidding ID. |
| Y |
Sample Request URL
DELETE traffic/v3/byoa/12325476455Sample Response
{
id: 12325476455
}Sample Error Response
{
"validationMessages": [
{
"message": "Custom Bidding my-test-rule is assigned to 1 or more lines. This custom bidding rule must be removed from lines [7657645768] before it can be deactivated.",
"key": "CUSTOM",
"objectName": "bYOA",
"id": 768765765,
"propertyName": "id"
}
]
}Custom Bidding Lines API
Use the PUT method to assign or remove a custom bidding rule on a line.
Assign a Custom Bidding Rule to a Line
Assign an existing custom bidding rule to a line.
PUT traffic/v3/lines/{line_id}/byoaParameters
Parameters | Parameter Type | Description | Data Type | Required |
|---|---|---|---|---|
| path | The Line ID. |
| Y |
Sample Request URL
PUT traffic/v3/lines/12345/byoaSample Request Body
{
"byoaId" : 12, // Integer (current custom bidding rule id)
"byoaMultiplierCap": 4.11 //Double custom bidding rule multiplier
}Sample Response
{
"response": {
"id": 693013,
"name": "Custom Bidding Test Line1",
"orderId": 127495,
"bidPrice": 4.11,
"goalAmount": 0.0,
"maxGoal": 0.0,
"marginGoal": 25.0,
"billingPrice": 5.0,
"pacingAcceleration": 100,
"isNativeEnabled": false,
"channelType": "DEFAULT",
...
"mediaType": "DISPLAY",
"goalModeType": "SOFT",
"goalType": "NONE",
"billingMethodType": "MARGIN",
"marginType": "TOTAL_BUDGET",
"budgetType": "CURRENCY",
...
"errors": null,
"timeStamp": "2025-10-29T09:34:39.993Z"
}Remove a Custom Bidding Rule from a Line
Remove an existing custom bidding rule from a line.
PUT traffic/v3/lines/{line_id}/byoaParameters
Parameters | Parameter Type | Description | Data Type | Required |
|---|---|---|---|---|
| path | The Line ID. |
| Y |
Sample Request URL
PUT traffic/v3/lines/3413/byoaSample Request Body
{
"byoaId" : null, // Integer (current custom bidding rule id)
"byoaMultiplierCap": null //Double custom bidding rule multiplier
}Sample Response
{
"response": {
"id": 693013,
"name": "Custom Bidding Test Line1",
"orderId": 127495,
"bidPrice": 4.11,
"goalAmount": 0.0,
"maxGoal": 0.0,
"marginGoal": 25.0,
"billingPrice": 5.0,
"pacingAcceleration": 100,
"isNativeEnabled": false,
"channelType": "DEFAULT",
...
"mediaType": "DISPLAY",
"goalModeType": "SOFT",
"goalType": "NONE",
"billingMethodType": "MARGIN",
"marginType": "TOTAL_BUDGET",
"budgetType": "CURRENCY",
...
"errors": null,
"timeStamp": "2025-10-29T09:34:39.993Z"
}