Create Inbox Draft
create-inbox-draftPurpose: Create a draft in a Resend inbox: a message saved for later, NOT sent. At least one of to, cc, bcc, subject, text, html, or attachments is required. Nothing leaves the account until send-inbox-draft is called on it.
Instructions
Purpose: Create a draft in a Resend inbox: a message saved for later, NOT sent. At least one of to, cc, bcc, subject, text, html, or attachments is required. Nothing leaves the account until send-inbox-draft is called on it.
NOT for: Sending mail. To send straight away, use send-new-inbox-email to start a new thread from the inbox, reply-to-inbox-thread-email to answer a thread, or forward-inbox-thread-email to pass a message along.
Returns: The draft's id.
When to use: User asks to draft, compose, or prepare a message without sending it, or wants to read the wording back before it goes out. Pass threadId and replyToEmailId together to draft a reply to a message in a thread; omit both to draft a standalone message. A reply draft without "to" is addressed to the author of the message it replies to, at its Reply-To address if it has one, or, for a message the inbox sent, to its to recipients. An unknown threadId, or a replyToEmailId that is not in that thread, returns a 404. A reply draft without a subject keeps an empty one, with no "Re:" prefix, and cannot be sent until you set one. A message can have only one unsent reply draft, so drafting a second reply to it returns the ID of the existing draft. That call ignores every other field except attachments, which replace the existing draft's attachments. The id this returns is the "draftId" that get-inbox-draft, update-inbox-draft, send-inbox-draft, and remove-inbox-draft all take.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | Email address to copy, or an array of addresses. Across to, cc, and bcc a draft can carry at most 50 recipients in total. | |
| to | No | Recipient email address (e.g. "customer@example.com"), or an array of addresses to reach several. Across to, cc, and bcc a draft can carry at most 50 recipients in total. | |
| bcc | No | Email address to blind-copy, or an array of addresses. Across to, cc, and bcc a draft can carry at most 50 recipients in total. | |
| html | No | HTML body of the draft. | |
| text | No | Plain text body of the draft. | |
| inboxId | Yes | Inbox ID | |
| subject | No | Subject of the draft. Max 2000 characters. It cannot be only whitespace or contain a line break. | |
| threadId | No | ID of the thread this draft replies to. Must be provided together with replyToEmailId. Omit both to draft a standalone message. Get the thread ID from list-inbox-threads. | |
| attachments | No | Files to store on the draft. Each one needs filename, base64 content and contentType; a draft cannot attach a file by URL. There is no limit on the number of files, but together they can total at most 25 MB. An empty file or a blocked file type (such as .exe) is rejected. They are sent with the draft when send-inbox-draft is called. | |
| idempotencyKey | No | Optional unique key that prevents duplicate drafts on retries (sent as the Idempotency-Key header). Use the same key when retrying the same logical draft; use a new key for a different draft. Must be 1-256 characters. | |
| replyToEmailId | No | ID of the message in that thread this draft replies to, the "Email ID" get-inbox-thread prints for it. Must be provided together with threadId. |