Skip to main content

Gmail - Update Draft

Update existing draft emails in Gmail. Modify recipients, subject, or body content of saved drafts.

Overview

The Gmail Update Draft tool allows you to modify existing draft emails. This is essential for refining AI-generated drafts, collaborative editing workflows, and iterative email composition.

Key Features:

  • Update any field of an existing draft
  • Modify recipients (to, cc, bcc)
  • Change subject and body content
  • Support for plain text and HTML email bodies
  • Returns updated draft_id for reference

Common Use Cases:

  • Refine AI-generated draft responses
  • Update draft recipients or subject line
  • Add HTML formatting to existing drafts
  • Collaborative draft editing workflows
  • Iterative email composition with feedback

Prerequisites

OAuth Authentication Required: This tool only works with OAuth authentication. App Password accounts will return an error.

Setup OAuth

Follow our Google Account OAuth Setup Guide to:

  1. Create a Google Cloud project
  2. Enable Gmail API
  3. Create OAuth credentials
  4. Connect your account to Reeva

App Password authentication is not supported for Update Draft because Gmail's IMAP protocol doesn't support updating existing drafts.

Using the Tool

1. Create an Update Draft Tool Instance

  1. Navigate to My Tools in Reeva
  2. Click Create New Tool
  3. Select Gmail - Update Draft from the base tools
  4. Give your tool a name (e.g., "Update Gmail Drafts")
  5. Select your OAuth Gmail account (not App Password)
  6. Click Create

2. Update a Draft

Update an existing draft email:

{
"draft_id": "r-1234567890123456789",
"to": ["recipient@example.com"],
"subject": "Updated: Q4 Planning Meeting",
"body": "Hi team,\n\nUpdated time: Let's meet Thursday at 2pm.\n\nBest regards"
}

3. Update with CC and BCC

Modify recipients including CC and BCC:

{
"draft_id": "r-1234567890123456789",
"to": ["recipient@example.com"],
"cc": ["manager@company.com"],
"bcc": ["archive@company.com"],
"subject": "Project Update",
"body": "Updated project status..."
}

4. Update with HTML Content

Add or modify HTML formatting:

{
"draft_id": "r-1234567890123456789",
"to": ["recipient@example.com"],
"subject": "Newsletter - December 2024",
"body": "Plain text version of newsletter",
"html_body": "<html><body><h1>Newsletter</h1><p>Check out our <strong>latest updates</strong>!</p></body></html>"
}

Tool Parameters

ParameterTypeRequiredDescription
draft_idstringYesGmail draft ID to update (from Create Draft or List Drafts)
toarrayYesList of recipient email addresses
subjectstringYesEmail subject line
bodystringYesPlain text email body
html_bodystringNoOptional HTML version of email body
ccarrayNoList of CC recipient email addresses
bccarrayNoList of BCC recipient email addresses

Parameter Details

draft_id (required):

  • Gmail draft ID returned from Create Draft or List Drafts
  • Format: r-XXXXXXXXXXXXXXXXX (19-digit number prefixed with r-)
  • Example: "r-1234567890123456789"

to (required):

  • Array of email addresses
  • Must have at least one recipient
  • Example: ["user@example.com", "another@example.com"]

subject (required):

  • String, cannot be empty
  • Be descriptive and clear
  • Example: "Updated: Q4 Budget Review"

body (required):

  • Plain text email body
  • Cannot be empty
  • Supports line breaks (\n)
  • Example: "Hi team,\n\nHere's the updated info..."

html_body (optional):

  • HTML-formatted version
  • Gmail displays this if provided, plain text as fallback
  • Use for rich formatting, links, images
  • Example: "<p>Hi team,</p><p>Check <a href='...'>this link</a>.</p>"

cc (optional):

  • Array of CC (carbon copy) recipients
  • Recipients see other recipients
  • Example: ["manager@company.com"]

bcc (optional):

  • Array of BCC (blind carbon copy) recipients
  • Recipients don't see other BCC recipients
  • Example: ["archive@company.com"]

Response Format

Successful Update

{
"success": true,
"draft_id": "r-1234567890123456789",
"message_id": "18d5f2a3b4c5d6e7",
"from": "sender@gmail.com",
"to": ["recipient@example.com"],
"subject": "Updated: Q4 Planning Meeting",
"message": "Draft updated successfully"
}

Response Fields

  • success: Whether the draft was updated successfully
  • draft_id: Gmail draft ID (same as input)
  • message_id: Gmail message ID for the draft content
  • from: Sender email address (your Gmail)
  • to: List of recipients
  • subject: Updated email subject
  • message: Confirmation message
  • cc: CC recipients (if provided)
  • bcc: BCC recipients (if provided)

OAuth vs App Password

FeatureOAuthApp Password
Update drafts❌ Not supported
ReasonGmail API supports draft updatesIMAP protocol limitation

Why OAuth only? Gmail's IMAP protocol (used by App Password) doesn't support modifying existing drafts. The only way to update a draft via IMAP would be to delete it and create a new one, which changes the draft_id and could cause issues.

Use Cases

1. Refine AI-Generated Drafts

Workflow:
1. AI generates initial draft with Create Draft
2. Human reviews draft content
3. AI adjusts draft based on feedback using Update Draft
4. Repeat until draft is perfect
5. Send draft using Send Draft tool

2. Collaborative Editing

Workflow:
1. Team member creates initial draft
2. Manager reviews and suggests changes
3. Update Draft applies manager's feedback
4. Final review and send

3. Add Formatting to Plain Text Draft

{
"draft_id": "r-1234567890123456789",
"to": ["team@example.com"],
"subject": "Weekly Update",
"body": "Plain text fallback",
"html_body": "<h1>Weekly Update</h1><ul><li>Item 1</li><li>Item 2</li></ul>"
}

4. Change Recipients Before Sending

{
"draft_id": "r-1234567890123456789",
"to": ["new-recipient@example.com"],
"cc": ["added-cc@example.com"],
"subject": "Same subject",
"body": "Same content, different recipients"
}

Error Handling

Draft Not Found

{
"error": "Draft with ID 'r-1234567890123456789' not found. It may have been deleted or sent."
}

Cause: Draft doesn't exist or was already sent

Solution:

  • Verify draft_id using List Drafts tool
  • Check if draft was sent or deleted
  • Create a new draft if needed

Invalid Draft ID

{
"error": "Draft ID is required"
}

Cause: Empty or missing draft_id

Solution: Provide a valid draft_id from Create Draft or List Drafts

App Password Authentication

{
"error": "Update Draft requires OAuth authentication. App Password is not supported for this operation."
}

Cause: Using App Password account instead of OAuth

Solution:

  1. Set up OAuth authentication: OAuth Setup Guide
  2. Create a new tool instance with OAuth account

Invalid Email Address

{
"error": "Invalid email address: not-an-email"
}

Cause: Malformed email address

Solution: Check email format (must be user@domain.com)

Tips

  1. Get draft_id First: Always use Create Draft or List Drafts to get the draft_id before updating

  2. Full Replacement: Update replaces the entire draft content - provide all fields you want to keep

    {
    "draft_id": "r-123...",
    "to": ["..."], // Must provide all fields
    "subject": "...", // Even if not changing
    "body": "..." // All required fields needed
    }
  3. Verify Updates: Use List Drafts with format: "full" to confirm changes

  4. Keep Draft ID: The draft_id remains the same after updates - no need to track new IDs

  5. HTML Best Practices:

    • Use inline CSS (external stylesheets don't work in email)
    • Keep HTML simple (complex CSS may not render)
    • Always provide plain text fallback

Limitations

  1. OAuth Only: App Password authentication is not supported

  2. No Partial Updates: Must provide all required fields (to, subject, body) even if only changing one

  3. No Undo: Updates are immediate - use List Drafts to check before updating

  4. Cannot Update Sent Emails: Only works with drafts, not sent messages

  5. Draft ID Persistence: The draft_id stays the same, but the message_id may change

Troubleshooting

Update Not Reflected

Cause: Caching or sync delay

Solution:

  • Refresh Gmail (press F5 or Cmd+R)
  • Use List Drafts to verify the update
  • Wait a few seconds for sync

Lost Draft Content

Cause: Update replaced content unintentionally

Solution:

  • Updates replace entire draft - always include all content
  • Use List Drafts (format=full) to get current content before updating
  • No undo available - recreate draft if needed

Permission Denied

Cause: OAuth token lacks necessary permissions

Solution:

  1. Reconnect Gmail account in Reeva
  2. Ensure Gmail API is enabled in Google Cloud Console
  3. Grant all requested permissions during OAuth flow

Support

Need help? Reach out to our support team or join our Discord community.