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

# 获取代码扫描 Profile（Devin API）

> 通过 v3 组织 API 获取单个 Devin 代码扫描 Profile，包括其模式、扫描类型、包含/排除 glob 模式和指导

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

需要具有组织级 `ViewCodeScans` 权限的[服务用户](/zh/api-reference/v3/service-users/members-service-users)或[个人访问令牌](/zh/api-reference/personal-access-tokens)。

<div id="behavior">
  ## 行为
</div>

返回 Profile 的元数据、可见性 (归组织所有或在账户级别共享) 、包含/排除 glob 模式，以及所有指导字段 (调查、沟通和导入源指导) 。可通过[列出代码扫描 Profile](/zh/api-reference/v3/code-scans/organizations-code-scans-profiles)查找 Profile ID。

当 Profile 不存在或对该组织不可见时，返回 `404`。


## OpenAPI

````yaml zh/v3-openapi.yaml GET /v3/organizations/{org_id}/code-scans/profiles/{profile_id}
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/organizations/{org_id}/code-scans/profiles/{profile_id}:
    get:
      tags:
        - code-scans
      summary: 获取代码扫描 Profile
      description: >-
        按 ID 获取代码扫描 Profile。


        返回该 Profile 的元数据、可见性（组织自有或账户级共享）以及所有指导字段。如果该 Profile 不存在，或该组织无权查看，则返回
        ``404``。
      operationId: >-
        handle_get_code_scan_profile_v3_organizations__org_id__code_scans_profiles__profile_id__get
      parameters:
        - in: path
          name: profile_id
          required: true
          schema:
            title: Profile Id
            type: string
        - description: Organization ID（前缀：org-）
          in: path
          name: org_id
          required: true
          schema:
            example: org-abc123def456
            title: Org Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodeScanProfileDetailResponse'
          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:
    CodeScanProfileDetailResponse:
      description: 代码扫描 Profile 的完整详细信息，包括其指导内容。
      properties:
        communication_guidance:
          anyOf:
            - type: string
            - type: 'null'
          description: 通信阶段的指引（对最终发现项采取行动，例如通知负责人或利益相关者），如有。
          title: Communication Guidance
        created_at:
          description: Profile 的创建时间（Unix 秒）。
          title: Created At
          type: integer
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Profile 的描述（如有）。
          title: Description
        exclude_globs:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 要从扫描中排除的文件 Glob 模式（如有）。
          title: Exclude Globs
        include_globs:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 要包含在扫描中的文件 Glob 模式（如有）。
          title: Include Globs
        ingestion_source_guidance:
          anyOf:
            - type: string
            - type: 'null'
          description: 描述摄取来源的指导内容（如有）。
          title: Ingestion Source Guidance
        investigation_guidance:
          anyOf:
            - type: string
            - type: 'null'
          description: 调查阶段的指导内容（如有）。
          title: Investigation Guidance
        mode:
          description: Profile 模式：discover 或 ingest。
          enum:
            - discover
            - ingest
          title: Mode
          type: string
        name:
          description: Profile 名称。
          title: Name
          type: string
        org_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 拥有该 Profile 的组织。若该 Profile 为账户级共享，则为 null。
          title: Org Id
        post_ingestion_guidance:
          anyOf:
            - type: string
            - type: 'null'
          description: 摄取后阶段的指导内容（如有）。
          title: Post Ingestion Guidance
        profile_id:
          description: Profile 的唯一标识符。
          title: Profile Id
          type: string
        remediation_guidance:
          anyOf:
            - type: string
            - type: 'null'
          description: 修复阶段的指导内容（如有）。
          title: Remediation Guidance
        report_guidance:
          anyOf:
            - type: string
            - type: 'null'
          description: 报告阶段的指导内容（如有）。
          title: Report Guidance
        scan_type:
          description: 该 Profile 配置的扫描类型。
          enum:
            - security
            - performance
            - db-queries
            - test-coverage
            - dead-code
            - code-quality
            - telemetry
            - accessibility
            - general
            - migration-docs
          title: Scan Type
          type: string
        threat_model_guidance:
          anyOf:
            - type: string
            - type: 'null'
          description: 关于威胁模型的指导说明（如有）。
          title: Threat Model Guidance
        triage_guidance:
          anyOf:
            - type: string
            - type: 'null'
          description: 分流阶段的指导说明（如有）。
          title: Triage Guidance
        validation_guidance:
          anyOf:
            - type: string
            - type: 'null'
          description: 验证阶段的指导说明（如有）。
          title: Validation Guidance
        visibility:
          description: 该 Profile 是由单个组织拥有，还是在整个账户范围内共享。
          enum:
            - org
            - account
          title: Visibility
          type: string
      required:
        - profile_id
        - name
        - description
        - visibility
        - org_id
        - scan_type
        - mode
        - include_globs
        - exclude_globs
        - threat_model_guidance
        - investigation_guidance
        - triage_guidance
        - validation_guidance
        - report_guidance
        - remediation_guidance
        - ingestion_source_guidance
        - post_ingestion_guidance
        - created_at
      title: CodeScanProfileDetailResponse
      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
  securitySchemes:
    bearerAuth:
      description: 服务用户凭据（前缀：cog_）
      scheme: bearer
      type: http

````