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

# Replace a Triage rule definition



## OpenAPI

````yaml /openapi.json put /v1/triage/rules/{ruleId}
openapi: 3.0.3
info:
  title: CodeRabbit API spec
  version: 1.0.0
servers:
  - url: https://api.coderabbit.ai
security:
  - ApiKeyAuth: []
paths:
  /v1/triage/rules/{ruleId}:
    put:
      tags:
        - Triage rules
      summary: Replace a Triage rule definition
      operationId: update_triage_rule
      parameters:
        - name: ruleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                revision:
                  type: integer
                  minimum: 0
                  maximum: 9007199254740991
                  exclusiveMinimum: true
                saveInactive:
                  type: boolean
                retentionSetup:
                  enum:
                    - draft
                    - commit
                  type: string
                definition:
                  type: object
                  properties:
                    name:
                      type: string
                      minLength: 1
                      maxLength: 120
                    description:
                      type: string
                      maxLength: 500
                    scope:
                      type: object
                      properties:
                        organizationId:
                          type: string
                          format: uuid
                        connectionId:
                          type: string
                          minLength: 1
                          maxLength: 255
                        provider:
                          enum:
                            - github
                            - gitlab
                            - bitbucket
                            - azure-devops
                          type: string
                        providerOrigin:
                          type: string
                          format: uri
                        scopeMode:
                          enum:
                            - all
                            - selected
                          type: string
                        repositoryIds:
                          type: array
                          maxItems: 1000
                          items:
                            type: string
                            minLength: 1
                            maxLength: 255
                      required:
                        - organizationId
                        - connectionId
                        - provider
                        - providerOrigin
                        - repositoryIds
                      additionalProperties: false
                    conditions: {}
                    filters:
                      type: object
                      properties:
                        from:
                          type: object
                          properties:
                            workspaceId:
                              type: string
                              format: uuid
                            organizationId:
                              type: string
                              format: uuid
                            viewId:
                              type: string
                              minLength: 1
                              maxLength: 255
                            baseView:
                              enum:
                                - my_inbox
                                - my_review_inbox
                                - my_prs
                                - all_prs
                                - safe_to_close
                              type: string
                            subject:
                              anyOf:
                                - type: object
                                  properties:
                                    kind:
                                      enum:
                                        - organization
                                  required:
                                    - kind
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    kind:
                                      enum:
                                        - person
                                    subscriptionUserId:
                                      type: integer
                                      minimum: 0
                                      maximum: 9007199254740991
                                      exclusiveMinimum: true
                                  required:
                                    - kind
                                    - subscriptionUserId
                                  additionalProperties: false
                            filters:
                              type: object
                              properties:
                                repo:
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                initiative:
                                  type: array
                                  items:
                                    anyOf:
                                      - type: string
                                        format: uuid
                                      - enum:
                                          - unclassified
                                search:
                                  type: string
                                  maxLength: 255
                                teams:
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                  default: []
                                author:
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                reviewer:
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                priority:
                                  type: array
                                  items:
                                    enum:
                                      - p0
                                      - p1
                                      - p2
                                      - p3
                                      - close_candidate
                                    type: string
                                guidance:
                                  type: array
                                  items:
                                    enum:
                                      - light
                                      - standard
                                      - deep
                                      - defer
                                    type: string
                                risk:
                                  type: array
                                  items:
                                    enum:
                                      - high
                                      - medium
                                      - low
                                      - critical
                                      - moderate
                                      - minimal
                                    type: string
                                securityRisk:
                                  type: array
                                  items:
                                    enum:
                                      - critical
                                      - high
                                      - moderate
                                      - low
                                    type: string
                                workflow:
                                  type: array
                                  items:
                                    enum:
                                      - awaiting_coderabbit
                                      - awaiting_your_review
                                      - author_action
                                      - ready_to_merge
                                      - other
                                    type: string
                                changeType:
                                  type: array
                                  items:
                                    enum:
                                      - bugfix
                                      - feature
                                      - refactor
                                    type: string
                                draft:
                                  type: array
                                  items:
                                    enum:
                                      - 'false'
                                      - 'true'
                                    type: string
                                  default: []
                                project:
                                  type: array
                                  items:
                                    type: string
                                    format: uuid
                                  default: []
                                includeUnassignedProjects:
                                  type: boolean
                                  default: false
                                titleIncludes:
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                titleExcludes:
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                titleContains:
                                  type: string
                                  maxLength: 255
                                  default: ''
                                excludeTitleMatches:
                                  type: boolean
                                  default: false
                              required:
                                - repo
                                - author
                                - reviewer
                                - priority
                                - guidance
                                - risk
                                - securityRisk
                                - workflow
                                - changeType
                              additionalProperties: false
                            groupPath:
                              type: array
                              minItems: 1
                              maxItems: 8
                              items:
                                type: object
                                properties:
                                  field:
                                    anyOf:
                                      - enum:
                                          - planning_horizon
                                          - priority
                                          - repository
                                          - author
                                          - review_workflow
                                          - review_guidance
                                          - risk
                                          - security_risk
                                          - project
                                        type: string
                                      - enum:
                                          - attention
                                  key:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                required:
                                  - field
                                  - key
                                additionalProperties: false
                          required:
                            - workspaceId
                            - organizationId
                            - viewId
                            - baseView
                            - subject
                            - filters
                            - groupPath
                          additionalProperties: false
                        when:
                          anyOf:
                            - type: object
                              properties:
                                mode:
                                  enum:
                                    - newly_matches
                              required:
                                - mode
                              additionalProperties: false
                            - type: object
                              properties:
                                mode:
                                  enum:
                                    - transition
                                transition:
                                  anyOf:
                                    - type: object
                                      properties:
                                        field:
                                          enum:
                                            - workflowState
                                        from:
                                          enum:
                                            - needs_update
                                            - needs_review
                                            - ready_to_merge
                                            - needs_decision
                                            - blocked
                                            - monitor
                                            - close_candidate
                                            - untracked
                                          type: string
                                        to:
                                          enum:
                                            - needs_update
                                            - needs_review
                                            - ready_to_merge
                                            - needs_decision
                                            - blocked
                                            - monitor
                                            - close_candidate
                                            - untracked
                                          type: string
                                      required:
                                        - field
                                        - from
                                        - to
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        field:
                                          enum:
                                            - workflowGroup
                                        from:
                                          enum:
                                            - awaiting_coderabbit
                                            - awaiting_your_review
                                            - author_action
                                            - ready_to_merge
                                            - merged
                                            - untracked
                                            - other
                                          type: string
                                        to:
                                          enum:
                                            - awaiting_coderabbit
                                            - awaiting_your_review
                                            - author_action
                                            - ready_to_merge
                                            - merged
                                            - untracked
                                            - other
                                          type: string
                                      required:
                                        - field
                                        - from
                                        - to
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        field:
                                          enum:
                                            - nextStep
                                        from:
                                          enum:
                                            - update_pr
                                            - fix_checks
                                            - resolve_conflicts
                                            - respond_to_review
                                            - refresh_branch
                                            - request_review
                                            - complete_review
                                            - merge
                                            - make_maintainer_decision
                                            - review_close
                                            - monitor
                                            - collect_review_context
                                          type: string
                                        to:
                                          enum:
                                            - update_pr
                                            - fix_checks
                                            - resolve_conflicts
                                            - respond_to_review
                                            - refresh_branch
                                            - request_review
                                            - complete_review
                                            - merge
                                            - make_maintainer_decision
                                            - review_close
                                            - monitor
                                            - collect_review_context
                                          type: string
                                      required:
                                        - field
                                        - from
                                        - to
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        field:
                                          enum:
                                            - responsibleRole
                                        from:
                                          enum:
                                            - author
                                            - reviewer
                                            - maintainer
                                            - system
                                            - unknown
                                          type: string
                                        to:
                                          enum:
                                            - author
                                            - reviewer
                                            - maintainer
                                            - system
                                            - unknown
                                          type: string
                                      required:
                                        - field
                                        - from
                                        - to
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        field:
                                          enum:
                                            - providerState
                                        from:
                                          enum:
                                            - open
                                            - closed
                                            - merged
                                          type: string
                                        to:
                                          enum:
                                            - open
                                            - closed
                                            - merged
                                          type: string
                                      required:
                                        - field
                                        - from
                                        - to
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        field:
                                          enum:
                                            - planningHorizon
                                        from:
                                          enum:
                                            - now
                                            - next
                                          type: string
                                        to:
                                          enum:
                                            - now
                                            - next
                                          type: string
                                      required:
                                        - field
                                        - from
                                        - to
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        field:
                                          enum:
                                            - isDraft
                                        from:
                                          type: boolean
                                        to:
                                          type: boolean
                                      required:
                                        - field
                                        - from
                                        - to
                                      additionalProperties: false
                              required:
                                - mode
                                - transition
                              additionalProperties: false
                            - type: object
                              properties:
                                mode:
                                  enum:
                                    - remains_matching
                                durationSeconds:
                                  type: integer
                                  minimum: 0
                                  maximum: 2592000
                                  exclusiveMinimum: true
                              required:
                                - mode
                                - durationSeconds
                              additionalProperties: false
                        paths:
                          type: array
                          maxItems: 100
                          items:
                            type: string
                            minLength: 1
                            maxLength: 1000
                        repositories:
                          type: array
                          maxItems: 1000
                          items:
                            type: object
                            properties:
                              repositoryId:
                                type: string
                                minLength: 1
                                maxLength: 255
                              paths:
                                type: array
                                maxItems: 100
                                items:
                                  type: string
                                  minLength: 1
                                  maxLength: 1000
                              labels:
                                type: object
                                properties:
                                  kind:
                                    enum:
                                      - predicate
                                  field:
                                    type: string
                                    maxLength: 100
                                  fieldVersion:
                                    type: integer
                                    minimum: 0
                                    maximum: 9007199254740991
                                    exclusiveMinimum: true
                                  operator:
                                    enum:
                                      - eq
                                      - neq
                                      - lt
                                      - lte
                                      - gt
                                      - gte
                                      - in
                                      - notIn
                                      - allIn
                                      - contains
                                      - notContains
                                    type: string
                                  value:
                                    anyOf:
                                      - type: number
                                      - type: boolean
                                      - type: string
                                        maxLength: 255
                                      - type: array
                                        minItems: 1
                                        maxItems: 100
                                        items:
                                          type: string
                                          minLength: 1
                                          maxLength: 255
                                required:
                                  - kind
                                  - field
                                  - fieldVersion
                                  - operator
                                  - value
                                additionalProperties: false
                            required:
                              - repositoryId
                            additionalProperties: false
                        includedAuthors:
                          type: array
                          maxItems: 100
                          items:
                            type: string
                            maxLength: 4096
                        excludedAuthors:
                          type: array
                          maxItems: 100
                          items:
                            type: string
                            maxLength: 4096
                        includedTeams:
                          type: array
                          maxItems: 100
                          items:
                            type: string
                            maxLength: 4096
                        excludedTeams:
                          type: array
                          maxItems: 100
                          items:
                            type: string
                            maxLength: 4096
                      additionalProperties: false
                    action:
                      anyOf:
                        - anyOf:
                            - type: object
                              properties:
                                kind:
                                  enum:
                                    - bring_to_ready
                                prompt:
                                  type: string
                                  maxLength: 5000
                                frequencyLimit:
                                  type: object
                                  properties:
                                    maximum:
                                      type: integer
                                      minimum: 1
                                      maximum: 1000
                                    period:
                                      enum:
                                        - hour
                                        - day
                                      type: string
                                  required:
                                    - maximum
                                    - period
                                  additionalProperties: false
                                settings:
                                  type: object
                                  properties:
                                    inactivityHours:
                                      type: number
                                      minimum: 0
                                      maximum: 720
                                      default: 4
                                    maxRepairRounds:
                                      type: integer
                                      minimum: 1
                                      maximum: 10
                                      default: 3
                                    fixCi:
                                      type: boolean
                                      default: true
                                    addressCodeRabbit:
                                      type: boolean
                                      default: true
                                    addressHumanFeedback:
                                      type: boolean
                                      default: true
                                    additionalInstructions:
                                      type: string
                                      maxLength: 4000
                                  additionalProperties: false
                                  default:
                                    inactivityHours: 4
                                    maxRepairRounds: 3
                                    fixCi: true
                                    addressCodeRabbit: true
                                    addressHumanFeedback: true
                              required:
                                - kind
                              additionalProperties: false
                            - type: object
                              properties:
                                kind:
                                  enum:
                                    - merge
                                autoFix:
                                  type: object
                                  properties:
                                    inactivityHours:
                                      default: 0
                                      enum:
                                        - 0
                                    maxRepairRounds:
                                      default: 10
                                      enum:
                                        - 10
                                    fixCi:
                                      type: boolean
                                      default: true
                                    addressCodeRabbit:
                                      type: boolean
                                      default: true
                                    addressHumanFeedback:
                                      type: boolean
                                      default: true
                                    additionalInstructions:
                                      type: string
                                      maxLength: 4000
                                  additionalProperties: false
                                mergeWindow:
                                  type: object
                                  properties:
                                    days:
                                      type: array
                                      minItems: 1
                                      maxItems: 7
                                      items:
                                        type: integer
                                        minimum: 0
                                        maximum: 6
                                    start:
                                      type: string
                                      pattern: ^([01]\d|2[0-3]):[0-5]\d$
                                    end:
                                      type: string
                                      pattern: ^([01]\d|2[0-3]):[0-5]\d$
                                    timezone:
                                      type: string
                                      minLength: 1
                                      maxLength: 255
                                  required:
                                    - days
                                    - start
                                    - end
                                    - timezone
                                  additionalProperties: false
                                prompt:
                                  type: string
                                  maxLength: 5000
                                frequencyLimit:
                                  type: object
                                  properties:
                                    maximum:
                                      type: integer
                                      minimum: 1
                                      maximum: 1000
                                    period:
                                      enum:
                                        - hour
                                        - day
                                      type: string
                                  required:
                                    - maximum
                                    - period
                                  additionalProperties: false
                                method:
                                  enum:
                                    - merge
                                    - squash
                                    - rebase
                                    - repository_policy
                                  type: string
                                  default: repository_policy
                              required:
                                - kind
                              additionalProperties: false
                            - type: object
                              properties:
                                kind:
                                  enum:
                                    - close
                                prompt:
                                  type: string
                                  maxLength: 5000
                                frequencyLimit:
                                  type: object
                                  properties:
                                    maximum:
                                      type: integer
                                      minimum: 1
                                      maximum: 1000
                                    period:
                                      enum:
                                        - hour
                                        - day
                                      type: string
                                  required:
                                    - maximum
                                    - period
                                  additionalProperties: false
                                comment:
                                  type: string
                                  minLength: 1
                                  maxLength: 5000
                                noticeHours:
                                  type: integer
                                  minimum: 0
                                  maximum: 720
                                  default: 24
                              required:
                                - kind
                              additionalProperties: false
                            - type: object
                              properties:
                                kind:
                                  enum:
                                    - slack
                                prompt:
                                  type: string
                                  maxLength: 5000
                                frequencyLimit:
                                  type: object
                                  properties:
                                    maximum:
                                      type: integer
                                      minimum: 1
                                      maximum: 1000
                                    period:
                                      enum:
                                        - hour
                                        - day
                                      type: string
                                  required:
                                    - maximum
                                    - period
                                  additionalProperties: false
                                awaitingHours:
                                  type: integer
                                  minimum: 1
                                  maximum: 8760
                                deliverySchedule:
                                  type: object
                                  properties:
                                    time:
                                      type: string
                                      pattern: ^([01]\d|2[0-3]):[0-5]\d$
                                    timezone:
                                      type: string
                                      minLength: 1
                                      maxLength: 255
                                  required:
                                    - time
                                    - timezone
                                  additionalProperties: false
                                cooldownHours:
                                  type: integer
                                  minimum: 24
                                  maximum: 8760
                                  default: 24
                                respectQuietHours:
                                  default: true
                                  enum:
                                    - true
                                destination:
                                  type: object
                                  properties:
                                    kind:
                                      enum:
                                        - channel
                                    connectionId:
                                      type: string
                                      format: uuid
                                    channelId:
                                      type: string
                                      maxLength: 255
                                      pattern: ^[CG][A-Z0-9]+$
                                    channelName:
                                      type: string
                                      minLength: 1
                                      maxLength: 255
                                  required:
                                    - kind
                                    - connectionId
                                    - channelId
                                  additionalProperties: false
                              required:
                                - kind
                              additionalProperties: false
                        - type: object
                          properties:
                            kind:
                              enum:
                                - sequence
                            prompt:
                              type: string
                              maxLength: 5000
                            frequencyLimit:
                              type: object
                              properties:
                                maximum:
                                  type: integer
                                  minimum: 1
                                  maximum: 1000
                                period:
                                  enum:
                                    - hour
                                    - day
                                  type: string
                              required:
                                - maximum
                                - period
                              additionalProperties: false
                            steps:
                              type: array
                              minItems: 1
                              maxItems: 10
                              items:
                                anyOf:
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - merge
                                      method:
                                        enum:
                                          - repository_policy
                                          - merge
                                          - squash
                                          - rebase
                                        type: string
                                    required:
                                      - stepId
                                      - kind
                                      - method
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - enqueue_merge
                                    required:
                                      - stepId
                                      - kind
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - approve
                                    required:
                                      - stepId
                                      - kind
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - close
                                      comment:
                                        type: string
                                        minLength: 1
                                        maxLength: 4000
                                      noticeHours:
                                        type: integer
                                        minimum: 0
                                        maximum: 720
                                    required:
                                      - stepId
                                      - kind
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - add_label
                                      label:
                                        type: string
                                        minLength: 1
                                        maxLength: 50
                                    required:
                                      - stepId
                                      - kind
                                      - label
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - refresh_branch
                                    required:
                                      - stepId
                                      - kind
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - set_priority
                                      priority:
                                        enum:
                                          - p0
                                          - p1
                                          - p2
                                          - p3
                                        type: string
                                      reason:
                                        type: string
                                        minLength: 1
                                        maxLength: 4000
                                    required:
                                      - stepId
                                      - kind
                                      - priority
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - ignore_close_candidate
                                    required:
                                      - stepId
                                      - kind
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - restore_close_candidate
                                    required:
                                      - stepId
                                      - kind
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - report_close_candidate
                                      reason:
                                        type: string
                                        minLength: 1
                                        maxLength: 4000
                                    required:
                                      - stepId
                                      - kind
                                      - reason
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - mark_ready
                                    required:
                                      - stepId
                                      - kind
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - convert_to_draft
                                    required:
                                      - stepId
                                      - kind
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - reopen
                                    required:
                                      - stepId
                                      - kind
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - start_review
                                    required:
                                      - stepId
                                      - kind
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - retry_review
                                    required:
                                      - stepId
                                      - kind
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - repair
                                      operation:
                                        enum:
                                          - fix_ci
                                          - resolve_conflicts
                                          - auto_fix
                                          - retry
                                        type: string
                                    required:
                                      - stepId
                                      - kind
                                      - operation
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - find_reviewer
                                    required:
                                      - stepId
                                      - kind
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - request_reviewer
                                      reviewerId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                    required:
                                      - stepId
                                      - kind
                                      - reviewerId
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - rerequest_reviewer
                                      reviewerId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                    required:
                                      - stepId
                                      - kind
                                      - reviewerId
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - withdraw_reviewer
                                      reviewerId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                    required:
                                      - stepId
                                      - kind
                                      - reviewerId
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - send_slack
                                      connectionId:
                                        type: string
                                        format: uuid
                                      channelId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      message:
                                        type: string
                                        minLength: 1
                                        maxLength: 4000
                                    required:
                                      - stepId
                                      - kind
                                      - connectionId
                                      - channelId
                                      - message
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - ping_reviewer
                                      reviewerId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      message:
                                        type: string
                                        minLength: 1
                                        maxLength: 4000
                                    required:
                                      - stepId
                                      - kind
                                      - reviewerId
                                      - message
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - follow
                                      events:
                                        type: array
                                        minItems: 1
                                        maxItems: 13
                                        items:
                                          enum:
                                            - ci_failed
                                            - review_comment_added
                                            - review_thread_resolved
                                            - pr_ready_for_review
                                            - pr_reopened
                                            - pr_metadata_edited
                                            - pr_labels_updated
                                            - pr_closed
                                            - pr_merged
                                            - pr_updated
                                            - pr_comment_added
                                            - pr_opened
                                            - coderabbit_comment_updated
                                          type: string
                                    required:
                                      - stepId
                                      - kind
                                      - events
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - comment
                                      body:
                                        type: string
                                        minLength: 1
                                        maxLength: 4000
                                    required:
                                      - stepId
                                      - kind
                                      - body
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - reply_to_thread
                                      threadId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      body:
                                        type: string
                                        minLength: 1
                                        maxLength: 4000
                                    required:
                                      - stepId
                                      - kind
                                      - threadId
                                      - body
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - resolve_thread
                                      threadId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                    required:
                                      - stepId
                                      - kind
                                      - threadId
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - reopen_thread
                                      threadId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                    required:
                                      - stepId
                                      - kind
                                      - threadId
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - apply_suggestion
                                      commentId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      expectedHeadSha:
                                        type: string
                                        pattern: ^(?:[a-f0-9]{40}|[a-f0-9]{64})$
                                    required:
                                      - stepId
                                      - kind
                                      - commentId
                                      - expectedHeadSha
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - continue_coding_agent
                                      instruction:
                                        type: string
                                        minLength: 1
                                        maxLength: 4000
                                    required:
                                      - stepId
                                      - kind
                                      - instruction
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      stepId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                      kind:
                                        enum:
                                          - human_handoff
                                      task:
                                        enum:
                                          - review
                                          - rereview
                                          - respond_to_feedback
                                          - maintainer_decision
                                          - submit_review
                                          - inspect
                                        type: string
                                      instruction:
                                        type: string
                                        minLength: 1
                                        maxLength: 4000
                                    required:
                                      - stepId
                                      - kind
                                      - task
                                      - instruction
                                    additionalProperties: false
                          required:
                            - kind
                            - steps
                          additionalProperties: false
                    actions:
                      type: array
                      minItems: 1
                      maxItems: 2
                      items:
                        anyOf:
                          - type: object
                            properties:
                              kind:
                                enum:
                                  - bring_to_ready
                              prompt:
                                type: string
                                maxLength: 5000
                              frequencyLimit:
                                type: object
                                properties:
                                  maximum:
                                    type: integer
                                    minimum: 1
                                    maximum: 1000
                                  period:
                                    enum:
                                      - hour
                                      - day
                                    type: string
                                required:
                                  - maximum
                                  - period
                                additionalProperties: false
                              settings:
                                type: object
                                properties:
                                  inactivityHours:
                                    type: number
                                    minimum: 0
                                    maximum: 720
                                    default: 4
                                  maxRepairRounds:
                                    type: integer
                                    minimum: 1
                                    maximum: 10
                                    default: 3
                                  fixCi:
                                    type: boolean
                                    default: true
                                  addressCodeRabbit:
                                    type: boolean
                                    default: true
                                  addressHumanFeedback:
                                    type: boolean
                                    default: true
                                  additionalInstructions:
                                    type: string
                                    maxLength: 4000
                                additionalProperties: false
                                default:
                                  inactivityHours: 4
                                  maxRepairRounds: 3
                                  fixCi: true
                                  addressCodeRabbit: true
                                  addressHumanFeedback: true
                            required:
                              - kind
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                enum:
                                  - merge
                              autoFix:
                                type: object
                                properties:
                                  inactivityHours:
                                    default: 0
                                    enum:
                                      - 0
                                  maxRepairRounds:
                                    default: 10
                                    enum:
                                      - 10
                                  fixCi:
                                    type: boolean
                                    default: true
                                  addressCodeRabbit:
                                    type: boolean
                                    default: true
                                  addressHumanFeedback:
                                    type: boolean
                                    default: true
                                  additionalInstructions:
                                    type: string
                                    maxLength: 4000
                                additionalProperties: false
                              mergeWindow:
                                type: object
                                properties:
                                  days:
                                    type: array
                                    minItems: 1
                                    maxItems: 7
                                    items:
                                      type: integer
                                      minimum: 0
                                      maximum: 6
                                  start:
                                    type: string
                                    pattern: ^([01]\d|2[0-3]):[0-5]\d$
                                  end:
                                    type: string
                                    pattern: ^([01]\d|2[0-3]):[0-5]\d$
                                  timezone:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                required:
                                  - days
                                  - start
                                  - end
                                  - timezone
                                additionalProperties: false
                              prompt:
                                type: string
                                maxLength: 5000
                              frequencyLimit:
                                type: object
                                properties:
                                  maximum:
                                    type: integer
                                    minimum: 1
                                    maximum: 1000
                                  period:
                                    enum:
                                      - hour
                                      - day
                                    type: string
                                required:
                                  - maximum
                                  - period
                                additionalProperties: false
                              method:
                                enum:
                                  - merge
                                  - squash
                                  - rebase
                                  - repository_policy
                                type: string
                                default: repository_policy
                            required:
                              - kind
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                enum:
                                  - close
                              prompt:
                                type: string
                                maxLength: 5000
                              frequencyLimit:
                                type: object
                                properties:
                                  maximum:
                                    type: integer
                                    minimum: 1
                                    maximum: 1000
                                  period:
                                    enum:
                                      - hour
                                      - day
                                    type: string
                                required:
                                  - maximum
                                  - period
                                additionalProperties: false
                              comment:
                                type: string
                                minLength: 1
                                maxLength: 5000
                              noticeHours:
                                type: integer
                                minimum: 0
                                maximum: 720
                                default: 24
                            required:
                              - kind
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                enum:
                                  - slack
                              prompt:
                                type: string
                                maxLength: 5000
                              frequencyLimit:
                                type: object
                                properties:
                                  maximum:
                                    type: integer
                                    minimum: 1
                                    maximum: 1000
                                  period:
                                    enum:
                                      - hour
                                      - day
                                    type: string
                                required:
                                  - maximum
                                  - period
                                additionalProperties: false
                              awaitingHours:
                                type: integer
                                minimum: 1
                                maximum: 8760
                              deliverySchedule:
                                type: object
                                properties:
                                  time:
                                    type: string
                                    pattern: ^([01]\d|2[0-3]):[0-5]\d$
                                  timezone:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                required:
                                  - time
                                  - timezone
                                additionalProperties: false
                              cooldownHours:
                                type: integer
                                minimum: 24
                                maximum: 8760
                                default: 24
                              respectQuietHours:
                                default: true
                                enum:
                                  - true
                              destination:
                                type: object
                                properties:
                                  kind:
                                    enum:
                                      - channel
                                  connectionId:
                                    type: string
                                    format: uuid
                                  channelId:
                                    type: string
                                    maxLength: 255
                                    pattern: ^[CG][A-Z0-9]+$
                                  channelName:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                required:
                                  - kind
                                  - connectionId
                                  - channelId
                                additionalProperties: false
                            required:
                              - kind
                            additionalProperties: false
                  required:
                    - name
                    - scope
                  additionalProperties: false
                org_id:
                  type: string
                  minLength: 1
                  description: >-
                    Git-provider organization ID. Required for workspace keys;
                    omit for organization keys. This differs from the CodeRabbit
                    organization ID in scope.id.
              required:
                - revision
                - definition
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  ruleId:
                    type: string
                    format: uuid
                  revision:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                required:
                  - ruleId
                  - revision
        '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.