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

# 更新话题串

> 更新会话标签



## OpenAPI

````yaml openapi/zh/agentmail.json PATCH /agentmail/inboxes/{inbox_id}/threads/{thread_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}/threads/{thread_id}:
    patch:
      tags:
        - subpackage_inboxes.subpackage_inboxes/threads
      summary: 更新话题串
      description: >-
        更新会话标签。无法添加或移除系统标签（sent、received、bounced 等）。对于包含 100 条或更多消息的会话，请求将被拒绝并返回
        `422`。
      operationId: patch_agentmail_inboxes_inbox_id_threads_thread_id
      parameters:
        - name: inbox_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/type_inboxes_InboxId'
        - name: thread_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/type_threads_ThreadId'
        - name: Authorization
          in: header
          description: Bearer 身份验证
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/type_threads_UpdateThreadRequest'
      responses:
        '200':
          description: 状态码为 200 的响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_threads_UpdateThreadResponse'
        '400':
          description: 状态码为 400 的错误响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type__ValidationErrorResponse'
        '404':
          description: 状态码为 404 的错误响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type__ErrorResponse'
        '422':
          description: 状态码为 422 的错误响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type__ErrorResponse'
components:
  schemas:
    type_inboxes_InboxId:
      type: string
      description: 收件箱的 ID。
      title: InboxId
    type_threads_ThreadId:
      type: string
      description: 会话 ID。
      title: ThreadId
    type_threads_UpdateThreadRequest:
      type: object
      properties:
        add_labels:
          type: array
          items:
            type: string
          description: 要添加到会话串的标签。不能是系统标签。
        remove_labels:
          type: array
          items:
            type: string
          description: 要从会话线程中移除的标签。不能是系统标签。优先级高于 `add_labels`（当传入重复标签时）。
      title: UpdateThreadRequest
    type_threads_UpdateThreadResponse:
      type: object
      properties:
        thread_id:
          $ref: '#/components/schemas/type_threads_ThreadId'
        labels:
          $ref: '#/components/schemas/type_threads_ThreadLabels'
      required:
        - thread_id
        - labels
      title: UpdateThreadResponse
    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_threads_ThreadLabels:
      type: array
      items:
        type: string
      description: 会话标签。
      title: ThreadLabels
    type__ErrorName:
      type: string
      description: 错误名称。
      title: ErrorName
    type__ErrorMessage:
      type: string
      description: 错误消息。
      title: ErrorMessage
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````