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

# Enable, disable, resume or recover existing autofix

> Enables, disables, resumes or recovers autofix for a coding task or pull request, and returns the new status. The recover action requires the deliveryConflict returned by get_code_autofix.

> [tab] CLI Tool
>
> ```bash
> coderabbit api request /code/autofix/commands --input request.json
> ```
>
> To install and sign in to the CLI, see [Call from the CLI](https://docs.coderabbit.ai/api/cli.md).

> [tab] MCP Server
>
> An agent connected to the [CodeRabbit MCP server](https://docs.coderabbit.ai/api/mcp.md) runs this operation as the `set_code_autofix` tool. The connection selects the organization, so the arguments have no `org_id` or `org_name`.
>
> ```json
> {
>   "method": "tools/call",
>   "params": {
>     "name": "set_code_autofix",
>     "arguments": {
>       "target": "<target>",
>       "action": "enable"
>     }
>   }
> }
> ```


## OpenAPI

````yaml /openapi.json post /v1/code/autofix/commands
openapi: 3.0.0
info:
  title: CodeRabbit API
  version: 1.0.0
  description: >-
    Read and manage CodeRabbit reviews, coding tasks, Verify, Triage, security
    findings, Knowledge Base, configuration, and users for your organization.
servers:
  - url: https://api.coderabbit.ai
    description: US region
  - url: https://api.eu.coderabbit.ai
    description: EU region
security:
  - ApiKeyAuth: []
tags:
  - name: Organizations and repositories
  - name: Pull requests and reviews
  - name: Coding Agent
  - name: Coding environments
  - name: Verify
  - name: Triage
  - name: Security
  - name: Knowledge Base
  - name: Automations
  - name: Reports
  - name: Configuration
  - name: Connections
  - name: Users and roles
  - name: Usage and metrics
paths:
  /v1/code/autofix/commands:
    post:
      tags:
        - Coding Agent
      summary: Enable, disable, resume or recover existing autofix
      description: >-
        Enables, disables, resumes or recovers autofix for a coding task or pull
        request, and returns the new status. The recover action requires the
        deliveryConflict returned by get_code_autofix.
      operationId: set_code_autofix
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                target:
                  anyOf:
                    - type: object
                      properties:
                        type:
                          enum:
                            - task
                        taskId:
                          type: string
                          minLength: 1
                          maxLength: 64
                      required:
                        - type
                        - taskId
                      additionalProperties: false
                    - type: object
                      properties:
                        type:
                          enum:
                            - pull_request
                        repoId:
                          type: string
                          minLength: 1
                          maxLength: 255
                        prNumber:
                          type: integer
                          minimum: 0
                          exclusiveMinimum: true
                      required:
                        - type
                        - repoId
                        - prNumber
                      additionalProperties: false
                action:
                  enum:
                    - enable
                    - disable
                    - resume
                    - recover
                  type: string
                deliveryConflict:
                  type: object
                  properties:
                    reasonCode:
                      enum:
                        - delivery_conflict
                    operationId:
                      type: string
                      minLength: 1
                      maxLength: 200
                    attemptedHeadSha:
                      type: string
                      minLength: 1
                      maxLength: 200
                    patchGeneration:
                      type: integer
                      minimum: 0
                      exclusiveMinimum: true
                  required:
                    - reasonCode
                    - operationId
                    - attemptedHeadSha
                    - patchGeneration
                  additionalProperties: false
                sourceEventId:
                  type: string
                  pattern: ^[a-f0-9]{64}$
                org_id:
                  type: string
                  minLength: 1
                  description: >-
                    Organization for a workspace key: the Git-provider
                    organization ID (scope.provider_organization_id) or the
                    CodeRabbit organization ID (scope.id, or id from list
                    organizations). Supply either org_id or org_name, never
                    both. Omit for organization keys and MCP connections.
                org_name:
                  type: string
                  pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,38}$
                  description: >-
                    GitHub organization login, such as coderabbitai, not its
                    display name. Matched case-insensitively within the
                    authenticated workspace. Supply either org_name or org_id,
                    never both; omit for organization keys and MCP connections.
              required:
                - target
                - action
              additionalProperties: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  deliveryConflict:
                    type: object
                    properties:
                      reasonCode:
                        enum:
                          - delivery_conflict
                      operationId:
                        type: string
                        minLength: 1
                        maxLength: 200
                      attemptedHeadSha:
                        type: string
                        minLength: 1
                        maxLength: 200
                      patchGeneration:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                    required:
                      - reasonCode
                      - operationId
                      - attemptedHeadSha
                      - patchGeneration
                    additionalProperties: false
                  available:
                    type: boolean
                  watch:
                    anyOf:
                      - type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                          organizationId:
                            type: string
                            format: uuid
                          provider:
                            enum:
                              - github
                              - gitlab
                              - azure-devops
                              - bitbucket
                            type: string
                          host:
                            enum:
                              - github.com
                              - gitlab.com
                              - dev.azure.com
                              - bitbucket.org
                            type: string
                          repoId:
                            type: string
                            minLength: 1
                            maxLength: 255
                          owner:
                            type: string
                            minLength: 1
                            maxLength: 255
                          repo:
                            type: string
                            minLength: 1
                            maxLength: 255
                          taskId:
                            type: string
                            minLength: 1
                            maxLength: 64
                          prNumber:
                            anyOf:
                              - type: integer
                                minimum: 0
                                exclusiveMinimum: true
                              - type: string
                                nullable: true
                                enum:
                                  - null
                          prUrl:
                            anyOf:
                              - type: string
                                format: uri
                              - type: string
                                nullable: true
                                enum:
                                  - null
                          summaryCommentId:
                            anyOf:
                              - type: integer
                                minimum: 0
                                exclusiveMinimum: true
                              - type: string
                                nullable: true
                                enum:
                                  - null
                            default: null
                          sourceRepositoryId:
                            anyOf:
                              - type: string
                                minLength: 1
                                maxLength: 255
                              - type: string
                                nullable: true
                                enum:
                                  - null
                          sourceBranch:
                            anyOf:
                              - type: string
                                maxLength: 1024
                              - type: string
                                nullable: true
                                enum:
                                  - null
                          baseBranch:
                            anyOf:
                              - type: string
                                maxLength: 1024
                              - type: string
                                nullable: true
                                enum:
                                  - null
                            default: null
                          requestedBy:
                            type: object
                            properties:
                              id:
                                type: string
                                minLength: 1
                                maxLength: 255
                              login:
                                type: string
                                minLength: 1
                                maxLength: 255
                            required:
                              - id
                          providerUserId:
                            type: string
                            minLength: 1
                            maxLength: 255
                          repairScope:
                            enum:
                              - all
                              - ci
                            type: string
                          enabled:
                            type: boolean
                          generation:
                            type: integer
                            minimum: 0
                          revision:
                            type: integer
                            minimum: 0
                          pendingRevision:
                            type: integer
                            minimum: 0
                          pendingEventAt:
                            anyOf:
                              - type: string
                                format: date-time
                              - type: string
                                nullable: true
                                enum:
                                  - null
                            default: null
                          processedRevision:
                            type: integer
                            minimum: 0
                            default: 0
                          nativeActionIds:
                            type: array
                            maxItems: 200
                            items:
                              type: string
                              pattern: ^[a-f0-9]{64}$
                            default: []
                          state:
                            enum:
                              - waiting_for_pr
                              - checking
                              - fixing
                              - waiting
                              - green
                              - paused
                              - stopped
                            type: string
                          rounds:
                            type: integer
                            minimum: 0
                            maximum: 5
                          unchangedRounds:
                            type: integer
                            minimum: 0
                          headSha:
                            anyOf:
                              - type: string
                              - type: string
                                nullable: true
                                enum:
                                  - null
                          mergeQueueEviction:
                            anyOf:
                              - type: object
                                properties:
                                  headSha:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                  reason:
                                    enum:
                                      - CI_FAILURE
                                      - INVALID_MERGE_COMMIT
                                      - MERGE_CONFLICT
                                      - MERGE_CONFLICT_ERROR
                                    type: string
                                required:
                                  - headSha
                                  - reason
                                additionalProperties: false
                              - type: string
                                nullable: true
                                enum:
                                  - null
                            default: null
                          remainingFingerprint:
                            anyOf:
                              - type: string
                              - type: string
                                nullable: true
                                enum:
                                  - null
                          operationId:
                            anyOf:
                              - type: string
                              - type: string
                                nullable: true
                                enum:
                                  - null
                          operationHeadSha:
                            anyOf:
                              - type: string
                              - type: string
                                nullable: true
                                enum:
                                  - null
                            default: null
                          operationContinuationTurnId:
                            anyOf:
                              - type: string
                                minLength: 1
                                maxLength: 255
                              - type: string
                                nullable: true
                                enum:
                                  - null
                          operationPrompt:
                            anyOf:
                              - type: string
                                maxLength: 200000
                              - type: string
                                nullable: true
                                enum:
                                  - null
                            default: null
                          operationActionContext:
                            anyOf:
                              - anyOf:
                                  - type: object
                                    properties:
                                      origin:
                                        enum:
                                          - autopilot
                                      trigger:
                                        enum:
                                          - merge_queue_eviction
                                      pullRequest:
                                        type: object
                                        properties:
                                          url:
                                            type: string
                                            maxLength: 2048
                                            format: uri
                                          title:
                                            type: string
                                            maxLength: 500
                                          headBranch:
                                            type: string
                                            maxLength: 500
                                          baseBranch:
                                            type: string
                                            maxLength: 500
                                          headSha:
                                            type: string
                                            minLength: 1
                                            maxLength: 200
                                        required:
                                          - url
                                          - headSha
                                      details:
                                        type: object
                                        properties:
                                          checks:
                                            type: array
                                            maxItems: 48
                                            items:
                                              type: object
                                              properties:
                                                id:
                                                  type: string
                                                  maxLength: 500
                                                name:
                                                  type: string
                                                  maxLength: 500
                                                url:
                                                  type: string
                                                  maxLength: 2048
                                                  format: uri
                                                summary:
                                                  type: string
                                                  maxLength: 6000
                                              required:
                                                - name
                                          logs:
                                            type: array
                                            maxItems: 48
                                            items:
                                              type: object
                                              properties:
                                                name:
                                                  type: string
                                                  maxLength: 500
                                                body:
                                                  type: string
                                                  maxLength: 6000
                                              required:
                                                - name
                                                - body
                                          comments:
                                            type: array
                                            maxItems: 48
                                            items:
                                              type: object
                                              properties:
                                                body:
                                                  type: string
                                                  maxLength: 6000
                                                id:
                                                  type: string
                                                  maxLength: 500
                                                authorKind:
                                                  enum:
                                                    - human
                                                    - coderabbit
                                                    - unknown
                                                  type: string
                                                author:
                                                  type: string
                                                  maxLength: 500
                                                url:
                                                  type: string
                                                  maxLength: 2048
                                                  format: uri
                                                path:
                                                  type: string
                                                  maxLength: 500
                                                line:
                                                  type: integer
                                                  minimum: 0
                                                  exclusiveMinimum: true
                                                originalLine:
                                                  type: integer
                                                  minimum: 0
                                                  exclusiveMinimum: true
                                                originalCommitSha:
                                                  type: string
                                                  maxLength: 500
                                                outdated:
                                                  type: boolean
                                              required:
                                                - body
                                          warnings:
                                            type: array
                                            maxItems: 12
                                            items:
                                              type: string
                                              maxLength: 500
                                        required:
                                          - checks
                                          - logs
                                          - comments
                                          - warnings
                                      kind:
                                        enum:
                                          - fix_ci
                                          - fix_pre_merge_checks
                                          - generate_docstrings
                                          - generate_unit_tests
                                          - simplify_code
                                          - address_comments
                                          - fix_ci_and_address_comments
                                        type: string
                                    required:
                                      - details
                                      - kind
                                  - type: object
                                    properties:
                                      origin:
                                        enum:
                                          - autopilot
                                      trigger:
                                        enum:
                                          - merge_queue_eviction
                                      pullRequest:
                                        type: object
                                        properties:
                                          url:
                                            type: string
                                            maxLength: 2048
                                            format: uri
                                          title:
                                            type: string
                                            maxLength: 500
                                          headBranch:
                                            type: string
                                            maxLength: 500
                                          baseBranch:
                                            type: string
                                            maxLength: 500
                                          headSha:
                                            type: string
                                            minLength: 1
                                            maxLength: 200
                                        required:
                                          - url
                                          - headSha
                                      details:
                                        type: object
                                        properties:
                                          checks:
                                            type: array
                                            maxItems: 48
                                            items:
                                              type: object
                                              properties:
                                                id:
                                                  type: string
                                                  maxLength: 500
                                                name:
                                                  type: string
                                                  maxLength: 500
                                                url:
                                                  type: string
                                                  maxLength: 2048
                                                  format: uri
                                                summary:
                                                  type: string
                                                  maxLength: 6000
                                              required:
                                                - name
                                          logs:
                                            type: array
                                            maxItems: 48
                                            items:
                                              type: object
                                              properties:
                                                name:
                                                  type: string
                                                  maxLength: 500
                                                body:
                                                  type: string
                                                  maxLength: 6000
                                              required:
                                                - name
                                                - body
                                          comments:
                                            type: array
                                            maxItems: 48
                                            items:
                                              type: object
                                              properties:
                                                body:
                                                  type: string
                                                  maxLength: 6000
                                                id:
                                                  type: string
                                                  maxLength: 500
                                                authorKind:
                                                  enum:
                                                    - human
                                                    - coderabbit
                                                    - unknown
                                                  type: string
                                                author:
                                                  type: string
                                                  maxLength: 500
                                                url:
                                                  type: string
                                                  maxLength: 2048
                                                  format: uri
                                                path:
                                                  type: string
                                                  maxLength: 500
                                                line:
                                                  type: integer
                                                  minimum: 0
                                                  exclusiveMinimum: true
                                                originalLine:
                                                  type: integer
                                                  minimum: 0
                                                  exclusiveMinimum: true
                                                originalCommitSha:
                                                  type: string
                                                  maxLength: 500
                                                outdated:
                                                  type: boolean
                                              required:
                                                - body
                                          warnings:
                                            type: array
                                            maxItems: 12
                                            items:
                                              type: string
                                              maxLength: 500
                                        required:
                                          - checks
                                          - logs
                                          - comments
                                          - warnings
                                      kind:
                                        enum:
                                          - run_custom_recipe
                                      recipeName:
                                        type: string
                                        maxLength: 500
                                    required:
                                      - details
                                      - kind
                                  - type: object
                                    properties:
                                      origin:
                                        enum:
                                          - autopilot
                                      trigger:
                                        enum:
                                          - merge_queue_eviction
                                      pullRequest:
                                        type: object
                                        properties:
                                          url:
                                            type: string
                                            maxLength: 2048
                                            format: uri
                                          title:
                                            type: string
                                            maxLength: 500
                                          headBranch:
                                            type: string
                                            maxLength: 500
                                          baseBranch:
                                            type: string
                                            maxLength: 500
                                          headSha:
                                            type: string
                                            minLength: 1
                                            maxLength: 200
                                        required:
                                          - url
                                          - headSha
                                      details:
                                        type: object
                                        properties:
                                          checks:
                                            type: array
                                            maxItems: 48
                                            items:
                                              type: object
                                              properties:
                                                id:
                                                  type: string
                                                  maxLength: 500
                                                name:
                                                  type: string
                                                  maxLength: 500
                                                url:
                                                  type: string
                                                  maxLength: 2048
                                                  format: uri
                                                summary:
                                                  type: string
                                                  maxLength: 6000
                                              required:
                                                - name
                                          logs:
                                            type: array
                                            maxItems: 48
                                            items:
                                              type: object
                                              properties:
                                                name:
                                                  type: string
                                                  maxLength: 500
                                                body:
                                                  type: string
                                                  maxLength: 6000
                                              required:
                                                - name
                                                - body
                                          comments:
                                            type: array
                                            maxItems: 48
                                            items:
                                              type: object
                                              properties:
                                                body:
                                                  type: string
                                                  maxLength: 6000
                                                id:
                                                  type: string
                                                  maxLength: 500
                                                authorKind:
                                                  enum:
                                                    - human
                                                    - coderabbit
                                                    - unknown
                                                  type: string
                                                author:
                                                  type: string
                                                  maxLength: 500
                                                url:
                                                  type: string
                                                  maxLength: 2048
                                                  format: uri
                                                path:
                                                  type: string
                                                  maxLength: 500
                                                line:
                                                  type: integer
                                                  minimum: 0
                                                  exclusiveMinimum: true
                                                originalLine:
                                                  type: integer
                                                  minimum: 0
                                                  exclusiveMinimum: true
                                                originalCommitSha:
                                                  type: string
                                                  maxLength: 500
                                                outdated:
                                                  type: boolean
                                              required:
                                                - body
                                          warnings:
                                            type: array
                                            maxItems: 12
                                            items:
                                              type: string
                                              maxLength: 500
                                        required:
                                          - checks
                                          - logs
                                          - comments
                                          - warnings
                                      kind:
                                        enum:
                                          - resolve_conflicts
                                    required:
                                      - details
                                      - kind
                              - type: string
                                nullable: true
                                enum:
                                  - null
                          operationMergeConflictResolution:
                            anyOf:
                              - type: object
                                properties:
                                  pullRequestNumber:
                                    type: integer
                                    minimum: 0
                                    exclusiveMinimum: true
                                  headBranch:
                                    type: string
                                    minLength: 1
                                    maxLength: 1024
                                  baseBranch:
                                    type: string
                                    minLength: 1
                                    maxLength: 1024
                                  baseCloneUrl:
                                    type: string
                                    format: uri
                                  expectedHeadSha: {}
                                  baseSha: {}
                                  conflictingFiles:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        path:
                                          type: string
                                          minLength: 1
                                          maxLength: 4096
                                        conflictType:
                                          type: string
                                          minLength: 1
                                          maxLength: 128
                                      required:
                                        - path
                                        - conflictType
                                      additionalProperties: false
                                  baseRepositoryId:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                  baseRefreshUsed:
                                    enum:
                                      - true
                                required:
                                  - pullRequestNumber
                                  - headBranch
                                  - baseBranch
                                  - baseCloneUrl
                                  - conflictingFiles
                                  - baseRepositoryId
                                additionalProperties: false
                              - type: string
                                nullable: true
                                enum:
                                  - null
                            default: null
                          operationFindings:
                            type: array
                            maxItems: 500
                            items:
                              type: object
                              properties:
                                commentIdentity:
                                  type: string
                                  pattern: ^[a-f0-9]{24}$
                                isNitpick:
                                  enum:
                                    - true
                                isOutsideDiff:
                                  enum:
                                    - true
                                filePath:
                                  type: string
                                  minLength: 1
                                  maxLength: 4096
                                startLine:
                                  type: integer
                                  minimum: 0
                                  exclusiveMinimum: true
                                endLine:
                                  type: integer
                                  minimum: 0
                                  exclusiveMinimum: true
                                codegenInstructions:
                                  type: string
                                  minLength: 1
                                  maxLength: 20000
                              required:
                                - filePath
                                - startLine
                                - endLine
                                - codegenInstructions
                            default: []
                          findingDispositions:
                            type: array
                            maxItems: 500
                            items:
                              type: object
                              properties:
                                findingId:
                                  type: string
                                  pattern: ^finding-[1-9]\d*$
                                disposition:
                                  enum:
                                    - invalid
                                    - already_fixed
                                  type: string
                                reason:
                                  type: string
                                  minLength: 1
                                  maxLength: 2000
                                evidence:
                                  anyOf:
                                    - type: string
                                      minLength: 1
                                      maxLength: 4000
                                    - type: string
                                      minLength: 1
                                      maxLength: 4000
                                operationId:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                headSha:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                finding:
                                  type: object
                                  properties:
                                    commentIdentity:
                                      type: string
                                      pattern: ^[a-f0-9]{24}$
                                    isNitpick:
                                      enum:
                                        - true
                                    isOutsideDiff:
                                      enum:
                                        - true
                                    filePath:
                                      type: string
                                      minLength: 1
                                      maxLength: 4096
                                    startLine:
                                      type: integer
                                      minimum: 0
                                      exclusiveMinimum: true
                                    endLine:
                                      type: integer
                                      minimum: 0
                                      exclusiveMinimum: true
                                    codegenInstructions:
                                      type: string
                                      minLength: 1
                                      maxLength: 20000
                                  required:
                                    - filePath
                                    - startLine
                                    - endLine
                                    - codegenInstructions
                              required:
                                - findingId
                                - disposition
                                - reason
                                - evidence
                                - operationId
                                - headSha
                                - finding
                              additionalProperties: false
                            default: []
                          operationBilling:
                            anyOf:
                              - anyOf:
                                  - type: object
                                    properties:
                                      access:
                                        enum:
                                          - metered
                                      factoryLoop:
                                        type: object
                                        properties:
                                          loopId:
                                            type: string
                                            format: uuid
                                          runId:
                                            type: string
                                            format: uuid
                                          startupProtocol:
                                            enum:
                                              - occurrence_v1
                                          remainingMilliseconds:
                                            anyOf:
                                              - type: integer
                                                minimum: 0
                                                exclusiveMinimum: true
                                              - type: string
                                                nullable: true
                                                enum:
                                                  - null
                                        required:
                                          - loopId
                                          - runId
                                          - remainingMilliseconds
                                        additionalProperties: false
                                      codingPaidUsageAllowedAtAdmission:
                                        type: boolean
                                      codingSpendCapPolicy:
                                        enum:
                                          - admission_v1
                                      chargebeeSubscriptionId:
                                        type: string
                                        minLength: 1
                                      prepaidAuthorizationRequired:
                                        type: boolean
                                      prepaidUsageMetric:
                                        enum:
                                          - agent_minutes
                                          - coding_agent_minutes
                                        type: string
                                      creditActor:
                                        type: object
                                        properties:
                                          provider:
                                            enum:
                                              - slack
                                              - discord
                                              - microsoft_teams
                                              - github
                                              - gitlab
                                              - bitbucket
                                              - azure-devops
                                              - origin
                                              - github-self-hosted
                                              - gitlab-self-hosted
                                              - bitbucket-self-hosted
                                              - azure-devops-self-hosted
                                              - gerrit-self-hosted
                                            type: string
                                          userId:
                                            type: string
                                            minLength: 1
                                            maxLength: 255
                                        required:
                                          - provider
                                          - userId
                                        additionalProperties: false
                                    required:
                                      - access
                                      - chargebeeSubscriptionId
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      access:
                                        enum:
                                          - trial_credits
                                      factoryLoop:
                                        type: object
                                        properties:
                                          loopId:
                                            type: string
                                            format: uuid
                                          runId:
                                            type: string
                                            format: uuid
                                          startupProtocol:
                                            enum:
                                              - occurrence_v1
                                          remainingMilliseconds:
                                            anyOf:
                                              - type: integer
                                                minimum: 0
                                                exclusiveMinimum: true
                                              - type: string
                                                nullable: true
                                                enum:
                                                  - null
                                        required:
                                          - loopId
                                          - runId
                                          - remainingMilliseconds
                                        additionalProperties: false
                                      codingPaidUsageAllowedAtAdmission:
                                        type: boolean
                                      codingSpendCapPolicy:
                                        enum:
                                          - admission_v1
                                      creditActor:
                                        type: object
                                        properties:
                                          provider:
                                            enum:
                                              - slack
                                              - discord
                                              - microsoft_teams
                                              - github
                                              - gitlab
                                              - bitbucket
                                              - azure-devops
                                              - origin
                                              - github-self-hosted
                                              - gitlab-self-hosted
                                              - bitbucket-self-hosted
                                              - azure-devops-self-hosted
                                              - gerrit-self-hosted
                                            type: string
                                          userId:
                                            type: string
                                            minLength: 1
                                            maxLength: 255
                                        required:
                                          - provider
                                          - userId
                                        additionalProperties: false
                                      triageExhaustedCreditsWaived:
                                        type: boolean
                                      triageExhaustedCreditsWaivedUntil:
                                        type: string
                                    required:
                                      - access
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      access:
                                        enum:
                                          - unlimited
                                      factoryLoop:
                                        type: object
                                        properties:
                                          loopId:
                                            type: string
                                            format: uuid
                                          runId:
                                            type: string
                                            format: uuid
                                          startupProtocol:
                                            enum:
                                              - occurrence_v1
                                          remainingMilliseconds:
                                            anyOf:
                                              - type: integer
                                                minimum: 0
                                                exclusiveMinimum: true
                                              - type: string
                                                nullable: true
                                                enum:
                                                  - null
                                        required:
                                          - loopId
                                          - runId
                                          - remainingMilliseconds
                                        additionalProperties: false
                                    required:
                                      - access
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      access:
                                        enum:
                                          - free_turn
                                      factoryLoop:
                                        type: object
                                        properties:
                                          loopId:
                                            type: string
                                            format: uuid
                                          runId:
                                            type: string
                                            format: uuid
                                          startupProtocol:
                                            enum:
                                              - occurrence_v1
                                          remainingMilliseconds:
                                            anyOf:
                                              - type: integer
                                                minimum: 0
                                                exclusiveMinimum: true
                                              - type: string
                                                nullable: true
                                                enum:
                                                  - null
                                        required:
                                          - loopId
                                          - runId
                                          - remainingMilliseconds
                                        additionalProperties: false
                                      collaborationMode:
                                        enum:
                                          - plan
                                    required:
                                      - access
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      access:
                                        enum:
                                          - development_bypass
                                      factoryLoop:
                                        type: object
                                        properties:
                                          loopId:
                                            type: string
                                            format: uuid
                                          runId:
                                            type: string
                                            format: uuid
                                          startupProtocol:
                                            enum:
                                              - occurrence_v1
                                          remainingMilliseconds:
                                            anyOf:
                                              - type: integer
                                                minimum: 0
                                                exclusiveMinimum: true
                                              - type: string
                                                nullable: true
                                                enum:
                                                  - null
                                        required:
                                          - loopId
                                          - runId
                                          - remainingMilliseconds
                                        additionalProperties: false
                                    required:
                                      - access
                                    additionalProperties: false
                              - type: string
                                nullable: true
                                enum:
                                  - null
                            default: null
                          settledOperationId:
                            anyOf:
                              - type: string
                              - type: string
                                nullable: true
                                enum:
                                  - null
                            default: null
                          review:
                            anyOf:
                              - type: object
                                properties:
                                  headSha:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                  complete:
                                    type: boolean
                                  botUserId:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                  findings:
                                    type: array
                                    maxItems: 500
                                    items:
                                      type: object
                                      properties:
                                        commentIdentity:
                                          type: string
                                          pattern: ^[a-f0-9]{24}$
                                        isNitpick:
                                          enum:
                                            - true
                                        isOutsideDiff:
                                          enum:
                                            - true
                                        filePath:
                                          type: string
                                          minLength: 1
                                          maxLength: 4096
                                        startLine:
                                          type: integer
                                          minimum: 0
                                          exclusiveMinimum: true
                                        endLine:
                                          type: integer
                                          minimum: 0
                                          exclusiveMinimum: true
                                        codegenInstructions:
                                          type: string
                                          minLength: 1
                                          maxLength: 20000
                                      required:
                                        - filePath
                                        - startLine
                                        - endLine
                                        - codegenInstructions
                                  blockingPreMergeChecks:
                                    type: array
                                    maxItems: 500
                                    items:
                                      type: object
                                      properties:
                                        checkName:
                                          type: string
                                          minLength: 1
                                          maxLength: 512
                                        explanation:
                                          type: string
                                          maxLength: 4000
                                        resolution:
                                          type: string
                                          minLength: 1
                                          maxLength: 4000
                                      required:
                                        - checkName
                                        - explanation
                                      additionalProperties: false
                                    default: []
                                required:
                                  - headSha
                                  - complete
                                  - findings
                              - type: string
                                nullable: true
                                enum:
                                  - null
                            default: null
                          reviewHistory:
                            type: array
                            maxItems: 10
                            items:
                              type: object
                              properties:
                                headSha:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                complete:
                                  type: boolean
                                botUserId:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                findings:
                                  type: array
                                  maxItems: 500
                                  items:
                                    type: object
                                    properties:
                                      commentIdentity:
                                        type: string
                                        pattern: ^[a-f0-9]{24}$
                                      isNitpick:
                                        enum:
                                          - true
                                      isOutsideDiff:
                                        enum:
                                          - true
                                      filePath:
                                        type: string
                                        minLength: 1
                                        maxLength: 4096
                                      startLine:
                                        type: integer
                                        minimum: 0
                                        exclusiveMinimum: true
                                      endLine:
                                        type: integer
                                        minimum: 0
                                        exclusiveMinimum: true
                                      codegenInstructions:
                                        type: string
                                        minLength: 1
                                        maxLength: 20000
                                    required:
                                      - filePath
                                      - startLine
                                      - endLine
                                      - codegenInstructions
                                blockingPreMergeChecks:
                                  type: array
                                  maxItems: 500
                                  items:
                                    type: object
                                    properties:
                                      checkName:
                                        type: string
                                        minLength: 1
                                        maxLength: 512
                                      explanation:
                                        type: string
                                        maxLength: 4000
                                      resolution:
                                        type: string
                                        minLength: 1
                                        maxLength: 4000
                                    required:
                                      - checkName
                                      - explanation
                                    additionalProperties: false
                                  default: []
                              required:
                                - headSha
                                - complete
                                - findings
                            default: []
                          cursor:
                            anyOf:
                              - type: string
                                maxLength: 4096
                              - type: string
                                nullable: true
                                enum:
                                  - null
                            default: null
                          workflowId:
                            anyOf:
                              - type: string
                              - type: string
                                nullable: true
                                enum:
                                  - null
                          reason:
                            anyOf:
                              - type: string
                                maxLength: 2000
                              - type: string
                                nullable: true
                                enum:
                                  - null
                          updatedAt:
                            type: string
                            format: date-time
                        required:
                          - id
                          - organizationId
                          - provider
                          - host
                          - repoId
                          - owner
                          - repo
                          - taskId
                          - prNumber
                          - prUrl
                          - sourceRepositoryId
                          - sourceBranch
                          - requestedBy
                          - providerUserId
                          - enabled
                          - generation
                          - revision
                          - pendingRevision
                          - state
                          - rounds
                          - unchangedRounds
                          - headSha
                          - remainingFingerprint
                          - operationId
                          - workflowId
                          - reason
                          - updatedAt
                        additionalProperties: false
                      - type: string
                        nullable: true
                        enum:
                          - null
                  ciFollowups:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      organizationId:
                        type: string
                        format: uuid
                      provider:
                        enum:
                          - github
                          - gitlab
                          - azure-devops
                          - bitbucket
                        type: string
                      host:
                        enum:
                          - github.com
                          - gitlab.com
                          - dev.azure.com
                          - bitbucket.org
                        type: string
                      repoId:
                        type: string
                        minLength: 1
                        maxLength: 255
                      owner:
                        type: string
                        minLength: 1
                        maxLength: 255
                      repo:
                        type: string
                        minLength: 1
                        maxLength: 255
                      taskId:
                        type: string
                        minLength: 1
                        maxLength: 64
                      prNumber:
                        anyOf:
                          - type: integer
                            minimum: 0
                            exclusiveMinimum: true
                          - type: string
                            nullable: true
                            enum:
                              - null
                      prUrl:
                        anyOf:
                          - type: string
                            format: uri
                          - type: string
                            nullable: true
                            enum:
                              - null
                      summaryCommentId:
                        anyOf:
                          - type: integer
                            minimum: 0
                            exclusiveMinimum: true
                          - type: string
                            nullable: true
                            enum:
                              - null
                        default: null
                      sourceRepositoryId:
                        anyOf:
                          - type: string
                            minLength: 1
                            maxLength: 255
                          - type: string
                            nullable: true
                            enum:
                              - null
                      sourceBranch:
                        anyOf:
                          - type: string
                            maxLength: 1024
                          - type: string
                            nullable: true
                            enum:
                              - null
                      baseBranch:
                        anyOf:
                          - type: string
                            maxLength: 1024
                          - type: string
                            nullable: true
                            enum:
                              - null
                        default: null
                      requestedBy:
                        type: object
                        properties:
                          id:
                            type: string
                            minLength: 1
                            maxLength: 255
                          login:
                            type: string
                            minLength: 1
                            maxLength: 255
                        required:
                          - id
                      providerUserId:
                        type: string
                        minLength: 1
                        maxLength: 255
                      repairScope:
                        enum:
                          - all
                          - ci
                        type: string
                      enabled:
                        type: boolean
                      generation:
                        type: integer
                        minimum: 0
                      revision:
                        type: integer
                        minimum: 0
                      pendingRevision:
                        type: integer
                        minimum: 0
                      pendingEventAt:
                        anyOf:
                          - type: string
                            format: date-time
                          - type: string
                            nullable: true
                            enum:
                              - null
                        default: null
                      processedRevision:
                        type: integer
                        minimum: 0
                        default: 0
                      nativeActionIds:
                        type: array
                        maxItems: 200
                        items:
                          type: string
                          pattern: ^[a-f0-9]{64}$
                        default: []
                      state:
                        enum:
                          - waiting_for_pr
                          - checking
                          - fixing
                          - waiting
                          - green
                          - paused
                          - stopped
                        type: string
                      rounds:
                        type: integer
                        minimum: 0
                        maximum: 5
                      unchangedRounds:
                        type: integer
                        minimum: 0
                      headSha:
                        anyOf:
                          - type: string
                          - type: string
                            nullable: true
                            enum:
                              - null
                      mergeQueueEviction:
                        anyOf:
                          - type: object
                            properties:
                              headSha:
                                type: string
                                minLength: 1
                                maxLength: 255
                              reason:
                                enum:
                                  - CI_FAILURE
                                  - INVALID_MERGE_COMMIT
                                  - MERGE_CONFLICT
                                  - MERGE_CONFLICT_ERROR
                                type: string
                            required:
                              - headSha
                              - reason
                            additionalProperties: false
                          - type: string
                            nullable: true
                            enum:
                              - null
                        default: null
                      remainingFingerprint:
                        anyOf:
                          - type: string
                          - type: string
                            nullable: true
                            enum:
                              - null
                      operationId:
                        anyOf:
                          - type: string
                          - type: string
                            nullable: true
                            enum:
                              - null
                      operationHeadSha:
                        anyOf:
                          - type: string
                          - type: string
                            nullable: true
                            enum:
                              - null
                        default: null
                      operationContinuationTurnId:
                        anyOf:
                          - type: string
                            minLength: 1
                            maxLength: 255
                          - type: string
                            nullable: true
                            enum:
                              - null
                      operationPrompt:
                        anyOf:
                          - type: string
                            maxLength: 200000
                          - type: string
                            nullable: true
                            enum:
                              - null
                        default: null
                      operationActionContext:
                        anyOf:
                          - anyOf:
                              - type: object
                                properties:
                                  origin:
                                    enum:
                                      - autopilot
                                  trigger:
                                    enum:
                                      - merge_queue_eviction
                                  pullRequest:
                                    type: object
                                    properties:
                                      url:
                                        type: string
                                        maxLength: 2048
                                        format: uri
                                      title:
                                        type: string
                                        maxLength: 500
                                      headBranch:
                                        type: string
                                        maxLength: 500
                                      baseBranch:
                                        type: string
                                        maxLength: 500
                                      headSha:
                                        type: string
                                        minLength: 1
                                        maxLength: 200
                                    required:
                                      - url
                                      - headSha
                                  details:
                                    type: object
                                    properties:
                                      checks:
                                        type: array
                                        maxItems: 48
                                        items:
                                          type: object
                                          properties:
                                            id:
                                              type: string
                                              maxLength: 500
                                            name:
                                              type: string
                                              maxLength: 500
                                            url:
                                              type: string
                                              maxLength: 2048
                                              format: uri
                                            summary:
                                              type: string
                                              maxLength: 6000
                                          required:
                                            - name
                                      logs:
                                        type: array
                                        maxItems: 48
                                        items:
                                          type: object
                                          properties:
                                            name:
                                              type: string
                                              maxLength: 500
                                            body:
                                              type: string
                                              maxLength: 6000
                                          required:
                                            - name
                                            - body
                                      comments:
                                        type: array
                                        maxItems: 48
                                        items:
                                          type: object
                                          properties:
                                            body:
                                              type: string
                                              maxLength: 6000
                                            id:
                                              type: string
                                              maxLength: 500
                                            authorKind:
                                              enum:
                                                - human
                                                - coderabbit
                                                - unknown
                                              type: string
                                            author:
                                              type: string
                                              maxLength: 500
                                            url:
                                              type: string
                                              maxLength: 2048
                                              format: uri
                                            path:
                                              type: string
                                              maxLength: 500
                                            line:
                                              type: integer
                                              minimum: 0
                                              exclusiveMinimum: true
                                            originalLine:
                                              type: integer
                                              minimum: 0
                                              exclusiveMinimum: true
                                            originalCommitSha:
                                              type: string
                                              maxLength: 500
                                            outdated:
                                              type: boolean
                                          required:
                                            - body
                                      warnings:
                                        type: array
                                        maxItems: 12
                                        items:
                                          type: string
                                          maxLength: 500
                                    required:
                                      - checks
                                      - logs
                                      - comments
                                      - warnings
                                  kind:
                                    enum:
                                      - fix_ci
                                      - fix_pre_merge_checks
                                      - generate_docstrings
                                      - generate_unit_tests
                                      - simplify_code
                                      - address_comments
                                      - fix_ci_and_address_comments
                                    type: string
                                required:
                                  - details
                                  - kind
                              - type: object
                                properties:
                                  origin:
                                    enum:
                                      - autopilot
                                  trigger:
                                    enum:
                                      - merge_queue_eviction
                                  pullRequest:
                                    type: object
                                    properties:
                                      url:
                                        type: string
                                        maxLength: 2048
                                        format: uri
                                      title:
                                        type: string
                                        maxLength: 500
                                      headBranch:
                                        type: string
                                        maxLength: 500
                                      baseBranch:
                                        type: string
                                        maxLength: 500
                                      headSha:
                                        type: string
                                        minLength: 1
                                        maxLength: 200
                                    required:
                                      - url
                                      - headSha
                                  details:
                                    type: object
                                    properties:
                                      checks:
                                        type: array
                                        maxItems: 48
                                        items:
                                          type: object
                                          properties:
                                            id:
                                              type: string
                                              maxLength: 500
                                            name:
                                              type: string
                                              maxLength: 500
                                            url:
                                              type: string
                                              maxLength: 2048
                                              format: uri
                                            summary:
                                              type: string
                                              maxLength: 6000
                                          required:
                                            - name
                                      logs:
                                        type: array
                                        maxItems: 48
                                        items:
                                          type: object
                                          properties:
                                            name:
                                              type: string
                                              maxLength: 500
                                            body:
                                              type: string
                                              maxLength: 6000
                                          required:
                                            - name
                                            - body
                                      comments:
                                        type: array
                                        maxItems: 48
                                        items:
                                          type: object
                                          properties:
                                            body:
                                              type: string
                                              maxLength: 6000
                                            id:
                                              type: string
                                              maxLength: 500
                                            authorKind:
                                              enum:
                                                - human
                                                - coderabbit
                                                - unknown
                                              type: string
                                            author:
                                              type: string
                                              maxLength: 500
                                            url:
                                              type: string
                                              maxLength: 2048
                                              format: uri
                                            path:
                                              type: string
                                              maxLength: 500
                                            line:
                                              type: integer
                                              minimum: 0
                                              exclusiveMinimum: true
                                            originalLine:
                                              type: integer
                                              minimum: 0
                                              exclusiveMinimum: true
                                            originalCommitSha:
                                              type: string
                                              maxLength: 500
                                            outdated:
                                              type: boolean
                                          required:
                                            - body
                                      warnings:
                                        type: array
                                        maxItems: 12
                                        items:
                                          type: string
                                          maxLength: 500
                                    required:
                                      - checks
                                      - logs
                                      - comments
                                      - warnings
                                  kind:
                                    enum:
                                      - run_custom_recipe
                                  recipeName:
                                    type: string
                                    maxLength: 500
                                required:
                                  - details
                                  - kind
                              - type: object
                                properties:
                                  origin:
                                    enum:
                                      - autopilot
                                  trigger:
                                    enum:
                                      - merge_queue_eviction
                                  pullRequest:
                                    type: object
                                    properties:
                                      url:
                                        type: string
                                        maxLength: 2048
                                        format: uri
                                      title:
                                        type: string
                                        maxLength: 500
                                      headBranch:
                                        type: string
                                        maxLength: 500
                                      baseBranch:
                                        type: string
                                        maxLength: 500
                                      headSha:
                                        type: string
                                        minLength: 1
                                        maxLength: 200
                                    required:
                                      - url
                                      - headSha
                                  details:
                                    type: object
                                    properties:
                                      checks:
                                        type: array
                                        maxItems: 48
                                        items:
                                          type: object
                                          properties:
                                            id:
                                              type: string
                                              maxLength: 500
                                            name:
                                              type: string
                                              maxLength: 500
                                            url:
                                              type: string
                                              maxLength: 2048
                                              format: uri
                                            summary:
                                              type: string
                                              maxLength: 6000
                                          required:
                                            - name
                                      logs:
                                        type: array
                                        maxItems: 48
                                        items:
                                          type: object
                                          properties:
                                            name:
                                              type: string
                                              maxLength: 500
                                            body:
                                              type: string
                                              maxLength: 6000
                                          required:
                                            - name
                                            - body
                                      comments:
                                        type: array
                                        maxItems: 48
                                        items:
                                          type: object
                                          properties:
                                            body:
                                              type: string
                                              maxLength: 6000
                                            id:
                                              type: string
                                              maxLength: 500
                                            authorKind:
                                              enum:
                                                - human
                                                - coderabbit
                                                - unknown
                                              type: string
                                            author:
                                              type: string
                                              maxLength: 500
                                            url:
                                              type: string
                                              maxLength: 2048
                                              format: uri
                                            path:
                                              type: string
                                              maxLength: 500
                                            line:
                                              type: integer
                                              minimum: 0
                                              exclusiveMinimum: true
                                            originalLine:
                                              type: integer
                                              minimum: 0
                                              exclusiveMinimum: true
                                            originalCommitSha:
                                              type: string
                                              maxLength: 500
                                            outdated:
                                              type: boolean
                                          required:
                                            - body
                                      warnings:
                                        type: array
                                        maxItems: 12
                                        items:
                                          type: string
                                          maxLength: 500
                                    required:
                                      - checks
                                      - logs
                                      - comments
                                      - warnings
                                  kind:
                                    enum:
                                      - resolve_conflicts
                                required:
                                  - details
                                  - kind
                          - type: string
                            nullable: true
                            enum:
                              - null
                      operationMergeConflictResolution:
                        anyOf:
                          - type: object
                            properties:
                              pullRequestNumber:
                                type: integer
                                minimum: 0
                                exclusiveMinimum: true
                              headBranch:
                                type: string
                                minLength: 1
                                maxLength: 1024
                              baseBranch:
                                type: string
                                minLength: 1
                                maxLength: 1024
                              baseCloneUrl:
                                type: string
                                format: uri
                              expectedHeadSha: {}
                              baseSha: {}
                              conflictingFiles:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    path:
                                      type: string
                                      minLength: 1
                                      maxLength: 4096
                                    conflictType:
                                      type: string
                                      minLength: 1
                                      maxLength: 128
                                  required:
                                    - path
                                    - conflictType
                                  additionalProperties: false
                              baseRepositoryId:
                                type: string
                                minLength: 1
                                maxLength: 255
                              baseRefreshUsed:
                                enum:
                                  - true
                            required:
                              - pullRequestNumber
                              - headBranch
                              - baseBranch
                              - baseCloneUrl
                              - conflictingFiles
                              - baseRepositoryId
                            additionalProperties: false
                          - type: string
                            nullable: true
                            enum:
                              - null
                        default: null
                      operationFindings:
                        type: array
                        maxItems: 500
                        items:
                          type: object
                          properties:
                            commentIdentity:
                              type: string
                              pattern: ^[a-f0-9]{24}$
                            isNitpick:
                              enum:
                                - true
                            isOutsideDiff:
                              enum:
                                - true
                            filePath:
                              type: string
                              minLength: 1
                              maxLength: 4096
                            startLine:
                              type: integer
                              minimum: 0
                              exclusiveMinimum: true
                            endLine:
                              type: integer
                              minimum: 0
                              exclusiveMinimum: true
                            codegenInstructions:
                              type: string
                              minLength: 1
                              maxLength: 20000
                          required:
                            - filePath
                            - startLine
                            - endLine
                            - codegenInstructions
                        default: []
                      findingDispositions:
                        type: array
                        maxItems: 500
                        items:
                          type: object
                          properties:
                            findingId:
                              type: string
                              pattern: ^finding-[1-9]\d*$
                            disposition:
                              enum:
                                - invalid
                                - already_fixed
                              type: string
                            reason:
                              type: string
                              minLength: 1
                              maxLength: 2000
                            evidence:
                              anyOf:
                                - type: string
                                  minLength: 1
                                  maxLength: 4000
                                - type: string
                                  minLength: 1
                                  maxLength: 4000
                            operationId:
                              type: string
                              minLength: 1
                              maxLength: 255
                            headSha:
                              type: string
                              minLength: 1
                              maxLength: 255
                            finding:
                              type: object
                              properties:
                                commentIdentity:
                                  type: string
                                  pattern: ^[a-f0-9]{24}$
                                isNitpick:
                                  enum:
                                    - true
                                isOutsideDiff:
                                  enum:
                                    - true
                                filePath:
                                  type: string
                                  minLength: 1
                                  maxLength: 4096
                                startLine:
                                  type: integer
                                  minimum: 0
                                  exclusiveMinimum: true
                                endLine:
                                  type: integer
                                  minimum: 0
                                  exclusiveMinimum: true
                                codegenInstructions:
                                  type: string
                                  minLength: 1
                                  maxLength: 20000
                              required:
                                - filePath
                                - startLine
                                - endLine
                                - codegenInstructions
                          required:
                            - findingId
                            - disposition
                            - reason
                            - evidence
                            - operationId
                            - headSha
                            - finding
                          additionalProperties: false
                        default: []
                      operationBilling:
                        anyOf:
                          - anyOf:
                              - type: object
                                properties:
                                  access:
                                    enum:
                                      - metered
                                  factoryLoop:
                                    type: object
                                    properties:
                                      loopId:
                                        type: string
                                        format: uuid
                                      runId:
                                        type: string
                                        format: uuid
                                      startupProtocol:
                                        enum:
                                          - occurrence_v1
                                      remainingMilliseconds:
                                        anyOf:
                                          - type: integer
                                            minimum: 0
                                            exclusiveMinimum: true
                                          - type: string
                                            nullable: true
                                            enum:
                                              - null
                                    required:
                                      - loopId
                                      - runId
                                      - remainingMilliseconds
                                    additionalProperties: false
                                  codingPaidUsageAllowedAtAdmission:
                                    type: boolean
                                  codingSpendCapPolicy:
                                    enum:
                                      - admission_v1
                                  chargebeeSubscriptionId:
                                    type: string
                                    minLength: 1
                                  prepaidAuthorizationRequired:
                                    type: boolean
                                  prepaidUsageMetric:
                                    enum:
                                      - agent_minutes
                                      - coding_agent_minutes
                                    type: string
                                  creditActor:
                                    type: object
                                    properties:
                                      provider:
                                        enum:
                                          - slack
                                          - discord
                                          - microsoft_teams
                                          - github
                                          - gitlab
                                          - bitbucket
                                          - azure-devops
                                          - origin
                                          - github-self-hosted
                                          - gitlab-self-hosted
                                          - bitbucket-self-hosted
                                          - azure-devops-self-hosted
                                          - gerrit-self-hosted
                                        type: string
                                      userId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                    required:
                                      - provider
                                      - userId
                                    additionalProperties: false
                                required:
                                  - access
                                  - chargebeeSubscriptionId
                                additionalProperties: false
                              - type: object
                                properties:
                                  access:
                                    enum:
                                      - trial_credits
                                  factoryLoop:
                                    type: object
                                    properties:
                                      loopId:
                                        type: string
                                        format: uuid
                                      runId:
                                        type: string
                                        format: uuid
                                      startupProtocol:
                                        enum:
                                          - occurrence_v1
                                      remainingMilliseconds:
                                        anyOf:
                                          - type: integer
                                            minimum: 0
                                            exclusiveMinimum: true
                                          - type: string
                                            nullable: true
                                            enum:
                                              - null
                                    required:
                                      - loopId
                                      - runId
                                      - remainingMilliseconds
                                    additionalProperties: false
                                  codingPaidUsageAllowedAtAdmission:
                                    type: boolean
                                  codingSpendCapPolicy:
                                    enum:
                                      - admission_v1
                                  creditActor:
                                    type: object
                                    properties:
                                      provider:
                                        enum:
                                          - slack
                                          - discord
                                          - microsoft_teams
                                          - github
                                          - gitlab
                                          - bitbucket
                                          - azure-devops
                                          - origin
                                          - github-self-hosted
                                          - gitlab-self-hosted
                                          - bitbucket-self-hosted
                                          - azure-devops-self-hosted
                                          - gerrit-self-hosted
                                        type: string
                                      userId:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                    required:
                                      - provider
                                      - userId
                                    additionalProperties: false
                                  triageExhaustedCreditsWaived:
                                    type: boolean
                                  triageExhaustedCreditsWaivedUntil:
                                    type: string
                                required:
                                  - access
                                additionalProperties: false
                              - type: object
                                properties:
                                  access:
                                    enum:
                                      - unlimited
                                  factoryLoop:
                                    type: object
                                    properties:
                                      loopId:
                                        type: string
                                        format: uuid
                                      runId:
                                        type: string
                                        format: uuid
                                      startupProtocol:
                                        enum:
                                          - occurrence_v1
                                      remainingMilliseconds:
                                        anyOf:
                                          - type: integer
                                            minimum: 0
                                            exclusiveMinimum: true
                                          - type: string
                                            nullable: true
                                            enum:
                                              - null
                                    required:
                                      - loopId
                                      - runId
                                      - remainingMilliseconds
                                    additionalProperties: false
                                required:
                                  - access
                                additionalProperties: false
                              - type: object
                                properties:
                                  access:
                                    enum:
                                      - free_turn
                                  factoryLoop:
                                    type: object
                                    properties:
                                      loopId:
                                        type: string
                                        format: uuid
                                      runId:
                                        type: string
                                        format: uuid
                                      startupProtocol:
                                        enum:
                                          - occurrence_v1
                                      remainingMilliseconds:
                                        anyOf:
                                          - type: integer
                                            minimum: 0
                                            exclusiveMinimum: true
                                          - type: string
                                            nullable: true
                                            enum:
                                              - null
                                    required:
                                      - loopId
                                      - runId
                                      - remainingMilliseconds
                                    additionalProperties: false
                                  collaborationMode:
                                    enum:
                                      - plan
                                required:
                                  - access
                                additionalProperties: false
                              - type: object
                                properties:
                                  access:
                                    enum:
                                      - development_bypass
                                  factoryLoop:
                                    type: object
                                    properties:
                                      loopId:
                                        type: string
                                        format: uuid
                                      runId:
                                        type: string
                                        format: uuid
                                      startupProtocol:
                                        enum:
                                          - occurrence_v1
                                      remainingMilliseconds:
                                        anyOf:
                                          - type: integer
                                            minimum: 0
                                            exclusiveMinimum: true
                                          - type: string
                                            nullable: true
                                            enum:
                                              - null
                                    required:
                                      - loopId
                                      - runId
                                      - remainingMilliseconds
                                    additionalProperties: false
                                required:
                                  - access
                                additionalProperties: false
                          - type: string
                            nullable: true
                            enum:
                              - null
                        default: null
                      settledOperationId:
                        anyOf:
                          - type: string
                          - type: string
                            nullable: true
                            enum:
                              - null
                        default: null
                      review:
                        anyOf:
                          - type: object
                            properties:
                              headSha:
                                type: string
                                minLength: 1
                                maxLength: 255
                              complete:
                                type: boolean
                              botUserId:
                                type: string
                                minLength: 1
                                maxLength: 255
                              findings:
                                type: array
                                maxItems: 500
                                items:
                                  type: object
                                  properties:
                                    commentIdentity:
                                      type: string
                                      pattern: ^[a-f0-9]{24}$
                                    isNitpick:
                                      enum:
                                        - true
                                    isOutsideDiff:
                                      enum:
                                        - true
                                    filePath:
                                      type: string
                                      minLength: 1
                                      maxLength: 4096
                                    startLine:
                                      type: integer
                                      minimum: 0
                                      exclusiveMinimum: true
                                    endLine:
                                      type: integer
                                      minimum: 0
                                      exclusiveMinimum: true
                                    codegenInstructions:
                                      type: string
                                      minLength: 1
                                      maxLength: 20000
                                  required:
                                    - filePath
                                    - startLine
                                    - endLine
                                    - codegenInstructions
                              blockingPreMergeChecks:
                                type: array
                                maxItems: 500
                                items:
                                  type: object
                                  properties:
                                    checkName:
                                      type: string
                                      minLength: 1
                                      maxLength: 512
                                    explanation:
                                      type: string
                                      maxLength: 4000
                                    resolution:
                                      type: string
                                      minLength: 1
                                      maxLength: 4000
                                  required:
                                    - checkName
                                    - explanation
                                  additionalProperties: false
                                default: []
                            required:
                              - headSha
                              - complete
                              - findings
                          - type: string
                            nullable: true
                            enum:
                              - null
                        default: null
                      reviewHistory:
                        type: array
                        maxItems: 10
                        items:
                          type: object
                          properties:
                            headSha:
                              type: string
                              minLength: 1
                              maxLength: 255
                            complete:
                              type: boolean
                            botUserId:
                              type: string
                              minLength: 1
                              maxLength: 255
                            findings:
                              type: array
                              maxItems: 500
                              items:
                                type: object
                                properties:
                                  commentIdentity:
                                    type: string
                                    pattern: ^[a-f0-9]{24}$
                                  isNitpick:
                                    enum:
                                      - true
                                  isOutsideDiff:
                                    enum:
                                      - true
                                  filePath:
                                    type: string
                                    minLength: 1
                                    maxLength: 4096
                                  startLine:
                                    type: integer
                                    minimum: 0
                                    exclusiveMinimum: true
                                  endLine:
                                    type: integer
                                    minimum: 0
                                    exclusiveMinimum: true
                                  codegenInstructions:
                                    type: string
                                    minLength: 1
                                    maxLength: 20000
                                required:
                                  - filePath
                                  - startLine
                                  - endLine
                                  - codegenInstructions
                            blockingPreMergeChecks:
                              type: array
                              maxItems: 500
                              items:
                                type: object
                                properties:
                                  checkName:
                                    type: string
                                    minLength: 1
                                    maxLength: 512
                                  explanation:
                                    type: string
                                    maxLength: 4000
                                  resolution:
                                    type: string
                                    minLength: 1
                                    maxLength: 4000
                                required:
                                  - checkName
                                  - explanation
                                additionalProperties: false
                              default: []
                          required:
                            - headSha
                            - complete
                            - findings
                        default: []
                      cursor:
                        anyOf:
                          - type: string
                            maxLength: 4096
                          - type: string
                            nullable: true
                            enum:
                              - null
                        default: null
                      workflowId:
                        anyOf:
                          - type: string
                          - type: string
                            nullable: true
                            enum:
                              - null
                      reason:
                        anyOf:
                          - type: string
                            maxLength: 2000
                          - type: string
                            nullable: true
                            enum:
                              - null
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - id
                      - organizationId
                      - provider
                      - host
                      - repoId
                      - owner
                      - repo
                      - taskId
                      - prNumber
                      - prUrl
                      - sourceRepositoryId
                      - sourceBranch
                      - requestedBy
                      - providerUserId
                      - enabled
                      - generation
                      - revision
                      - pendingRevision
                      - state
                      - rounds
                      - unchangedRounds
                      - headSha
                      - remainingFingerprint
                      - operationId
                      - workflowId
                      - reason
                      - updatedAt
                    additionalProperties: false
                required:
                  - available
                  - watch
        '400':
          description: Bad request
          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
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '401':
          description: Unauthorized
          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
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '403':
          description: Forbidden
          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
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '404':
          description: Not found
          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
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '409':
          description: Conflict
          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
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '412':
          description: Precondition failed
          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
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '413':
          description: Content too large
          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
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '429':
          description: Too many requests
          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
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '500':
          description: Internal server error
          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
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '503':
          description: Service unavailable
          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
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-coderabbitai-api-key
      description: >-
        See [Authentication](/api/authentication) for the key types and where to
        create a key.

````

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