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

### Fields

- **Name**  
  string  
  required  
  The Priority's Name

- **ChannelId**  
  string  
  required  
  The Channel's ID

- **Weight**  
  int32  
  required  
  The priority order within the channel. 1-100, 1 is highest priority

- **SelectionAlgorithm**  
  int32  
  required  
  Choose which selector the ad engines use to select an ad from this priority. Defaults to 0 (lottery). See below for the full list.

- **IsDeleted**  
  boolean  
  Defaults to false

- **FloorPrice**  
  float  
  Sets a floor price for second-price auction priority

- **FloorCPC**  
  float  
  (BETA) Read only - Floor CPC if the Floor CPC feature is used on the priority. Contact Kevel support to get started

- **IsSecondPricing**  
  boolean  
  Whether flight uses second-price auction model

- **SecondPriceGroupBy**  
  string  
  Defaults to null

- **PassbackTimeout**  
  int32  
  Sets the timeout (in ms) for flights passing back in an adChain priority

- **RemainderPercentage**  
  int32  
  Auctions and AdChain Optimized only. Refers to the percentage of impressions that ads with lower eCPMs will receive, which is used to give poor-performing ads a "second-chance".

### Example Request

```bash
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}'
```

### Example Response

```json
{
  "id": 12345,
  "name": "High Priority",
  "channelId": 1234,
  "weight": 10,
  "isDeleted": false,
  "selectionAlgorithm": 0
}
```
