Zoho: Update an Email Draft
Zoho emailDrafts.updateEmailDrafts: arguments, response, policy and SDK examples.
← Email drafts operations · Get started
Operation zoho.updateemaildrafts
Provider route: PUT /crm/v8/{module}/{record}/__email_drafts/{draft}. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/zoho with npm, or alter-sdk-zoho with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { ZohoIntegration } from "@alter-ai/zoho";
async function execute(input: Parameters<ZohoIntegration["emailDrafts"]["updateEmailDrafts"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new ZohoIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.emailDrafts.updateEmailDrafts(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_zoho import ZohoIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = ZohoIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.email_drafts.update_email_drafts(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.module | string | Required within parent | Maximum length: 100 |
path.record | string | Required within parent | Maximum length: 100 Pattern: ^[0-9]+$ |
path.draft | string | Required within parent | Maximum length: 256 |
body | object | Required within parent | Request body for updating a single email draft. Additional keys: not allowed |
body.__email_drafts | array | Required within parent | List containing the single draft to update. Maximum items: 1 |
body.__email_drafts[] | object | Each item | Email draft object for update. Additional keys: not allowed |
body.__email_drafts[].attachments | array | Optional | Attachments list; replaces existing. Maximum items: 50 |
body.__email_drafts[].attachments[] | Model | Each item | Expand Update an Email Draft — request body — body email drafts item attachments item |
body.__email_drafts[].bcc | array | Optional | BCC recipients. Replaces the existing list. Maximum items: 100 |
body.__email_drafts[].bcc[] | object | Each item | BCC recipient object. Additional keys: not allowed |
body.__email_drafts[].bcc[].email | string | Required within parent | BCC recipient email address. Maximum length: 256 |
body.__email_drafts[].bcc[].user_name | string or null | Optional | BCC recipient display name; null if not available. Maximum length: 256 |
body.__email_drafts[].cc | array | Optional | CC recipients. Replaces the existing list. Maximum items: 100 |
body.__email_drafts[].cc[] | object | Each item | CC recipient object. Additional keys: not allowed |
body.__email_drafts[].cc[].email | string | Required within parent | CC recipient email address. Maximum length: 256 |
body.__email_drafts[].cc[].user_name | string or null | Optional | CC recipient display name; null if not available. Maximum length: 256 |
body.__email_drafts[].content | string or null | Optional | HTML body when rich_text is true; null to clear. Maximum length: 200000 |
body.__email_drafts[].from | string | Required within parent | Specifies the sender email address. Must be a configured outgoing address for the user. Use the [From Addresses API](from_addresses.yaml#$.paths./settings/emails/actions/from_addresses.get) to retrieve valid from addresses. Maximum length: 254 Pattern: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,} |
body.__email_drafts[].inventory_details | Model | Optional | Expand Update an Email Draft — request body — body email drafts item inventory details |
body.__email_drafts[].linked_record | Model | Optional | Expand Update an Email Draft — request body — body email drafts item linked record |
body.__email_drafts[].plainTextContent | string or null | Optional | Plain text body when rich_text is false; null to clear. Maximum length: 200000 |
body.__email_drafts[].reply_to | string or null | Optional | Reply-to email address; null to clear. Maximum length: 256 |
body.__email_drafts[].rich_text | boolean | Required within parent | true for HTML editor; false for plain text. |
body.__email_drafts[].schedule_details | Model | Optional | Expand Update an Email Draft — request body — body email drafts item schedule details |
body.__email_drafts[].source | string | Optional | Source identifier string stored at draft creation time (e.g., campaign name or integration identifier). Maximum length: 256 |
body.__email_drafts[].subject | string or null | Optional | Email subject; null to clear. Maximum length: 512 |
body.__email_drafts[].to | array | Optional | Primary recipients. Replaces the existing list. Maximum items: 100 |
body.__email_drafts[].to[] | object | Each item | Recipient object. Additional keys: not allowed |
body.__email_drafts[].to[].email | string | Required within parent | Recipient email address. Maximum length: 256 |
body.__email_drafts[].to[].user_name | string or null | Optional | Recipient display name; null if not available. Maximum length: 256 |
Referenced models: Update an Email Draft — request body — body email drafts item attachments item, Update an Email Draft — request body — body email drafts item inventory details, Update an Email Draft — request body — body email drafts item linked record, Update an Email Draft — request body — body email drafts item schedule details
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Response object containing the result of updating email drafts. Additional keys: not allowed |
__email_drafts | array | Required within parent | List of updated email draft results. Maximum items: 1 |
__email_drafts[] | Model | Each item | Expand Update an Email Draft — response body — email drafts item |
Referenced models: Update an Email Draft — response body — email drafts item
Schemas
Section titled “Schemas”Update an Email Draft — request body — body email drafts item attachments item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Attachment reference. Additional keys: not allowed |
_delete | boolean | Optional | true to remove this attachment. |
file_name | string | Optional | File name. Maximum length: 512 |
file_size | string | Optional | File size in bytes as a numeric string. Maximum length: 20 |
id | string | Required within parent | Attachment/file identifier. Use the [Files API](files.yaml#$.paths./files.get) to retrieve file IDs. Maximum length: 256 |
service_name | string | Required within parent | Storage service name. Maximum length: 100 |
Update an Email Draft — response body — email drafts item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Result of a single updated email draft. Additional keys: not allowed |
code | string | Required within parent | Status code for the operation. Known values: SUCCESS |
details | object | Required within parent | Details of the updated draft. Additional keys: not allowed |
details.id | string | Required within parent | Encrypted identifier of the updated draft. Maximum length: 256 |
message | string | Required within parent | Operation message. Maximum length: 512 |
status | string | Required within parent | Status of the operation. Known values: success |
Update an Email Draft — request body — body email drafts item inventory details
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object or null | Root | Inventory email details; null to remove. Additional keys: not allowed |
inventory_template | object | Required within parent | Inventory template to use. Additional keys: not allowed |
inventory_template.id | string | Required within parent | Inventory template identifier. Maximum length: 64 |
paper_type | string | Required within parent | Paper type. One of: A4, USLetter |
view_type | string | Required within parent | View type. One of: portrait, landscape |
Update an Email Draft — request body — body email drafts item linked record
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object or null | Root | CRM record to link this draft to; null to clear. Additional keys: not allowed |
id | string | Required within parent | CRM record identifier to link. Maximum length: 64 |
module | object | Required within parent | Module to which the record belongs. Specify at least one of "api_name" or "id". If both are specified, they must refer to the same module. Minimum fields: 1 Additional keys: not allowed |
module.api_name | string | Optional | API name of the module. Maximum length: 100 |
module.id | string | Optional | Tab identifier of the module. Maximum length: 20 |
Update an Email Draft — request body — body email drafts item schedule details
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object or null | Root | Scheduling details; null to remove schedule. Additional keys: not allowed |
source | string | Optional | Source of the schedule decision. One of: ecOneHourAhead, upTime, ecSchduleBestTime, ecUpComing, ecSchduleTime |
time | string | Required within parent | Scheduled send time (ISO 8601 format). Format: date-time |
timezone | string or null | Optional | Java TimeZone ID string; null uses organization default. Maximum length: 100 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.updateemaildrafts. Catalog operation: updateEmailDrafts. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.