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

# 删除线程

> 通过为所有消息添加回收站标签，将会话移至回收站。如果会话已在回收站中，则会被永久删除；使用 permanent=true 可强制永久删除。



## OpenAPI

````yaml openapi/zh/agentmail.json DELETE /agentmail/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/threads/{thread_id}:
    delete:
      tags:
        - subpackage_threads
      summary: 删除线程
      description: |-
        通过为所有消息添加垃圾箱标签，将会话移至垃圾箱。如果会话已在垃圾箱中，则会被永久删除。使用 `permanent=true` 可强制永久删除。

        **CLI：**
        ```bash
        agentmail threads delete --thread-id <thread_id>
        ```
      operationId: delete_agentmail_threads_thread_id
      parameters:
        - name: thread_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/type_threads_ThreadId'
        - name: permanent
          in: query
          description: 如果为 true，则永久删除该会话，而不是将其移至回收站。
          required: false
          schema:
            type: boolean
        - name: Authorization
          in: header
          description: Bearer 身份验证
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 成功响应
        '404':
          description: 状态码为 404 的错误响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type__ErrorResponse'
components:
  schemas:
    type_threads_ThreadId:
      type: string
      description: 会话 ID。
      title: ThreadId
    type__ErrorResponse:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/type__ErrorName'
        message:
          $ref: '#/components/schemas/type__ErrorMessage'
      required:
        - name
        - message
      title: ErrorResponse
    type__ErrorName:
      type: string
      description: 错误名称。
      title: ErrorName
    type__ErrorMessage:
      type: string
      description: 错误消息。
      title: ErrorMessage
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````