---
updatedAt: 2025-09-18T22:00:49.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# Create Priority

This API call adds a new priority to a specific channel.

> 📘 Note
>
> `IsSecondPricing` can only be set to `true` for an Auction-type `SelectionMethod` of `1` or `3`.

> 📘 Note
>
> If `FloorPrice` is not set, and `IsSecondPricing` is false, it will be set to `null`. `If FloorPrice` is not set, and `IsSecondPricing` is true, it will be set to $0.01.

> 🚧 Caution
>
> Priorities may only be set on creation, and this field cannot be updated once set. Values include:
>
> `0 = Lottery`\
> `1 = Auction`\
> `2 = Adchain Ordered`\
> `3 = Adchain Optimized`\
> `4 = Lottery with Outbid`

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "management-api-2",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.kevel.co"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "X-Adzerk-ApiKey",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/priority": {
      "post": {
        "summary": "Create Priority",
        "description": "This API call adds a new priority to a specific channel.",
        "operationId": "create-priorities",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "Name",
                  "ChannelId",
                  "Weight",
                  "SelectionAlgorithm"
                ],
                "properties": {
                  "Name": {
                    "type": "string",
                    "description": "The Priority's Name"
                  },
                  "ChannelId": {
                    "type": "string",
                    "description": "The Channel's ID"
                  },
                  "Weight": {
                    "type": "integer",
                    "description": "The priority order within the channel. 1-100, 1 is highest priority",
                    "format": "int32"
                  },
                  "SelectionAlgorithm": {
                    "type": "integer",
                    "description": "Choose which selector the ad engines use to select an ad from this priority. Defaults to 0 (lottery). See below for the full list.",
                    "format": "int32"
                  },
                  "IsDeleted": {
                    "type": "boolean",
                    "description": "Do not use if creating a Priority. Defaults to `false`",
                    "default": false
                  },
                  "FloorPrice": {
                    "type": "number",
                    "description": "Sets a floor price for second-price auction priority",
                    "format": "float"
                  },
                  "FloorCPC": {
                    "type": "number",
                    "description": "(BETA) Read only - Floor CPC if the Floor CPC feature is used on the priority. Contact Kevel support to get started",
                    "format": "float"
                  },
                  "IsSecondPricing": {
                    "type": "boolean",
                    "description": "Whether flight uses second-price auction model"
                  },
                  "SecondPriceGroupBy": {
                    "type": "string",
                    "description": "Sets whether ads in a second-priced auction should *not* second price against the same: `advertiser`, `campaign`, `flight`,  or `ad`. Default is `null`, which is equivalent to `advertiser`. Can only be set when `IsSecondPricing` is true",
                    "default": "null"
                  },
                  "PassbackTimeout": {
                    "type": "integer",
                    "description": "Sets the timeout (in ms) for flights passing back in an adChain priority",
                    "format": "int32"
                  },
                  "RemainderPercentage": {
                    "type": "integer",
                    "description": "Auctions and AdChain Optimized only. Refers to the percentage of impressions that ads with lower eCPMs will receive, which is used to give poor-perfoming ads a \"second-chance\".",
                    "format": "int32"
                  }
                }
              },
              "examples": {
                "JSON": {
                  "value": {
                    "name": "High Priority",
                    "channelId": 12345,
                    "weight": 10,
                    "isDeleted": false,
                    "selectionAlgorithm": 1,
                    "isSecondPricing": true,
                    "floorPrice": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"id\":12345,\n  \"name\":\"High Priority\",\n  \"channelId\":1234,\n  \"weight\":10,\n  \"isDeleted\":false,\n  \"selectionAlgorithm\": 0\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "example": 12345,
                      "default": 0
                    },
                    "name": {
                      "type": "string",
                      "example": "High Priority"
                    },
                    "channelId": {
                      "type": "integer",
                      "example": 1234,
                      "default": 0
                    },
                    "weight": {
                      "type": "integer",
                      "example": 10,
                      "default": 0
                    },
                    "isDeleted": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "selectionAlgorithm": {
                      "type": "integer",
                      "example": 0,
                      "default": 0
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/priority\" --data-binary '{\"Name\":\"High Priority\",\"ChannelId\":12345,\"Weight\":10,\"IsDeleted\":false,\"SelectionAlgorithm\":0}'",
              "name": "cURL"
            },
            {
              "language": "javascript",
              "code": "const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createPriority() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let priority = await client.run(\"priority\", \"create\", {\n    name: \"High Priority\",\n    channelId: 51393,\n    weight: 100, //lowest weight\n    selectionAlgorithm: Adzerk.SelectionAlgorithm.Lottery,\n  });\n\n  console.log(priority);\n}\n\ncreatePriority();"
            },
            {
              "language": "ruby",
              "code": "require \"adzerk\"\n\ndef create_priority()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        name: \"Test Priority Name\",\n        channel_id: 12345,\n        weight: 100,\n        selection_algorithm: 0 # default\n    }\n    pp client.priorities.create(data)\nend\ncreate_priority()"
            }
          ],
          "samples-languages": [
            "curl",
            "javascript",
            "ruby"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "X-Adzerk-Sdk-Version",
        "value": "Readme.io:ManagementAPI2"
      }
    ],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```