> ## 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/drafts/{draft_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/drafts/{draft_id}:
    get:
      tags:
        - subpackage_drafts
      summary: 获取草稿
      description: |-
        **CLI：**
        ```bash
        agentmail drafts get --draft-id <draft_id>
        ```
      operationId: get_agentmail_drafts_draft_id
      parameters:
        - name: draft_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/type_drafts_DraftId'
        - name: Authorization
          in: header
          description: Bearer 身份验证
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 状态码为 200 的响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_drafts_Draft'
        '404':
          description: 状态码为 404 的错误响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type__ErrorResponse'
components:
  schemas:
    type_drafts_DraftId:
      type: string
      description: 草稿 ID。
      title: DraftId
    type_drafts_Draft:
      type: object
      properties:
        inbox_id:
          $ref: '#/components/schemas/type_inboxes_InboxId'
        draft_id:
          $ref: '#/components/schemas/type_drafts_DraftId'
        client_id:
          $ref: '#/components/schemas/type_drafts_DraftClientId'
        labels:
          $ref: '#/components/schemas/type_drafts_DraftLabels'
        reply_to:
          $ref: '#/components/schemas/type_drafts_DraftReplyTo'
        to:
          $ref: '#/components/schemas/type_drafts_DraftTo'
        cc:
          $ref: '#/components/schemas/type_drafts_DraftCc'
        bcc:
          $ref: '#/components/schemas/type_drafts_DraftBcc'
        subject:
          $ref: '#/components/schemas/type_drafts_DraftSubject'
        preview:
          $ref: '#/components/schemas/type_drafts_DraftPreview'
        text:
          $ref: '#/components/schemas/type_drafts_DraftText'
        html:
          $ref: '#/components/schemas/type_drafts_DraftHtml'
        attachments:
          $ref: '#/components/schemas/type_drafts_DraftAttachments'
        in_reply_to:
          $ref: '#/components/schemas/type_drafts_DraftInReplyTo'
        references:
          type: array
          items:
            type: string
          description: 会话串中先前消息的 ID。
        send_status:
          $ref: '#/components/schemas/type_drafts_DraftSendStatus'
        send_at:
          $ref: '#/components/schemas/type_drafts_DraftSendAt'
        updated_at:
          $ref: '#/components/schemas/type_drafts_DraftUpdatedAt'
        created_at:
          type: string
          format: date-time
          description: 草稿创建时间。
      required:
        - inbox_id
        - draft_id
        - labels
        - updated_at
        - created_at
      title: Draft
    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_drafts_DraftClientId:
      type: string
      description: 草稿的客户端 ID。
      title: DraftClientId
    type_drafts_DraftLabels:
      type: array
      items:
        type: string
      description: 草稿标签。
      title: DraftLabels
    type_drafts_DraftReplyTo:
      type: array
      items:
        type: string
      description: 回复地址。格式为 `username@domain.com` 或 `Display Name <username@domain.com>`。
      title: DraftReplyTo
    type_drafts_DraftTo:
      type: array
      items:
        type: string
      description: 收件人地址。格式为 `username@domain.com` 或 `Display Name <username@domain.com>`。
      title: DraftTo
    type_drafts_DraftCc:
      type: array
      items:
        type: string
      description: >-
        抄送收件人的地址。格式为 `username@domain.com` 或 `Display Name
        <username@domain.com>`。
      title: DraftCc
    type_drafts_DraftBcc:
      type: array
      items:
        type: string
      description: >-
        BCC 收件人的地址。格式为 `username@domain.com` 或 `Display Name
        <username@domain.com>`。
      title: DraftBcc
    type_drafts_DraftSubject:
      type: string
      description: 草稿主题。
      title: DraftSubject
    type_drafts_DraftPreview:
      type: string
      description: 草稿文本预览。
      title: DraftPreview
    type_drafts_DraftText:
      type: string
      description: 草稿的纯文本正文。
      title: DraftText
    type_drafts_DraftHtml:
      type: string
      description: 草稿的 HTML 正文。
      title: DraftHtml
    type_drafts_DraftAttachments:
      type: array
      items:
        $ref: '#/components/schemas/type_attachments_Attachment'
      description: 草稿中的附件。
      title: DraftAttachments
    type_drafts_DraftInReplyTo:
      type: string
      description: 被回复消息的 ID。
      title: DraftInReplyTo
    type_drafts_DraftSendStatus:
      type: string
      enum:
        - scheduled
        - sending
        - failed
      description: 草稿的定时发送状态。
      title: DraftSendStatus
    type_drafts_DraftSendAt:
      type: string
      format: date-time
      description: 计划发送草稿的时间。
      title: DraftSendAt
    type_drafts_DraftUpdatedAt:
      type: string
      format: date-time
      description: 草稿的最后更新时间。
      title: DraftUpdatedAt
    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_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

````