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

# 列出代码扫描发现项

> 列出企业级代码扫描发现项

<div id="permissions">
  ## 权限
</div>

需要一个在企业级别具有 `ViewAccountCodeScans` 权限的服务用户。


## OpenAPI

````yaml zh/v3-openapi.yaml GET /v3/enterprise/code-scans/findings
openapi: 3.1.0
info:
  description: 采用 Service User 身份验证和 RBAC 的 Devin v3 API
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/enterprise/code-scans/findings:
    get:
      tags:
        - code-scans
      summary: 列出代码扫描发现项
      description: >-
        列出 Enterprise 账户的代码扫描发现项。


        返回的发现项按时间从新到旧排序。可按 ``org_ids``、

        ``scan_id``、``repo_name``、``severity`` 和 ``status`` 进行可选筛选（``severity``
        和

        ``status`` 支持多个值）；结果使用不透明游标

        （``after`` / ``first``）分页。
      operationId: handle_list_code_scan_findings_v3_enterprise_code_scans_findings_get
      parameters:
        - 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: scan_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 筛选出由此次扫描产生的发现项。
            title: Scan Id
        - description: 筛选出在此代码仓库中报告的发现项。
          in: query
          name: repo_name
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 筛选出在此代码仓库中报告的发现项。
            title: Repo Name
        - description: 筛选出严重级别为以下任一项的发现项（critical、high、medium、low）。
          in: query
          name: severity
          required: false
          schema:
            anyOf:
              - items:
                  enum:
                    - critical
                    - high
                    - medium
                    - low
                  type: string
                type: array
              - type: 'null'
            description: 筛选出严重级别为以下任一项的发现项（critical、high、medium、low）。
            title: Severity
        - description: 筛选出状态为以下任一项的发现项（open、dismissed、resolved）。
          in: query
          name: status
          required: false
          schema:
            anyOf:
              - items:
                  enum:
                    - open
                    - dismissed
                    - resolved
                  type: string
                type: array
              - type: 'null'
            description: 筛选出状态为以下任一项的发现项（open、dismissed、resolved）。
            title: Status
        - description: 筛选出这些组织中的发现项。
          in: query
          name: org_ids
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: 筛选出这些组织中的发现项。
            title: Org Ids
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaginatedResponse_CodeScanFindingResponse_
          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: 冲突
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 无法处理的内容
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 请求过多
components:
  schemas:
    PaginatedResponse_CodeScanFindingResponse_:
      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/CodeScanFindingResponse'
          title: Items
          type: array
        total:
          anyOf:
            - type: integer
            - type: 'null'
          description: 可选的总数（出于性能考虑可省略）。
          title: Total
      required:
        - items
      title: PaginatedResponse[CodeScanFindingResponse]
      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
        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
    CodeScanFindingResponse:
      description: 单个代码扫描发现项。
      properties:
        category:
          anyOf:
            - type: string
            - type: 'null'
          description: 发现项所属的分类（规则名称），如有。
          title: Category
        code_owners:
          description: 与受影响代码关联的代码所有者。
          items:
            type: string
          title: Code Owners
          type: array
        created_at:
          description: 发现项的创建时间（Unix 时间戳，单位为秒）。
          title: Created At
          type: integer
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: 漏洞的详细描述，如有。
          title: Description
        finding_id:
          description: 发现项的唯一标识符。
          title: Finding Id
          type: string
        note:
          anyOf:
            - type: string
            - type: 'null'
          description: 附加到发现项的备注，如有。
          title: Note
        orchestrator_session_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 运行生成该发现项的扫描的 Orchestrator 会话（即该扫描对应的 Devin 会话），如有。
          title: Orchestrator Session Id
        pr_url:
          anyOf:
            - type: string
            - type: 'null'
          description: 为此发现项创建的修复 PR 的 URL，如有。
          title: Pr Url
        recommendation:
          anyOf:
            - type: string
            - type: 'null'
          description: 针对该发现项的修复建议，如有。
          title: Recommendation
        reference_snippets:
          description: 发现项引用的、作为佐证的代码片段。
          items:
            $ref: '#/components/schemas/CodeScanReferenceSnippetResponse'
          title: Reference Snippets
          type: array
        related_finding_ids:
          description: 已实现攻击链中其他环节的发现项 ID。仅在该链的汇点发现项上设置。
          items:
            type: string
          title: Related Finding Ids
          type: array
        repo_name:
          description: 报告该发现项所在的代码仓库。
          title: Repo Name
          type: string
        scan_id:
          description: 生成该发现项的扫描标识符。
          title: Scan Id
          type: string
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 修复该发现项的会话（并创建了 PR），如有。
          title: Session Id
        severity:
          description: 发现项的严重程度：critical、high、medium 或 low。
          enum:
            - critical
            - high
            - medium
            - low
          title: Severity
          type: string
        status:
          description: 发现项状态：open、已忽略或解析。
          enum:
            - open
            - dismissed
            - resolved
          title: Status
          type: string
        title:
          anyOf:
            - type: string
            - type: 'null'
          description: 发现项的标题，如有。
          title: Title
      required:
        - finding_id
        - title
        - description
        - recommendation
        - note
        - code_owners
        - reference_snippets
        - severity
        - category
        - repo_name
        - pr_url
        - scan_id
        - session_id
        - orchestrator_session_id
        - status
        - created_at
      title: CodeScanFindingResponse
      type: object
    CodeScanReferenceSnippetResponse:
      description: 被某个发现项引用作为佐证的代码片段。
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          description: 引用的源代码（如果已采集）。
          title: Code
        commentary:
          description: 说明此代码片段为何与该发现项相关。
          title: Commentary
          type: string
        end_line:
          description: 引用范围的最后一行。
          title: End Line
          type: integer
        file_path:
          description: 引用文件的路径。
          title: File Path
          type: string
        start_line:
          description: 引用范围的第一行。
          title: Start Line
          type: integer
      required:
        - file_path
        - start_line
        - end_line
        - commentary
      title: CodeScanReferenceSnippetResponse
      type: object
  securitySchemes:
    bearerAuth:
      description: 服务用户凭据（前缀：cog_）
      scheme: bearer
      type: http

````