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

# 更新企业安全 Profile 设置

> 更新企业的默认安全 Profile 选择设置。未提供的字段保持不变。
只能锁定归企业所有的 Profile。

更新企业默认值所选用的安全 Profile，并返回更新后的设置。

## 权限

需要具有企业级 `ManageAccountSecureModeProfiles` 权限的[服务用户](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)。仅适用于企业账户。

## 行为

* 省略的字段保持不变。不接受 `null`；如需清除默认值，请发送 `{"default": {"selection": "none"}}`。
* 当 `selection` 为 `profile` 时，`profile_id` 为必填项；其他情况下必须省略该字段。只有企业所属的 Profile 才能被锁定。
* 强制的企业默认值是一条底线：组织、自动化和会话只能在此基础上进一步收紧限制。请参阅[强制与推荐两种强制执行方式](https://docs.devin.ai/zh/product-guides/security-profiles.md#mandatory-vs-recommended-enforcement)。
* 正在运行的会话将在下次启动或唤醒时应用此变更。


## OpenAPI

````yaml zh/v3-openapi.yaml PATCH /v3beta1/enterprise/security-profile-settings
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/enterprise/security-profile-settings:
    patch:
      tags:
        - security-profiles
      summary: 更新企业安全 Profile 设置
      description: |-
        更新企业的默认安全 Profile 选择设置。未提供的字段保持不变。
        只能锁定归企业所有的 Profile。
      operationId: >-
        handle_update_security_profile_settings_v3beta1_enterprise_security_profile_settings_patch
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/EnterpriseSecurityProfileSettingsUpdateRequest
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnterpriseSecurityProfileSettingsResponse'
          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:
    EnterpriseSecurityProfileSettingsUpdateRequest:
      additionalProperties: false
      description: PATCH 语义：省略的字段保持不变。
      properties:
        default:
          anyOf:
            - $ref: '#/components/schemas/EnterpriseSecurityProfileDefaultSelection'
            - type: 'null'
      title: EnterpriseSecurityProfileSettingsUpdateRequest
      type: object
    EnterpriseSecurityProfileSettingsResponse:
      additionalProperties: false
      properties:
        default:
          $ref: '#/components/schemas/EnterpriseSecurityProfileDefaultState'
      required:
        - default
      title: EnterpriseSecurityProfileSettingsResponse
      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
    EnterpriseSecurityProfileDefaultSelection:
      additionalProperties: false
      description: |-
        默认值有两种状态：none（无默认 Profile）或 profile（锁定
        profile_id）。企业级别不支持 ``inherit``——企业之上没有
        可供继承的层级。
      properties:
        profile_id:
          anyOf:
            - type: string
            - type: 'null'
          description: selection 为 'profile' 时必填；否则必须省略。
          title: Profile Id
        selection:
          enum:
            - none
            - profile
          title: Selection
          type: string
      required:
        - selection
      title: EnterpriseSecurityProfileDefaultSelection
      type: object
    EnterpriseSecurityProfileDefaultState:
      additionalProperties: false
      description: 企业默认值绑定的只读视图。
      properties:
        profile_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Profile Id
        selection:
          enum:
            - none
            - profile
          title: Selection
          type: string
      required:
        - selection
      title: EnterpriseSecurityProfileDefaultState
      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.