Update a Gmail draft
Input
draftId requiredThe draft's current id, as returned by the drafts listing. Note Gmail replaces this id on every save, so use a freshly listed one.
body optionalReplacement body text. This replaces the whole body rather than adding to it. Pass an empty string to clear it. Omit to leave the body as it is.
subject optionalReplacement subject line. Pass an empty string to clear it. Omit to leave the subject as it is.
Output
after requiredWhat the draft said after the edit, read back from the composer.
before requiredWhat the draft said before the edit.
changed requiredWhich fields were actually written. Empty when nothing needed changing.
draftId requiredThe draft's id AFTER the edit. Gmail mints a new one on every save, so this differs from the id passed in whenever something was written. Use this for follow-up calls.
account_used requiredThe Gmail account the draft was edited in, read from the session rather than assumed.
already_present requiredTrue when the draft already said exactly what was asked for, so nothing was written.
verified_on_page requiredTrue when the drafts listing showed the draft with the new subject — and, when the body changed, with the new body in its preview — after Gmail saved it.
threadId optionalId of the conversation holding the draft. Unlike the draft id this survives a save, which makes it the durable handle for the same draft over time.
previousDraftId optionalThe id that was passed in, which Gmail has now retired.
