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

# 归档 Deployment

> 归档指定 Deployment 并停止后续定时触发。归档是终态且操作幂等，重复归档不会刷新 `archived_at`；归档后不能更新、暂停、恢复或手动运行。Deployment 没有删除接口。点击 **Try it** 按钮可快速试用。



## OpenAPI

````yaml /openapi/openapi-managed-agents.json post /agent/managed/v1/deployments/{deploymentId}/archive
openapi: 3.0.1
info:
  title: 智谱 AI Managed Agents API
  version: 1.0.0
  description: Agent、Environment、Session、File、Memory、Vault、Skill、Deployment 接口。
  contact:
    name: Z.AI 开发者
    url: https://chat.z.ai/legal-agreement/privacy-policy
    email: user_feedback@z.ai
servers:
  - url: https://open.bigmodel.cn/api/
    description: 开放平台服务
security:
  - bearerAuth: []
tags:
  - name: Managed Agents - Agent
    description: Agent 与版本管理。
    x-group: Agent
  - name: Managed Agents - Environment
    description: 声明式执行环境管理。
    x-group: Environment
  - name: Managed Agents - Session
    description: Session、Resource 与事件流。
    x-group: Session
  - name: Managed Agents - File
    description: Managed Files 上传、读取与删除。
    x-group: File
  - name: Managed Agents - Memory
    description: Memory Store、Memory 与版本管理。
    x-group: Memory
  - name: Managed Agents - Vault
    description: Vault 与 Credential 管理。
    x-group: Vault
  - name: Managed Agents - Skill
    description: 自定义 Skill 与版本管理。
    x-group: Skill
  - name: Managed Agents - Deployment
    description: 定时或手动 Deployment 与运行记录。
    x-group: Deployment
paths:
  /agent/managed/v1/deployments/{deploymentId}/archive:
    servers:
      - url: https://agent-api.bigmodel.cn/api
        description: 智谱 Managed Agents 服务
    post:
      tags:
        - Managed Agents - Deployment
      summary: 归档 Deployment
      description: >-
        归档指定 Deployment 并停止后续定时触发。归档是终态且操作幂等，重复归档不会刷新
        `archived_at`；归档后不能更新、暂停、恢复或手动运行。Deployment 没有删除接口。点击 **Try it**
        按钮可快速试用。
      operationId: managedPostDeploymentsByDeploymentIdArchive
      parameters:
        - $ref: '#/components/parameters/ManagedZaiVersion'
        - $ref: '#/components/parameters/ManagedZaiBeta'
        - name: deploymentId
          in: path
          required: true
          description: deploymentId 资源标识。
          schema:
            type: string
      responses:
        '200':
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedDeployment'
        default:
          description: 请求失败。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsErrorResponse'
components:
  parameters:
    ManagedZaiVersion:
      name: zai-version
      in: header
      required: true
      description: Managed Agents API 协议版本，固定为 2026-05-26。
      schema:
        type: string
        enum:
          - '2026-05-26'
        default: '2026-05-26'
        example: '2026-05-26'
    ManagedZaiBeta:
      name: zai-beta
      in: header
      required: true
      description: 必须包含 managed-agents-2026-05-26；可与其他 beta 标识用逗号分隔。
      schema:
        type: string
        default: managed-agents-2026-05-26
        example: managed-agents-2026-05-26
  schemas:
    ManagedDeployment:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - deployment
        name:
          type: string
        agent:
          $ref: '#/components/schemas/ManagedDeploymentAgent'
        environment_id:
          type: string
          description: Deployment 绑定的 Environment ID。旧数据缺失该字段时可能返回内部兼容值 `env_default`。
        description:
          type: string
          nullable: true
          description: 用途说明。
        metadata:
          $ref: '#/components/schemas/ManagedMetadata'
        resources:
          type: array
          items:
            $ref: '#/components/schemas/ManagedDeploymentResourceInput'
        schedule:
          allOf:
            - $ref: '#/components/schemas/ManagedScheduleResponse'
          nullable: true
        initial_events:
          type: array
          items:
            $ref: '#/components/schemas/ManagedDeploymentInitialEvent'
        status:
          type: string
          enum:
            - active
            - paused
        paused_reason:
          allOf:
            - $ref: '#/components/schemas/ManagedDeploymentPausedReason'
          nullable: true
          description: 暂停原因。手动暂停返回 `manual`；因资源失效自动暂停时返回对应错误类型。
        vault_ids:
          type: array
          items:
            type: string
        archived_at:
          type: string
          nullable: true
          description: 归档时间。
        created_at:
          type: string
          format: date-time
          description: 创建时间。
        updated_at:
          type: string
          format: date-time
          description: 更新时间。
      required:
        - id
        - type
        - name
        - agent
        - environment_id
        - description
        - metadata
        - resources
        - schedule
        - initial_events
        - status
        - paused_reason
        - vault_ids
        - archived_at
        - created_at
        - updated_at
      additionalProperties: false
    ManagedAgentsErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - error
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - not_found_error
                - request_too_large
                - rate_limit_error
                - api_error
                - timeout_error
                - overloaded_error
            message:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - type
            - message
          additionalProperties: false
        request_id:
          type: string
          example: req_01J...
      required:
        - type
        - error
        - request_id
      additionalProperties: false
    ManagedDeploymentAgent:
      type: object
      properties:
        type:
          type: string
          enum:
            - agent
        id:
          type: string
        version:
          type: integer
          minimum: 0
      required:
        - type
        - id
        - version
      additionalProperties: false
    ManagedMetadata:
      type: object
      additionalProperties:
        type: string
      description: 客户端自定义元数据；省略时默认为空对象。最多 16 个键，键名长度不超过 64 字符，值必须是长度不超过 512 字符的字符串。
      maxProperties: 16
    ManagedDeploymentResourceInput:
      oneOf:
        - title: memory_store
          allOf:
            - $ref: '#/components/schemas/ManagedDeploymentMemoryStoreResourceInput'
        - title: file
          allOf:
            - $ref: '#/components/schemas/ManagedFileResourceInput'
    ManagedScheduleResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - cron
        expression:
          type: string
        timezone:
          type: string
          enum:
            - Asia/Shanghai
        last_run_at:
          type: string
          nullable: true
          description: 上次运行时间。
        upcoming_runs_at:
          type: array
          items:
            type: string
            format: date-time
      required:
        - type
        - expression
        - timezone
        - last_run_at
        - upcoming_runs_at
      additionalProperties: false
    ManagedDeploymentInitialEvent:
      allOf:
        - $ref: '#/components/schemas/ManagedInitialUserMessageEventInput'
      description: >-
        Deployment 每次运行时注入的初始用户消息。仅支持 `user.message`，内容块仅支持文本和 base64 图片，不支持
        document。
    ManagedDeploymentPausedReason:
      oneOf:
        - title: manual
          type: object
          properties:
            type:
              type: string
              enum:
                - manual
          required:
            - type
          additionalProperties: false
        - title: error
          type: object
          properties:
            type:
              type: string
              enum:
                - error
            error:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - environment_archived_error
                    - environment_not_found_error
                    - file_not_found_error
                    - memory_store_archived_error
                    - vault_archived_error
                    - vault_not_found_error
              required:
                - type
              additionalProperties: false
          required:
            - type
            - error
          additionalProperties: false
    ManagedDeploymentMemoryStoreResourceInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - memory_store
          description: 固定为 memory_store。
        memory_store_id:
          type: string
          minLength: 1
          description: Agent 所有者名下处于 active 状态的 Memory Store ID。
        access:
          type: string
          enum:
            - read_only
            - read_write
          default: read_write
          description: 挂载权限；省略时由 Memory 服务按 read_write 处理。
        instructions:
          type: string
          description: 提供给 Agent 的使用说明；省略时不设置。
      required:
        - type
        - memory_store_id
    ManagedFileResourceInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - file
          description: 固定为 file。
        file_id:
          type: string
          minLength: 1
          description: 已存在且归当前资源所有者所有的 File ID。
        mount_path:
          type: string
          nullable: true
          description: >-
            沙箱内挂载路径；省略或传 null 时默认为 /mnt/session/uploads/{file_id}。路径会归一化到
            /mnt/session/uploads 下，不能逃逸该目录，UTF-8 总长度不超过 1024 字节。
      required:
        - type
        - file_id
      additionalProperties: false
    ManagedInitialUserMessageEventInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - user.message
          description: 固定为 user.message。
        content:
          type: array
          minItems: 1
          maxItems: 20
          description: 初始消息内容，1–20 个 block；只允许文本或 base64 图片，不允许 document。
          items:
            $ref: '#/components/schemas/ManagedInitialContentBlock'
      required:
        - type
        - content
    ManagedInitialContentBlock:
      oneOf:
        - title: text
          allOf:
            - $ref: '#/components/schemas/ManagedTextBlock'
        - title: image
          allOf:
            - $ref: '#/components/schemas/ManagedImageBlock'
    ManagedTextBlock:
      type: object
      properties:
        type:
          type: string
          enum:
            - text
          description: 固定为 text。
        text:
          type: string
          minLength: 1
          description: 非空文本内容。
      required:
        - type
        - text
    ManagedImageBlock:
      type: object
      properties:
        type:
          type: string
          enum:
            - image
          description: 固定为 image。
        source:
          allOf:
            - $ref: '#/components/schemas/ManagedImageSource'
          description: base64 图片来源。
      required:
        - type
        - source
      additionalProperties: false
    ManagedImageSource:
      type: object
      properties:
        type:
          type: string
          enum:
            - base64
          description: 当前只接受 base64。
        media_type:
          type: string
          enum:
            - image/jpeg
            - image/png
            - image/gif
            - image/webp
          description: 图片 MIME 类型。
        data:
          type: string
          description: Base64 字符串；默认每张图片解码后不超过 5 MiB。
      required:
        - type
        - media_type
        - data
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        标准的 HTTP Bearer 认证方式，在 [API
        Keys](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) 页面获取密钥。

````