publ betaReference (MCP guide)
Open publ console

publ Reference

email_draft_apply

Create, edit or remove an email draft in the Email app (pApp F00003). Title 4–50, subject 4–120, optional preview 4–60, HTML body up to 500,000 characters, optional labelIds and optional lang (the language of the email system texts) on creation. The management title alone can be changed in any status, also while sending or after sending, as on the console detail screen. Write: a scheduled email change needs CHANGE_SCHEDULED_EMAIL; removing it cancels its send and needs DELETE_SCHEDULED_EMAIL; removing a draft needs DELETE_EMAIL_DRAFT. Does not send. A lost receipt stays pending and is never resent; task_resume only observes, and prepared work needs the identical apply. Called without confirmToken it previews and returns a confirmToken; repeating the same input with it executes once.

Inputs

Field Required here Contract
action Yes one of: create, edit, remove
title Yes When action is create: string; min length 4; max length 50
subject Yes When action is create: string; min length 4; max length 120
previewText No When action is create: `` or string; min length 4; max length 60
isPromotionalPush Yes When action is create: boolean
lang No When action is create: ko, en, ja, es, fil, fr, it, ru, vi; Optional language of the email system texts; the console sends its display language.
labelIds No When action is create: array; items: string; pattern ^[A-Za-z0-9_-]{1,200}$; Exact email identifier returned by email_drafts_get.; min items 1; max items 20; Existing label IDs from email_labels_get to attach at creation, as the console profile step does.
body No When action is create: string; max length 500000; Complete HTML body saved as a draft. Bridge size limit: 500,000 characters. Never sends or schedules this body.
confirmToken No When action is create: string; pattern ^ct[a-f\d]{32}$; The confirmToken from this tool's preview result. Omit it to preview; repeat the same input with it to execute.
emailId Yes When action is edit: string; pattern ^[A-Za-z0-9_-]{1,200}$; Exact email identifier returned by email_drafts_get.
metadata No When action is edit: object
metadata.title No When action is edit: string; min length 4; max length 50
metadata.subject No When action is edit: string; min length 4; max length 120
metadata.previewText No When action is edit: `` or string; min length 4; max length 60
metadata.isPromotionalPush No When action is edit: boolean
body No When action is edit: string; max length 500000; Complete HTML body saved as a draft. Bridge size limit: 500,000 characters. Never sends or schedules this body.
confirmation No When action is edit: CHANGE_SCHEDULED_EMAIL; Required when a SCHEDULE email changes anything other than its title: the console editor keeps the email scheduled with the changed content.
confirmToken No When action is edit: string; pattern ^ct[a-f\d]{32}$; The confirmToken from this tool's preview result. Omit it to preview; repeat the same input with it to execute.
emailId Yes When action is remove: string; pattern ^[A-Za-z0-9_-]{1,200}$; Exact email identifier returned by email_drafts_get.
confirmation Yes When action is remove: DELETE_EMAIL_DRAFT, DELETE_SCHEDULED_EMAIL; DELETE_EMAIL_DRAFT for a draft; DELETE_SCHEDULED_EMAIL for a scheduled email, which also cancels its send.
confirmToken No When action is remove: string; pattern ^ct[a-f\d]{32}$; The confirmToken from this tool's preview result. Omit it to preview; repeat the same input with it to execute.