Command

nylas email drafts create

Create a new draft email with optional attachments.

Written by Qasim Muhammad Staff SRE

What does nylas email drafts create do?

The nylas email drafts create command saves a draft instead of sending it, so an AI agent can stage a reply for human review. It works across Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP, and returns the draft ID with --json.

Usage

nylas email drafts create --to EMAIL --subject TEXT --body TEXT [--json]

Flags

FlagDescription
--jsonOutput as JSON
--no-colorDisable color output
--verbose(-v)Enable verbose output
--configCustom config file path
--help(-h)Show help for the command
--limitLimit results (most list commands)
--yes(-y)Skip confirmations
--to(-t)Recipient email addresses
--subject(-s)Email subject
--body(-b)Email body
--ccCC email addresses
--attach(-a)File paths to attach
--reply-toMessage ID to reply to
--signature-idStored signature ID to append when creating the draft

Examples

Stage a draft for human review

nylas email drafts create --to customer@example.com --subject "Re: your order" --body "Thanks for reaching out."

Create a draft and capture its ID

nylas email drafts create --to customer@example.com --subject "Re: your order" --body "On it." --json | jq -r '.id'

Example output

✓ Draft created
  Draft ID: draft_abc123
  To: alice@example.com
  Subject: Q3 planning

Troubleshooting

Draft created but not visible in webmail

Some providers sync drafts on a delay. Run nylas email drafts list --json to confirm the draft exists by ID.

Attachment rejected

Pass a readable local file path to --attach and stay within the provider's attachment size limit (25 MB on Gmail).

Recommended guides

Run nylas email drafts create --help for full help output.