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

# Update Priority

This API call updates an existing priority using the Priority ID. The user is unable to update the PriorityID or the SelectionAlgorithm.

> 📘 Note
>
> All other parameters, beyond SelectionAlgorithm under Create Priority, can be updated. Make sure to include `weight` or `name`, as those will be replaced with `null` otherwise.

> ❗️ Warning
>
> SelectionAlgorithm cannot be updated after the priority is created.

> 📘 Clearing attribute values
>
> To unset or clear an attribute, set its value to `NULL`.

<br />

# 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/{PriorityID}": {
      "put": {
        "summary": "Update Priority",
        "description": "This API call updates an existing priority using the Priority ID. The user is unable to update the PriorityID or the SelectionAlgorithm.",
        "operationId": "update-priorities",
        "parameters": [
          {
            "name": "priorityId",
            "in": "path",
            "description": "The Priority's ID",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "channelId",
                  "name",
                  "weight"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "The Priority's ID",
                    "format": "int32"
                  },
                  "channelId": {
                    "type": "integer",
                    "description": "The Channel's ID",
                    "format": "int32"
                  },
                  "name": {
                    "type": "string",
                    "description": "Friendly name of Priority"
                  },
                  "weight": {
                    "type": "integer",
                    "description": "The priority order within the channel. 1-100, 1 is highest priority",
                    "format": "int32"
                  },
                  "isDeleted": {
                    "type": "boolean",
                    "description": "If want to delete, set to `true`"
                  },
                  "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"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"id\":98765,\n  \"name\":\"High Priority\",\n  \"channelId\":12345,\n  \"weight\":10,\n  \"isDeleted\":false,\n  \"selectionAlgorithm\": 0\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "example": 98765,
                      "default": 0
                    },
                    "name": {
                      "type": "string",
                      "example": "High Priority"
                    },
                    "channelId": {
                      "type": "integer",
                      "example": 12345,
                      "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 PUT -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/priority/98765\" --data-binary '{\"Id\":98765,\"Name\":\"High Priority\",\"ChannelId\":12345,\"Weight\":11,\"IsDeleted\":\"false\"}'"
            },
            {
              "language": "javascript",
              "code": "const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updatePriority() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let priority = await client.run(\"priority\", \"update\", {\n    id: 98765, \n    name: \"High Priority\"\n  });\n  console.log(priority);\n}\n\nupdatePriority();"
            },
            {
              "language": "ruby",
              "code": "require \"adzerk\"\n\ndef update_priority()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    priority_id = 12345\n    data = client.priorities.get(priority_id)\n    data[:name] = \"Updated Name\"\n    pp client.priorities.update(data)\nend\nupdate_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
}
```