Zoho: Update Email Drafts for a Record
Zoho emailDrafts.updateEmailDraftsForRecord: arguments, response, policy and SDK examples.
← Email drafts operations · Get started
Operation zoho.updateemaildraftsforrecord
Provider route: PUT /crm/v8/{module}/{record}/__email_drafts. 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"]["updateEmailDraftsForRecord"]>[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.updateEmailDraftsForRecord(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_for_record(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]+$ |
body | object | Required within parent | Request body for updating email drafts. Additional keys: not allowed |
body.__email_drafts | array | Required within parent | List of email drafts to update. Maximum items: 100 |
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[].id | string | Required within parent | Encrypted draft identifier. Required to identify which draft to update. Use the [Get Email Drafts](email_drafts.yaml#$.paths./{module}/{record}/__email_drafts.get) resource to retrieve draft IDs. Maximum length: 256 |
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 |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | object | Alternative | Response object containing the result of updating email drafts. Additional keys: not allowed |
$ (anyOf 1).__email_drafts | array | Required within parent | List of updated email draft results. Maximum items: 100 |
$ (anyOf 1).__email_drafts[] | Model | Each item | Expand Update an Email Draft — response body — email drafts item |
$ (anyOf 2) | Model | Alternative | Expand Create Email Drafts for a Record — response body — email drafts |
Referenced models: Update an Email Draft — response body — email drafts item, Create Email Drafts for a Record — response body — email drafts
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 |
Create Email Drafts for a Record — response body — email drafts
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Response containing per-draft status for mixed batch processing results. Additional keys: not allowed |
__email_drafts | array | Required within parent | Per-draft status results for the submitted batch. Maximum items: 100 |
__email_drafts[] | JSON | Each item | |
__email_drafts[] (anyOf 1) | Model | Alternative | Expand Create Email Drafts for a Record — response body — __email_drafts / __email_drafts / item / code: SUCCESS, status: success |
__email_drafts[] (anyOf 2) | Model | Alternative | Expand Create Email Drafts for a Record — response body — __email_drafts / __email_drafts / item / status: error |
Referenced models: Create Email Drafts for a Record — response body — __email_drafts / __email_drafts / item / code: SUCCESS, status: success, Create Email Drafts for a Record — response body — __email_drafts / __email_drafts / item / status: error
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 |
Create Email Drafts for a Record — response body — __email_drafts / __email_drafts / item / code: SUCCESS, status: success
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Per-item success result. Additional keys: not allowed |
code | string | Required within parent | Operation result code. Known values: SUCCESS |
details | object | Required within parent | Details for successful draft operation. Additional keys: not allowed |
details.id | string | Required within parent | Updated or created draft identifier. Maximum length: 64 |
message | string | Required within parent | Human-readable result message. Maximum length: 512 |
status | string | Required within parent | Per-item outcome status. Known values: success |
Create Email Drafts for a Record — response body — __email_drafts / __email_drafts / item / status: error
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Per-item validation or processing error result. Additional keys: not allowed |
code | string | Required within parent | Operation error code. **Possible values:** - **MANDATORY_NOT_FOUND** - A required field is missing. - **INVALID_DATA** - The field contains invalid data. - **NOT_ALLOWED** - The field is not allowed in this operation. - **DUPLICATE_DATA** - A duplicate value was found (e.g. a duplicate attachment). - **EXPECTED_FIELD_MISSING** - At least one of a set of expected fields must be specified. - **AMBIGUITY_DURING_PROCESSING** - The given field values are ambiguous or conflicting. - **NOT_SUPPORTED** - The given field or value is not supported for this module. - **DEPENDENT_MISMATCH** - A field value does not match its dependent field. Known values: MANDATORY_NOT_FOUND, INVALID_DATA, NOT_ALLOWED, DUPLICATE_DATA, EXPECTED_FIELD_MISSING, AMBIGUITY_DURING_PROCESSING, NOT_SUPPORTED, DEPENDENT_MISMATCH Maximum length: 128 |
details | object | Required within parent | Details for failed draft operation. Additional keys: allowed |
details.api_name | string | Optional | Field or API name that caused the error. Maximum length: 128 |
details.json_path | string | Optional | JSON path for the invalid or missing field. Maximum length: 256 |
message | string | Required within parent | Human-readable error message. Maximum length: 512 |
status | string | Required within parent | Per-item outcome status. Known values: error |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.updateemaildraftsforrecord. Catalog operation: updateEmailDraftsForRecord. 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.