> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devinenterprise.com/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: org_ids
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: 筛选这些组织中的发现项。
            title: Org Ids
        - 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、已忽略、解析）。
          in: query
          name: status
          required: false
          schema:
            anyOf:
              - items:
                  enum:
                    - open
                    - dismissed
                    - resolved
                  type: string
                type: array
              - type: 'null'
            description: 筛选状态为以下任一值的发现项（open、已忽略、解析）。
            title: Status
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaginatedResponse_CodeScanFindingResponse_
          description: 成功响应
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          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
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      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
        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
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      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

````