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

# 列出 Devin Review 触发器作用域

> 列出 API 密钥可附加 Devin Review auto-review 触发器的账户、命名空间和代码仓库作用域。

列出调用方可附加 [Devin Review auto-review](https://docs.devin.ai/zh/work-with-devin/devin-review.md#auto-review) 触发器的账户、命名空间和代码仓库作用域。[创建触发器](https://docs.devin.ai/zh/api-reference/v3/review-triggers/update-review-triggers.md)时，请将代码仓库作用域的 `target` 用作 `repository` 的值。

## 权限

需要使用在该组织中拥有 `ManageReview` 权限的[服务用户](https://docs.devin.ai/zh/api-reference/v3/service-users/members-service-users.md)或[个人访问令牌](https://docs.devin.ai/zh/api-reference/personal-access-tokens.md)。个人访问令牌以其所属用户的身份执行操作。账户级 `ManageReview` 权限允许调用方管理所有作用域；组织级 `ManageReview` 权限仅涵盖该组织可访问的仓库。

## 行为

* 命名空间作用域 (`git_organization`) 表示其下的所有代码仓库均符合条件。
* `search` 按目标的子字符串 (不区分大小写) 筛选作用域。
* 当调用方可以向该作用域附加触发器时，`status` 为 `available`；若为其他值，则表示无法附加的原因，`next_action` 会说明如何修复。
* 如果该组织未启用 Review 触发器，则返回 `404`。


## OpenAPI

````yaml zh/v3-openapi.yaml GET /v3beta1/organizations/{org_id}/review-settings/trigger-scopes
openapi: 3.1.0
info:
  description: 采用 Service User 身份验证和 RBAC 的 Devin v3 API
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3beta1/organizations/{org_id}/review-settings/trigger-scopes:
    get:
      tags:
        - review-settings
      summary: 列出调用方可附加审查触发器的作用域
      description: |-
        调用方有权设置触发器的账户、命名空间和代码仓库
        作用域。命名空间作用域涵盖该命名空间下的所有代码仓库。
        API 不支持代码仓库前缀作用域。
      operationId: >-
        handle_list_review_trigger_scopes_v3beta1_organizations__org_id__review_settings_trigger_scopes_get
      parameters:
        - description: 组织 ID（前缀：org-）
          in: path
          name: org_id
          required: true
          schema:
            example: org-abc123def456
            title: Org Id
            type: string
        - in: query
          name: after
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: After
        - in: query
          name: first
          required: false
          schema:
            default: 100
            maximum: 200
            minimum: 1
            title: First
            type: integer
        - description: 子字符串过滤器。
          in: query
          name: search
          required: false
          schema:
            anyOf:
              - maxLength: 512
                type: string
              - type: 'null'
            description: 子字符串过滤器。
            title: Search
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaginatedResponse_ReviewScopeCapabilityResponse_
          description: 成功响应
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 未授权
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 禁止访问
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 未找到
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 冲突
        '410':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 已移除
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 无法处理的内容
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 请求过多
components:
  schemas:
    PaginatedResponse_ReviewScopeCapabilityResponse_:
      properties:
        end_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: 用于获取下一页的游标；如果当前页是最后一页，则为 None。
          title: End Cursor
        has_next_page:
          default: false
          description: 当前页之后是否还有更多条目。
          title: Has Next Page
          type: boolean
        items:
          items:
            $ref: '#/components/schemas/ReviewScopeCapabilityResponse'
          title: Items
          type: array
        total:
          anyOf:
            - type: integer
            - type: 'null'
          description: 可选的总数（出于性能考虑可省略）。
          title: Total
      required:
        - items
      title: PaginatedResponse[ReviewScopeCapabilityResponse]
      type: object
    ProblemDetail:
      description: >-
        v3 API 的 RFC 9457 application/problem+json 错误响应体。


        detail 沿用自旧版 {"detail": ...} 响应体，以保持向后兼容；其他成员字段为新增字段。errors
        包含字段级验证失败信息（仅 422）。
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: 针对此次具体情况的、便于人理解的说明。
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          description: 因操作被阻止而拒绝请求时返回的机器可读代码（例如 "user_frozen"、"migrated_session"）。
          title: Error Code
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: 字段级验证错误（仅适用于 422 响应）。
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          description: 此次出现对应的 URI 引用（请求路径）。
          title: Instance
        status:
          description: HTTP 状态码。
          title: Status
          type: integer
        title:
          description: 对问题类型的简短、便于理解的概述。
          title: Title
          type: string
        type:
          default: about:blank
          description: 用于标识问题类型的 URI 引用。
          title: Type
          type: string
      required:
        - title
        - status
      title: ProblemDetail
      type: object
    ReviewScopeCapabilityResponse:
      properties:
        next_action:
          enum:
            - none
            - relink
            - use_github_app
            - grant_app_access
            - request_scope_access
          title: Next Action
          type: string
        scope:
          $ref: '#/components/schemas/ReviewScopeResponse'
        status:
          description: 调用方可以向该作用域附加触发器时为 'available'；否则为无法附加的原因。
          enum:
            - available
            - readonly
            - inaccessible
            - github_pat_unsupported
            - relink_required
            - unsupported
            - broader_grant_required
          title: Status
          type: string
      required:
        - scope
        - status
        - next_action
      title: ReviewScopeCapabilityResponse
      type: object
    ReviewScopeResponse:
      properties:
        kind:
          enum:
            - account
            - user
            - git_organization
            - git_repository
          title: Kind
          type: string
        target:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            git_repository：代码仓库名称，在 github.com 上为 'owner/repo'，在其他主机上为
            'host/path'（'gitlab.example.com/group/sub/repo'），每个路径段均采用百分号编码。git_organization：格式相同的命名空间，以
            '/' 结尾。账户和用户作用域下为 Null。
          title: Target
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
      required:
        - kind
        - target
      title: ReviewScopeResponse
      type: object
  securitySchemes:
    bearerAuth:
      description: 服务用户凭据（前缀：cog_）
      scheme: bearer
      type: http

````

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