> ## Documentation Index
> Fetch the complete documentation index at: https://agentmail.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://agentmail.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://agentmail.manicule.dev/api/mcp.
> Every agent surface: https://agentmail.manicule.dev/.well-known/llms-manifest.json

# Update Draft (/api-reference/update-draft)

<!-- agent-signals: reading_time_min: 7 · est_tokens: 4787 · updated: 2026-09-29 -->
Related: [Sign Up](/api-reference/sign-up.md), [Attach Human](/api-reference/attach-human.md), [Verify](/api-reference/verify.md), [List Inboxes](/api-reference/list-inboxes.md), [Create Inbox](/api-reference/create-inbox.md), [Search Inboxes](/api-reference/search-inboxes.md)

# Update Draft

`PATCH /v0/inboxes/{inbox_id}/drafts/{draft_id}`

> Edit fields on an existing draft. Passing `null` clears a field (or `[]`
> for a recipient field); `send_at: null` un-schedules a scheduled draft.
> A draft that is already being sent cannot be edited.
>
> **CLI:**
> ```bash
> agentmail inboxes drafts update --inbox-id <inbox_id> --draft-id <draft_id> --subject "Updated subject"
> ```

Base URL: `https://api.agentmail.to`

Base URL: `https://x402.api.agentmail.to`

Base URL: `https://mpp.api.agentmail.to`

Base URL: `https://api.agentmail.eu`

## OpenAPI

```json
{
  "servers": [
    {
      "url": "https://api.agentmail.to",
      "description": "prod"
    },
    {
      "url": "https://x402.api.agentmail.to",
      "description": "prod-x402"
    },
    {
      "url": "https://mpp.api.agentmail.to",
      "description": "prod-mpp"
    },
    {
      "url": "https://api.agentmail.eu",
      "description": "eu-prod"
    }
  ],
  "security": [
    {
      "Bearer": []
    }
  ],
  "securitySchemes": {
    "Bearer": {
      "type": "http",
      "scheme": "bearer"
    }
  },
  "parameters": [
    {
      "name": "inbox_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "description": "The ID of the inbox.",
        "title": "InboxId"
      }
    },
    {
      "name": "draft_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "description": "ID of draft.",
        "title": "DraftId"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "reply_to": {
              "oneOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Reply-to addresses. In format `username@domain.com` or `Display Name <username@domain.com>`.",
                  "title": "DraftReplyTo"
                },
                {
                  "type": "null"
                }
              ]
            },
            "to": {
              "oneOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Addresses of recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.",
                  "title": "DraftTo"
                },
                {
                  "type": "null"
                }
              ]
            },
            "cc": {
              "oneOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Addresses of CC recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.",
                  "title": "DraftCc"
                },
                {
                  "type": "null"
                }
              ]
            },
            "bcc": {
              "oneOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Addresses of BCC recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.",
                  "title": "DraftBcc"
                },
                {
                  "type": "null"
                }
              ]
            },
            "subject": {
              "oneOf": [
                {
                  "type": "string",
                  "description": "Subject of draft.",
                  "title": "DraftSubject"
                },
                {
                  "type": "null"
                }
              ]
            },
            "text": {
              "oneOf": [
                {
                  "type": "string",
                  "description": "Plain text body of draft.",
                  "title": "DraftText"
                },
                {
                  "type": "null"
                }
              ]
            },
            "html": {
              "oneOf": [
                {
                  "type": "string",
                  "description": "HTML body of draft.",
                  "title": "DraftHtml"
                },
                {
                  "type": "null"
                }
              ]
            },
            "add_attachments": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "filename": {
                    "type": "string",
                    "description": "Filename of attachment.",
                    "title": "AttachmentFilename"
                  },
                  "content_type": {
                    "type": "string",
                    "description": "Content type of attachment.",
                    "title": "AttachmentContentType"
                  },
                  "content_disposition": {
                    "type": "string",
                    "enum": [
                      "inline",
                      "attachment"
                    ],
                    "description": "Content disposition of attachment.",
                    "title": "AttachmentContentDisposition"
                  },
                  "content_id": {
                    "type": "string",
                    "description": "Content ID of attachment.",
                    "title": "AttachmentContentId"
                  },
                  "content": {
                    "type": "string",
                    "description": "Base64 encoded content of the attachment. The entire request, including the message body and all attachments, is limited to 6 MB."
                  },
                  "url": {
                    "type": "string",
                    "description": "URL that AgentMail can download without custom authentication headers or cookies.\nRedirects and pre-signed URLs are supported, and the final response must be a\nsuccessful 2xx response. Keep URL-backed attachments around 30 MB total per message."
                  }
                },
                "description": "Provide either `content` or `url` for each attachment.",
                "title": "SendAttachment"
              },
              "description": "Attachments to add to the draft."
            },
            "remove_attachments": {
              "type": "array",
              "items": {
                "type": "string",
                "description": "ID of attachment.",
                "title": "AttachmentId"
              },
              "description": "IDs of attachments to remove from the draft."
            },
            "add_labels": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Labels of draft.",
              "title": "DraftLabels"
            },
            "remove_labels": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Labels of draft.",
              "title": "DraftLabels"
            },
            "send_at": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Time at which to schedule send draft.",
                  "title": "DraftSendAt"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Edit fields on an existing draft. A draft's kind (plain, reply, or forward)\nis fixed at creation and cannot be changed here. Omitting a field leaves it\nunchanged; passing `null` (or `[]` for a recipient field) clears it. Pass\n`send_at` to schedule or reschedule the draft, or `null` to un-schedule it.",
          "title": "UpdateDraftRequest"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Response with status 200",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "inbox_id": {
                "type": "string",
                "description": "The ID of the inbox.",
                "title": "InboxId"
              },
              "draft_id": {
                "type": "string",
                "description": "ID of draft.",
                "title": "DraftId"
              },
              "client_id": {
                "type": "string",
                "description": "Client ID of draft.",
                "title": "DraftClientId"
              },
              "labels": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Labels of draft.",
                "title": "DraftLabels"
              },
              "reply_to": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Reply-to addresses. In format `username@domain.com` or `Display Name <username@domain.com>`.",
                "title": "DraftReplyTo"
              },
              "to": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Addresses of recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.",
                "title": "DraftTo"
              },
              "cc": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Addresses of CC recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.",
                "title": "DraftCc"
              },
              "bcc": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Addresses of BCC recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.",
                "title": "DraftBcc"
              },
              "subject": {
                "type": "string",
                "description": "Subject of draft.",
                "title": "DraftSubject"
              },
              "preview": {
                "type": "string",
                "description": "Text preview of draft.",
                "title": "DraftPreview"
              },
              "text": {
                "type": "string",
                "description": "Plain text body of draft.",
                "title": "DraftText"
              },
              "html": {
                "type": "string",
                "description": "HTML body of draft.",
                "title": "DraftHtml"
              },
              "attachments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "attachment_id": {
                      "type": "string",
                      "description": "ID of attachment.",
                      "title": "AttachmentId"
                    },
                    "filename": {
                      "type": "string",
                      "description": "Filename of attachment.",
                      "title": "AttachmentFilename"
                    },
                    "size": {
                      "type": "integer",
                      "description": "Size of attachment in bytes.",
                      "title": "AttachmentSize"
                    },
                    "content_type": {
                      "type": "string",
                      "description": "Content type of attachment.",
                      "title": "AttachmentContentType"
                    },
                    "content_disposition": {
                      "type": "string",
                      "enum": [
                        "inline",
                        "attachment"
                      ],
                      "description": "Content disposition of attachment.",
                      "title": "AttachmentContentDisposition"
                    },
                    "content_id": {
                      "type": "string",
                      "description": "Content ID of attachment.",
                      "title": "AttachmentContentId"
                    }
                  },
                  "required": [
                    "attachment_id",
                    "size"
                  ],
                  "title": "Attachment"
                },
                "description": "Attachments in draft.",
                "title": "DraftAttachments"
              },
              "in_reply_to": {
                "type": "string",
                "description": "ID of message being replied to.",
                "title": "DraftInReplyTo"
              },
              "forward_of": {
                "type": "string",
                "description": "ID of message being forwarded.",
                "title": "DraftForwardOf"
              },
              "references": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "IDs of previous messages in thread."
              },
              "send_status": {
                "type": "string",
                "enum": [
                  "scheduled",
                  "sending",
                  "failed"
                ],
                "description": "Schedule send status of draft.",
                "title": "DraftSendStatus"
              },
              "send_at": {
                "type": "string",
                "format": "date-time",
                "description": "Time at which to schedule send draft.",
                "title": "DraftSendAt"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "Time at which draft was last updated.",
                "title": "DraftUpdatedAt"
              },
              "created_at": {
                "type": "string",
                "format": "date-time",
                "description": "Time at which draft was created."
              }
            },
            "required": [
              "inbox_id",
              "draft_id",
              "labels",
              "updated_at",
              "created_at"
            ],
            "title": "Draft"
          }
        }
      }
    },
    "400": {
      "description": "Error response with status 400",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Name of error.",
                "title": "ErrorName"
              },
              "code": {
                "type": "string",
                "description": "Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.",
                "title": "ErrorCode"
              },
              "message": {
                "type": "string",
                "description": "Error message.",
                "title": "ErrorMessage"
              },
              "errors": {
                "description": "Validation errors. Each entry has a path and a message identifying the invalid field."
              },
              "fix": {
                "type": "string",
                "description": "The concrete next action that resolves the error.",
                "title": "ErrorFix"
              },
              "docs": {
                "type": "string",
                "description": "Link to the error reference entry for this code.",
                "title": "ErrorDocs"
              }
            },
            "required": [
              "name",
              "errors"
            ],
            "title": "ValidationErrorResponse"
          }
        }
      }
    },
    "404": {
      "description": "Error response with status 404",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Name of error.",
                "title": "ErrorName"
              },
              "code": {
                "type": "string",
                "description": "Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.",
                "title": "ErrorCode"
              },
              "message": {
                "type": "string",
                "description": "Error message.",
                "title": "ErrorMessage"
              },
              "fix": {
                "type": "string",
                "description": "The concrete next action that resolves the error.",
                "title": "ErrorFix"
              },
              "docs": {
                "type": "string",
                "description": "Link to the error reference entry for this code.",
                "title": "ErrorDocs"
              }
            },
            "required": [
              "name",
              "message"
            ],
            "title": "ErrorResponse"
          }
        }
      }
    },
    "409": {
      "description": "Error response with status 409",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Name of error.",
                "title": "ErrorName"
              },
              "code": {
                "type": "string",
                "description": "Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.",
                "title": "ErrorCode"
              },
              "message": {
                "type": "string",
                "description": "Error message.",
                "title": "ErrorMessage"
              },
              "fix": {
                "type": "string",
                "description": "The concrete next action that resolves the error.",
                "title": "ErrorFix"
              },
              "docs": {
                "type": "string",
                "description": "Link to the error reference entry for this code.",
                "title": "ErrorDocs"
              }
            },
            "required": [
              "name",
              "message"
            ],
            "title": "ErrorResponse"
          }
        }
      }
    }
  }
}
```
