> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Set a change's manual priority

> Applies p0–p3 using existing seated-user and repository authorization. Read priority.revision from change detail first. Reuse the same idempotency_key and expected_revision for an uncertain retry; duplicate commands return the latest current state. A new command against stale priority returns conflict. This does not close a pull request or clear an override.

> [!NOTE]
>
> This operation starts with internal qualification and must be enabled for your organization. Triage eligibility, an active review seat and current repository access are required.

A priority change records the authenticated actor in Triage history and preserves its notifications. You can change a manual priority, but you cannot clear it to restore calculated ranking.

## Read before writing

Read `GET /v1/triage/changes/{id}` and use `data.priority.revision` as `expected_revision`. This opaque value is a concurrency precondition, not a credential or the displayed score. A null or absent revision means the precondition is unavailable; reread instead of constructing one. List responses do not supply this detail-only field.

```bash theme={null}
coderabbit api --api-key-file /path/to/api-key request \
  /triage/changes/CHANGE_ID > change.json

jq -e '.data.priority.revision != null' change.json && \
  jq --arg key "$(uuidgen)" \
  '{urgency: "p1", reason: "Blocks the release", expected_revision: .data.priority.revision, idempotency_key: $key}' \
  change.json > priority-request.json
```

Stop if the first `jq` command fails. Use the change's returned UUID, not its provider PR number. Generate this file once per new decision; for retries, reuse it without rerunning these commands.

```bash theme={null}
coderabbit api --api-key-file /path/to/api-key request \
  /triage/changes/CHANGE_ID/priority \
  --method PUT --input priority-request.json
```

## Retry an uncertain result

Retry the exact same body with the original `expected_revision` and `idempotency_key`. Duplicate detection precedes stale-state checks. A duplicate response returns the latest current state, which may reflect another user's later decision; it does not reapply your change. That current state can include `close_candidate`, although this endpoint cannot set it.

A new command with a stale precondition conflicts with the current state. Reread before making a new decision, using a new command key. Obtain revisions from the selected change and organization; a valid revision never bypasses permission checks.

Hosted MCP exposes `set_triage_change_priority` with `account:read`, `triage:read` and `triage:write` consent. For workspace keys, send the [organization selector](https://docs.coderabbit.ai/api/platform-authentication.md) `org_id` in the query on the detail read and in the JSON body on this update. Organization-scoped keys omit it.


## OpenAPI

````yaml put /v1/triage/changes/{id}/priority
openapi: 3.0.3
info:
  title: CodeRabbit API spec
  version: 1.0.0
servers:
  - url: https://api.coderabbit.ai
security:
  - ApiKeyAuth: []
paths:
  /v1/triage/changes/{id}/priority:
    put:
      tags:
        - Triage
      summary: Set a change's manual priority
      description: >-
        Applies p0–p3 using existing seated-user and repository authorization.
        Read priority.revision from change detail first. Reuse the same
        idempotency_key and expected_revision for an uncertain retry; duplicate
        commands return the latest current state. A new command against stale
        priority returns conflict. This does not close a pull request or clear
        an override.
      operationId: set_triage_change_priority
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                org_id:
                  type: string
                urgency:
                  enum:
                    - p0
                    - p1
                    - p2
                    - p3
                  type: string
                reason:
                  anyOf:
                    - type: string
                      maxLength: 200
                    - type: string
                      nullable: true
                      enum:
                        - null
                expected_revision:
                  type: string
                  minLength: 1
                  maxLength: 2048
                  description: >-
                    Use priority.revision from the current change detail. Retain
                    this value and idempotency_key when retrying the same
                    command.
                idempotency_key:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    Unique command identity. A repeated key returns the native
                    current state without applying another change.
              required:
                - urgency
                - expected_revision
                - idempotency_key
              additionalProperties: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    enum:
                      - updated
                      - duplicate
                    type: string
                  current:
                    type: object
                    properties:
                      urgency:
                        enum:
                          - p0
                          - p1
                          - p2
                          - p3
                          - close_candidate
                        type: string
                      score:
                        type: number
                        minimum: 0
                        maximum: 100
                      actor:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            anyOf:
                              - type: string
                              - type: string
                                nullable: true
                                enum:
                                  - null
                          avatar_url:
                            anyOf:
                              - type: string
                              - type: string
                                nullable: true
                                enum:
                                  - null
                        required:
                          - id
                          - name
                          - avatar_url
                        additionalProperties: false
                      changed_at:
                        type: string
                        format: date-time
                    required:
                      - urgency
                      - score
                      - actor
                      - changed_at
                    additionalProperties: false
                required:
                  - status
                  - current
                additionalProperties: false
        '400':
          description: '400'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - invalid_request
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '401':
          description: '401'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - unauthenticated
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - forbidden
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '404':
          description: '404'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - not_found
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '409':
          description: '409'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - head_changed
                          - conflict
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '412':
          description: '412'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - precondition_failed
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '413':
          description: '413'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - payload_too_large
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '429':
          description: '429'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - rate_limit_exceeded
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '500':
          description: '500'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - internal_error
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '503':
          description: '503'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - unavailable
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-coderabbitai-api-key
      description: >-
        API key for authentication. You can create an API key from the
        CodeRabbit dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.