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

# 获取线程

> 按 ID 获取帖子串。



## OpenAPI

````yaml openapi/zh/agentmail.json GET /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}:
    get:
      tags:
        - subpackage_threads
      summary: 获取线程
      description: |-
        **CLI：**
        ```bash
        agentmail threads get --thread-id <thread_id>
        ```
      operationId: get_agentmail_threads_thread_id
      parameters:
        - 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
      responses:
        '200':
          description: 状态码为 200 的响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_threads_Thread'
        '404':
          description: 状态码为 404 的错误响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type__ErrorResponse'
components:
  schemas:
    type_threads_ThreadId:
      type: string
      description: 会话 ID。
      title: ThreadId
    type_threads_Thread:
      type: object
      properties:
        inbox_id:
          $ref: '#/components/schemas/type_inboxes_InboxId'
        thread_id:
          $ref: '#/components/schemas/type_threads_ThreadId'
        labels:
          $ref: '#/components/schemas/type_threads_ThreadLabels'
        timestamp:
          $ref: '#/components/schemas/type_threads_ThreadTimestamp'
        received_timestamp:
          $ref: '#/components/schemas/type_threads_ThreadReceivedTimestamp'
        sent_timestamp:
          $ref: '#/components/schemas/type_threads_ThreadSentTimestamp'
        senders:
          $ref: '#/components/schemas/type_threads_ThreadSenders'
        recipients:
          $ref: '#/components/schemas/type_threads_ThreadRecipients'
        subject:
          $ref: '#/components/schemas/type_threads_ThreadSubject'
        preview:
          $ref: '#/components/schemas/type_threads_ThreadPreview'
        attachments:
          $ref: '#/components/schemas/type_threads_ThreadAttachments'
        last_message_id:
          $ref: '#/components/schemas/type_threads_ThreadLastMessageId'
        message_count:
          $ref: '#/components/schemas/type_threads_ThreadMessageCount'
        size:
          $ref: '#/components/schemas/type_threads_ThreadSize'
        updated_at:
          $ref: '#/components/schemas/type_threads_ThreadUpdatedAt'
        created_at:
          $ref: '#/components/schemas/type_threads_ThreadCreatedAt'
        messages:
          type: array
          items:
            $ref: '#/components/schemas/type_messages_Message'
          description: 线程中的消息。按 `timestamp` 升序排列。
      required:
        - inbox_id
        - thread_id
        - labels
        - timestamp
        - senders
        - recipients
        - last_message_id
        - message_count
        - size
        - updated_at
        - created_at
        - messages
      title: Thread
    type__ErrorResponse:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/type__ErrorName'
        message:
          $ref: '#/components/schemas/type__ErrorMessage'
      required:
        - name
        - message
      title: ErrorResponse
    type_inboxes_InboxId:
      type: string
      description: 收件箱的 ID。
      title: InboxId
    type_threads_ThreadLabels:
      type: array
      items:
        type: string
      description: 会话标签。
      title: ThreadLabels
    type_threads_ThreadTimestamp:
      type: string
      format: date-time
      description: 最后发送或接收消息的时间戳。
      title: ThreadTimestamp
    type_threads_ThreadReceivedTimestamp:
      type: string
      format: date-time
      description: 最后收到消息的时间戳。
      title: ThreadReceivedTimestamp
    type_threads_ThreadSentTimestamp:
      type: string
      format: date-time
      description: 最后发送消息的时间戳。
      title: ThreadSentTimestamp
    type_threads_ThreadSenders:
      type: array
      items:
        type: string
      description: >-
        会话中的发件人。格式为 `username@domain.com` 或 `Display Name
        <username@domain.com>`。
      title: ThreadSenders
    type_threads_ThreadRecipients:
      type: array
      items:
        type: string
      description: >-
        会话中的收件人。格式为 `username@domain.com` 或 `Display Name
        <username@domain.com>`。
      title: ThreadRecipients
    type_threads_ThreadSubject:
      type: string
      description: 会话主题。
      title: ThreadSubject
    type_threads_ThreadPreview:
      type: string
      description: 会话中最后一条消息的文本预览。
      title: ThreadPreview
    type_threads_ThreadAttachments:
      type: array
      items:
        $ref: '#/components/schemas/type_attachments_Attachment'
      description: 线程中的附件。
      title: ThreadAttachments
    type_threads_ThreadLastMessageId:
      type: string
      description: 会话串中最后一条消息的 ID。
      title: ThreadLastMessageId
    type_threads_ThreadMessageCount:
      type: integer
      description: 会话中的消息数量。
      title: ThreadMessageCount
    type_threads_ThreadSize:
      type: integer
      description: 线程大小（以字节为单位）。
      title: ThreadSize
    type_threads_ThreadUpdatedAt:
      type: string
      format: date-time
      description: 线程上次更新的时间。
      title: ThreadUpdatedAt
    type_threads_ThreadCreatedAt:
      type: string
      format: date-time
      description: 会话串的创建时间。
      title: ThreadCreatedAt
    type_messages_Message:
      type: object
      properties:
        inbox_id:
          $ref: '#/components/schemas/type_inboxes_InboxId'
        thread_id:
          $ref: '#/components/schemas/type_threads_ThreadId'
        message_id:
          $ref: '#/components/schemas/type_messages_MessageId'
        labels:
          $ref: '#/components/schemas/type_messages_MessageLabels'
        timestamp:
          $ref: '#/components/schemas/type_messages_MessageTimestamp'
        from:
          $ref: '#/components/schemas/type_messages_MessageFrom'
        reply_to:
          type: array
          items:
            type: string
          description: >-
            回复地址。格式为 `username@domain.com` 或 `Display Name
            <username@domain.com>`。
        to:
          $ref: '#/components/schemas/type_messages_MessageTo'
        cc:
          $ref: '#/components/schemas/type_messages_MessageCc'
        bcc:
          $ref: '#/components/schemas/type_messages_MessageBcc'
        subject:
          $ref: '#/components/schemas/type_messages_MessageSubject'
        preview:
          $ref: '#/components/schemas/type_messages_MessagePreview'
        text:
          $ref: '#/components/schemas/type_messages_MessageText'
        html:
          $ref: '#/components/schemas/type_messages_MessageHtml'
        extracted_text:
          type: string
          description: 提取的新文本内容。
        extracted_html:
          type: string
          description: 提取的新 HTML 内容。
        attachments:
          $ref: '#/components/schemas/type_messages_MessageAttachments'
        in_reply_to:
          $ref: '#/components/schemas/type_messages_MessageInReplyTo'
        references:
          $ref: '#/components/schemas/type_messages_MessageReferences'
        headers:
          $ref: '#/components/schemas/type_messages_MessageHeaders'
        size:
          $ref: '#/components/schemas/type_messages_MessageSize'
        updated_at:
          $ref: '#/components/schemas/type_messages_MessageUpdatedAt'
        created_at:
          $ref: '#/components/schemas/type_messages_MessageCreatedAt'
      required:
        - inbox_id
        - thread_id
        - message_id
        - labels
        - timestamp
        - from
        - to
        - size
        - updated_at
        - created_at
      title: Message
    type__ErrorName:
      type: string
      description: 错误名称。
      title: ErrorName
    type__ErrorMessage:
      type: string
      description: 错误消息。
      title: ErrorMessage
    type_attachments_Attachment:
      type: object
      properties:
        attachment_id:
          $ref: '#/components/schemas/type_attachments_AttachmentId'
        filename:
          $ref: '#/components/schemas/type_attachments_AttachmentFilename'
        size:
          $ref: '#/components/schemas/type_attachments_AttachmentSize'
        content_type:
          $ref: '#/components/schemas/type_attachments_AttachmentContentType'
        content_disposition:
          $ref: '#/components/schemas/type_attachments_AttachmentContentDisposition'
        content_id:
          $ref: '#/components/schemas/type_attachments_AttachmentContentId'
      required:
        - attachment_id
        - size
      title: Attachment
    type_messages_MessageId:
      type: string
      description: 消息 ID。
      title: MessageId
    type_messages_MessageLabels:
      type: array
      items:
        type: string
      description: 消息标签。
      title: MessageLabels
    type_messages_MessageTimestamp:
      type: string
      format: date-time
      description: 消息的发送或起草时间。
      title: MessageTimestamp
    type_messages_MessageFrom:
      type: string
      description: 发件人地址。格式为 `username@domain.com` 或 `Display Name <username@domain.com>`。
      title: MessageFrom
    type_messages_MessageTo:
      type: array
      items:
        type: string
      description: 收件人地址。格式为 `username@domain.com` 或 `Display Name <username@domain.com>`。
      title: MessageTo
    type_messages_MessageCc:
      type: array
      items:
        type: string
      description: >-
        抄送收件人的地址。格式为 `username@domain.com` 或 `Display Name
        <username@domain.com>`。
      title: MessageCc
    type_messages_MessageBcc:
      type: array
      items:
        type: string
      description: >-
        BCC 收件人的地址。格式为 `username@domain.com` 或 `Display Name
        <username@domain.com>`。
      title: MessageBcc
    type_messages_MessageSubject:
      type: string
      description: 消息主题。
      title: MessageSubject
    type_messages_MessagePreview:
      type: string
      description: 消息文本预览。
      title: MessagePreview
    type_messages_MessageText:
      type: string
      description: 消息的纯文本正文。
      title: MessageText
    type_messages_MessageHtml:
      type: string
      description: 消息的 HTML 正文。
      title: MessageHtml
    type_messages_MessageAttachments:
      type: array
      items:
        $ref: '#/components/schemas/type_attachments_Attachment'
      description: 消息中的附件。
      title: MessageAttachments
    type_messages_MessageInReplyTo:
      type: string
      description: 被回复消息的 ID。
      title: MessageInReplyTo
    type_messages_MessageReferences:
      type: array
      items:
        type: string
      description: 会话串中先前消息的 ID。
      title: MessageReferences
    type_messages_MessageHeaders:
      type: object
      additionalProperties:
        type: string
      description: 消息中的标头。
      title: MessageHeaders
    type_messages_MessageSize:
      type: integer
      description: 消息大小（以字节为单位）。
      title: MessageSize
    type_messages_MessageUpdatedAt:
      type: string
      format: date-time
      description: 消息最后更新的时间。
      title: MessageUpdatedAt
    type_messages_MessageCreatedAt:
      type: string
      format: date-time
      description: 消息的创建时间。
      title: MessageCreatedAt
    type_attachments_AttachmentId:
      type: string
      description: 附件 ID。
      title: AttachmentId
    type_attachments_AttachmentFilename:
      type: string
      description: 附件文件名。
      title: AttachmentFilename
    type_attachments_AttachmentSize:
      type: integer
      description: 附件大小（字节）。
      title: AttachmentSize
    type_attachments_AttachmentContentType:
      type: string
      description: 附件的内容类型。
      title: AttachmentContentType
    type_attachments_AttachmentContentDisposition:
      type: string
      enum:
        - inline
        - attachment
      description: 附件的内容处置方式。
      title: AttachmentContentDisposition
    type_attachments_AttachmentContentId:
      type: string
      description: 附件的内容 ID。
      title: AttachmentContentId
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````