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

# 更新收件箱

> 更新 AgentMail 收件箱的显示或配置字段。



## OpenAPI

````yaml openapi/zh/agentmail.json PATCH /agentmail/inboxes/{inbox_id}
openapi: 3.1.0
info:
  title: AgentMail API
  version: 1.0.0
  description: 通过 AIsa 统一网关公开的 AgentMail 电子邮件 API 端点。改编自上游 docs.agentmail.to OpenAPI 规范。
servers:
  - url: https://api.aisa.one/apis/v1
security:
  - Bearer: []
paths:
  /agentmail/inboxes/{inbox_id}:
    patch:
      tags:
        - subpackage_inboxes
      summary: 更新收件箱
      description: >-
        **CLI：**

        ```bash

        agentmail inboxes update --inbox-id <inbox_id> --display-name "Updated
        Name"

        ```
      operationId: patch_agentmail_inboxes_inbox_id
      parameters:
        - name: inbox_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/type_inboxes_InboxId'
        - name: Authorization
          in: header
          description: Bearer 身份验证
          required: true
          schema:
            type: string
      requestBody:
        description: 应为对象；请至少提供 `display_name` 或 `metadata` 之一。
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/type_inboxes_UpdateInboxRequest'
      responses:
        '200':
          description: 状态码为 200 的响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_inboxes_Inbox'
        '400':
          description: 状态码为 400 的错误响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type__ValidationErrorResponse'
        '404':
          description: 状态码为 404 的错误响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type__ErrorResponse'
components:
  schemas:
    type_inboxes_InboxId:
      type: string
      description: 收件箱的 ID。
      title: InboxId
    type_inboxes_UpdateInboxRequest:
      type: object
      properties:
        display_name:
          $ref: '#/components/schemas/type_inboxes_DisplayName'
        metadata:
          oneOf:
            - $ref: '#/components/schemas/type_inboxes_UpdateMetadata'
            - type: 'null'
          description: |-
            要合并到收件箱现有元数据中的元数据。你包含的键
            将被添加或覆盖；省略的键保持不变。要移除
            单个键，请为其发送 null 值。要清除所有元数据，请将
            `metadata` 设为 null。发送空对象将被拒绝；请使用 null
            进行清除。每次更新必须至少包含 `display_name` 或
            `metadata` 之一。
      title: UpdateInboxRequest
    type_inboxes_Inbox:
      type: object
      properties:
        pod_id:
          $ref: '#/components/schemas/type_pods_PodId'
        inbox_id:
          $ref: '#/components/schemas/type_inboxes_InboxId'
        email:
          $ref: '#/components/schemas/type_inboxes_Email'
        display_name:
          $ref: '#/components/schemas/type_inboxes_DisplayName'
        client_id:
          $ref: '#/components/schemas/type_inboxes_ClientId'
        metadata:
          $ref: '#/components/schemas/type_inboxes_Metadata'
          description: 附加到收件箱的自定义元数据。
        updated_at:
          type: string
          format: date-time
          description: 收件箱上次更新的时间。
        created_at:
          type: string
          format: date-time
          description: 收件箱的创建时间。
      required:
        - pod_id
        - inbox_id
        - email
        - updated_at
        - created_at
      title: Inbox
    type__ValidationErrorResponse:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/type__ErrorName'
        errors:
          description: 验证错误。
      required:
        - name
        - errors
      title: ValidationErrorResponse
    type__ErrorResponse:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/type__ErrorName'
        message:
          $ref: '#/components/schemas/type__ErrorMessage'
      required:
        - name
        - message
      title: ErrorResponse
    type_inboxes_DisplayName:
      type: string
      description: 显示名称：`Display Name <username@domain.com>`。
      title: DisplayName
    type_inboxes_UpdateMetadata:
      type: object
      additionalProperties:
        oneOf:
          - $ref: '#/components/schemas/type_inboxes_MetadataValue'
          - type: 'null'
      description: |-
        要合并到收件箱现有 metadata 中的自定义键值对。
        值可以是字符串、数字、布尔值或 null。将键设置为 null
        会将其删除。最多支持 256 个键；每个键和字符串值均限制为
        256 个字符。
      title: UpdateMetadata
    type_pods_PodId:
      type: string
      description: Pod ID。
      title: PodId
    type_inboxes_Email:
      type: string
      description: 收件箱的电子邮件地址。
      title: Email
    type_inboxes_ClientId:
      type: string
      description: 收件箱的客户端 ID。
      title: ClientId
    type_inboxes_Metadata:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/type_inboxes_MetadataValue'
      description: |-
        附加到收件箱的自定义键值对。最多 256 个键。键和
        字符串值均限制为 256 个字符。更新 metadata 时，
        发送值为 null 的键即可删除该键。
      title: Metadata
    type__ErrorName:
      type: string
      description: 错误名称。
      title: ErrorName
    type__ErrorMessage:
      type: string
      description: 错误消息。
      title: ErrorMessage
    type_inboxes_MetadataValue:
      oneOf:
        - type: string
        - type: number
          format: double
        - type: boolean
      description: 元数据值。可以是字符串、数字或布尔值。
      title: MetadataValue
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````