Skip to content

Zoho: Get an Email Draft

Zoho emailDrafts.getEmailDraft: arguments, response, policy and SDK examples.

← Email drafts operations · Get started

Operation zoho.getemaildraft

Provider route: GET /crm/v8/{module}/{record}/__email_drafts/{draft}. Alter supplies the connection’s credentials and routing.

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"]["getEmailDraft"]>[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.getEmailDraft(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from 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.get_email_draft(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.modulestringRequired within parentMaximum length: 100
path.recordstringRequired within parentMaximum length: 100
Pattern: ^[0-9]+$
path.draftstringRequired within parentMaximum length: 256

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)objectAlternativeResponse containing a single email draft.
Additional keys: not allowed
$ (anyOf 1).__email_draftsarrayRequired within parentArray containing exactly one email draft object.
Maximum items: 1
$ (anyOf 1).__email_drafts[]objectEach itemEmail draft object with metadata, recipients, and attachments.
Additional keys: not allowed
$ (anyOf 1).__email_drafts[].$sharing_permissionstringOptionalSharing permission level for the requesting user.
Maximum length: 64
$ (anyOf 1).__email_drafts[].attachmentsJSONOptional
$ (anyOf 1).__email_drafts[].attachments (anyOf 1)arrayAlternativeAttachments included with the draft; null if none.
Maximum items: 50
$ (anyOf 1).__email_drafts[].attachments (anyOf 1)[]ModelEach itemExpand List Email Drafts for a Record — response body — email drafts, info email drafts item attachments Attachments included with the draft; null if none item
$ (anyOf 1).__email_drafts[].attachments (anyOf 2)nullAlternativeAttachments included with the draft; null if none.
Maximum items: 50
$ (anyOf 1).__email_drafts[].attachments (anyOf 2)[]ModelEach itemExpand List Email Drafts for a Record — response body — email drafts, info email drafts item attachments Attachments included with the draft; null if none item
$ (anyOf 1).__email_drafts[].bccJSONRequired within parent
$ (anyOf 1).__email_drafts[].bcc (anyOf 1)arrayAlternativeBCC recipients; null if none.
Maximum items: 100
$ (anyOf 1).__email_drafts[].bcc (anyOf 1)[]objectEach itemBCC recipient object.
Additional keys: not allowed
$ (anyOf 1).__email_drafts[].bcc (anyOf 1)[].emailstringRequired within parentBCC recipient email address.
Maximum length: 256
$ (anyOf 1).__email_drafts[].bcc (anyOf 1)[].user_nameJSONRequired within parent
$ (anyOf 1).__email_drafts[].bcc (anyOf 1)[].user_name (anyOf 1)stringAlternativeBCC recipient display name; null if not available.
Maximum length: 256
$ (anyOf 1).__email_drafts[].bcc (anyOf 1)[].user_name (anyOf 2)nullAlternativeBCC recipient display name; null if not available.
Maximum length: 256
$ (anyOf 1).__email_drafts[].bcc (anyOf 2)nullAlternativeBCC recipients; null if none.
Maximum items: 100
$ (anyOf 1).__email_drafts[].bcc (anyOf 2)[]objectEach itemBCC recipient object.
Additional keys: not allowed
$ (anyOf 1).__email_drafts[].bcc (anyOf 2)[].emailstringRequired within parentBCC recipient email address.
Maximum length: 256
$ (anyOf 1).__email_drafts[].bcc (anyOf 2)[].user_nameJSONRequired within parent
$ (anyOf 1).__email_drafts[].bcc (anyOf 2)[].user_name (anyOf 1)stringAlternativeBCC recipient display name; null if not available.
Maximum length: 256
$ (anyOf 1).__email_drafts[].bcc (anyOf 2)[].user_name (anyOf 2)nullAlternativeBCC recipient display name; null if not available.
Maximum length: 256
$ (anyOf 1).__email_drafts[].ccJSONRequired within parent
$ (anyOf 1).__email_drafts[].cc (anyOf 1)arrayAlternativeCC recipients; null if none.
Maximum items: 100
$ (anyOf 1).__email_drafts[].cc (anyOf 1)[]objectEach itemCC recipient object.
Additional keys: not allowed
$ (anyOf 1).__email_drafts[].cc (anyOf 1)[].emailstringRequired within parentCC recipient email address.
Maximum length: 256
$ (anyOf 1).__email_drafts[].cc (anyOf 1)[].user_nameJSONRequired within parent
$ (anyOf 1).__email_drafts[].cc (anyOf 1)[].user_name (anyOf 1)stringAlternativeCC recipient display name; null if not available.
Maximum length: 256
$ (anyOf 1).__email_drafts[].cc (anyOf 1)[].user_name (anyOf 2)nullAlternativeCC recipient display name; null if not available.
Maximum length: 256
$ (anyOf 1).__email_drafts[].cc (anyOf 2)nullAlternativeCC recipients; null if none.
Maximum items: 100
$ (anyOf 1).__email_drafts[].cc (anyOf 2)[]objectEach itemCC recipient object.
Additional keys: not allowed
$ (anyOf 1).__email_drafts[].cc (anyOf 2)[].emailstringRequired within parentCC recipient email address.
Maximum length: 256
$ (anyOf 1).__email_drafts[].cc (anyOf 2)[].user_nameJSONRequired within parent
$ (anyOf 1).__email_drafts[].cc (anyOf 2)[].user_name (anyOf 1)stringAlternativeCC recipient display name; null if not available.
Maximum length: 256
$ (anyOf 1).__email_drafts[].cc (anyOf 2)[].user_name (anyOf 2)nullAlternativeCC recipient display name; null if not available.
Maximum length: 256
$ (anyOf 1).__email_drafts[].contentJSONRequired within parent
$ (anyOf 1).__email_drafts[].content (anyOf 1)stringAlternativeEmail HTML body content; null if not set.
Maximum length: 200000
$ (anyOf 1).__email_drafts[].content (anyOf 2)nullAlternativeEmail HTML body content; null if not set.
Maximum length: 200000
$ (anyOf 1).__email_drafts[].created_timestringRequired within parentTimestamp when the draft was created (ISO 8601 format).
Format: date-time
$ (anyOf 1).__email_drafts[].fromstringRequired within parentSender email address.
Maximum length: 256
$ (anyOf 1).__email_drafts[].idstringRequired within parentUnique encrypted draft identifier.
Maximum length: 256
$ (anyOf 1).__email_drafts[].inventory_detailsJSONOptional
$ (anyOf 1).__email_drafts[].inventory_details (anyOf 1)ModelAlternativeExpand List Email Drafts for a Record — response body — __email_drafts, info / __email_drafts / item / inventory_details / paper_type: A4, US Letter, view type: portrait, landscape — shared_inventory-details_496ad47505d2
$ (anyOf 1).__email_drafts[].inventory_details (anyOf 2)ModelAlternativeExpand List Email Drafts for a Record — response body — __email_drafts, info / __email_drafts / item / inventory_details / paper_type: A4, US Letter, view type: portrait, landscape — shared_inventory-details_d1fe827e5270
$ (anyOf 1).__email_drafts[].linked_recordJSONOptional
$ (anyOf 1).__email_drafts[].linked_record (anyOf 1)ModelAlternativeExpand List Email Drafts for a Record — response body — email drafts, info email drafts item linked record id, module — shared_linked-record_dfa5af433a40
$ (anyOf 1).__email_drafts[].linked_record (anyOf 2)ModelAlternativeExpand List Email Drafts for a Record — response body — email drafts, info email drafts item linked record id, module — shared_linked-record_70e659738c7a
$ (anyOf 1).__email_drafts[].modified_timestringRequired within parentTimestamp when the draft was last modified (ISO 8601 format).
Format: date-time
$ (anyOf 1).__email_drafts[].ownerobjectRequired within parentOwner who created the draft.
Additional keys: not allowed
$ (anyOf 1).__email_drafts[].owner.idstringRequired within parentOwner user identifier. Use the [Users API](users.yaml#$.paths./users/bulk.get) to retrieve user IDs.

Maximum length: 64
$ (anyOf 1).__email_drafts[].owner.namestringRequired within parentOwner display name.
Maximum length: 256
$ (anyOf 1).__email_drafts[].reply_toJSONRequired within parent
$ (anyOf 1).__email_drafts[].reply_to (anyOf 1)stringAlternativeReply-to email address; null if not set.
Maximum length: 256
$ (anyOf 1).__email_drafts[].reply_to (anyOf 2)nullAlternativeReply-to email address; null if not set.
Maximum length: 256
$ (anyOf 1).__email_drafts[].rich_textbooleanRequired within parenttrue when HTML editor was used; false for plain text.
$ (anyOf 1).__email_drafts[].schedule_detailsJSONOptional
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 1)objectAlternativeScheduling information; null if not scheduled.
Additional keys: not allowed
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 1).sourcestringOptionalSource of the schedule decision.
Known values: ecOneHourAhead, upTime, ecSchduleBestTime, ecUpComing, ecSchduleTime
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 1).timestringRequired within parentScheduled send time (ISO 8601 format).
Format: date-time
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 1).timezoneJSONOptional
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 1).timezone (anyOf 1)stringAlternativeTimezone identifier or null.
Maximum length: 100
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 1).timezone (anyOf 2)nullAlternativeTimezone identifier or null.
Maximum length: 100
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 2)nullAlternativeScheduling information; null if not scheduled.
Additional keys: not allowed
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 2).sourcestringOptionalSource of the schedule decision.
Known values: ecOneHourAhead, upTime, ecSchduleBestTime, ecUpComing, ecSchduleTime
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 2).timestringRequired within parentScheduled send time (ISO 8601 format).
Format: date-time
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 2).timezoneJSONOptional
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 2).timezone (anyOf 1)stringAlternativeTimezone identifier or null.
Maximum length: 100
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 2).timezone (anyOf 2)nullAlternativeTimezone identifier or null.
Maximum length: 100
$ (anyOf 1).__email_drafts[].sourcestringOptionalSource identifier string stored at draft creation time.
Maximum length: 256
$ (anyOf 1).__email_drafts[].subjectJSONRequired within parent
$ (anyOf 1).__email_drafts[].subject (anyOf 1)stringAlternativeEmail subject; null if not set.
Maximum length: 512
$ (anyOf 1).__email_drafts[].subject (anyOf 2)nullAlternativeEmail subject; null if not set.
Maximum length: 512
$ (anyOf 1).__email_drafts[].summaryJSONRequired within parent
$ (anyOf 1).__email_drafts[].summary (anyOf 1)stringAlternativePlain text preview of the draft body; null if empty.
Maximum length: 500
$ (anyOf 1).__email_drafts[].summary (anyOf 2)nullAlternativePlain text preview of the draft body; null if empty.
Maximum length: 500
$ (anyOf 1).__email_drafts[].toJSONRequired within parent
$ (anyOf 1).__email_drafts[].to (anyOf 1)arrayAlternativePrimary recipients; null if none.
Maximum items: 100
$ (anyOf 1).__email_drafts[].to (anyOf 1)[]objectEach itemRecipient object.
Additional keys: not allowed
$ (anyOf 1).__email_drafts[].to (anyOf 1)[].emailstringRequired within parentRecipient email address.
Maximum length: 256
$ (anyOf 1).__email_drafts[].to (anyOf 1)[].user_nameJSONRequired within parent
$ (anyOf 1).__email_drafts[].to (anyOf 1)[].user_name (anyOf 1)stringAlternativeRecipient display name; null if not available.
Maximum length: 256
$ (anyOf 1).__email_drafts[].to (anyOf 1)[].user_name (anyOf 2)nullAlternativeRecipient display name; null if not available.
Maximum length: 256
$ (anyOf 1).__email_drafts[].to (anyOf 2)nullAlternativePrimary recipients; null if none.
Maximum items: 100
$ (anyOf 1).__email_drafts[].to (anyOf 2)[]objectEach itemRecipient object.
Additional keys: not allowed
$ (anyOf 1).__email_drafts[].to (anyOf 2)[].emailstringRequired within parentRecipient email address.
Maximum length: 256
$ (anyOf 1).__email_drafts[].to (anyOf 2)[].user_nameJSONRequired within parent
$ (anyOf 1).__email_drafts[].to (anyOf 2)[].user_name (anyOf 1)stringAlternativeRecipient display name; null if not available.
Maximum length: 256
$ (anyOf 1).__email_drafts[].to (anyOf 2)[].user_name (anyOf 2)nullAlternativeRecipient display name; null if not available.
Maximum length: 256
$ (anyOf 2)nullAlternative

Referenced models: List Email Drafts for a Record — response body — email drafts, info email drafts item attachments Attachments included with the draft; null if none item, List Email Drafts for a Record — response body — __email_drafts, info / __email_drafts / item / inventory_details / paper_type: A4, US Letter, view type: portrait, landscape — shared_inventory-details_496ad47505d2, List Email Drafts for a Record — response body — __email_drafts, info / __email_drafts / item / inventory_details / paper_type: A4, US Letter, view type: portrait, landscape — shared_inventory-details_d1fe827e5270, List Email Drafts for a Record — response body — email drafts, info email drafts item linked record id, module — shared_linked-record_70e659738c7a, List Email Drafts for a Record — response body — email drafts, info email drafts item linked record id, module — shared_linked-record_dfa5af433a40

List Email Drafts for a Record — response body — email drafts, info email drafts item attachments Attachments included with the draft; null if none item
FieldTypePresenceDescription and constraints
$objectRootAttachment metadata.
Additional keys: not allowed
file_namestringRequired within parentOriginal file name.
Maximum length: 512
file_sizestringRequired within parentFile size in bytes as a numeric string.
Maximum length: 20
idstringRequired within parentEncrypted attachment/file identifier.
Maximum length: 256
service_namestringRequired within parentStorage service name.
Maximum length: 100
List Email Drafts for a Record — response body — __email_drafts, info / __email_drafts / item / inventory_details / paper_type: A4, US Letter, view type: portrait, landscape — shared_inventory-details_496ad47505d2
FieldTypePresenceDescription and constraints
$objectRootInventory email details; null if not an inventory draft.
Additional keys: not allowed
inventory_templateobjectRequired within parentInventory template details.
Additional keys: not allowed
inventory_template.idstringRequired within parentInventory template identifier.
Maximum length: 64
inventory_template.namestringRequired within parentInventory template name.
Maximum length: 256
paper_typestringRequired within parentPaper type for rendered inventory.
Known values: A4, USLetter
recordobjectOptionalCRM record associated with this inventory draft.
Additional keys: not allowed
record.idstringRequired within parentCRM record identifier.
Maximum length: 64
record.namestringRequired within parentCRM record display name.
Maximum length: 256
view_typestringRequired within parentLayout/view type for the inventory.
Known values: portrait, landscape
List Email Drafts for a Record — response body — __email_drafts, info / __email_drafts / item / inventory_details / paper_type: A4, US Letter, view type: portrait, landscape — shared_inventory-details_d1fe827e5270
FieldTypePresenceDescription and constraints
$nullRootInventory email details; null if not an inventory draft.
Additional keys: not allowed
inventory_templateobjectRequired within parentInventory template details.
Additional keys: not allowed
inventory_template.idstringRequired within parentInventory template identifier.
Maximum length: 64
inventory_template.namestringRequired within parentInventory template name.
Maximum length: 256
paper_typestringRequired within parentPaper type for rendered inventory.
Known values: A4, USLetter
recordobjectOptionalCRM record associated with this inventory draft.
Additional keys: not allowed
record.idstringRequired within parentCRM record identifier.
Maximum length: 64
record.namestringRequired within parentCRM record display name.
Maximum length: 256
view_typestringRequired within parentLayout/view type for the inventory.
Known values: portrait, landscape
List Email Drafts for a Record — response body — email drafts, info email drafts item linked record id, module — shared_linked-record_70e659738c7a
FieldTypePresenceDescription and constraints
$nullRootCRM record linked to this draft; null if not linked.
Additional keys: not allowed
idstringRequired within parentLinked CRM record identifier.
Maximum length: 64
moduleobjectRequired within parentModule of the linked record.
Additional keys: not allowed
module.api_namestringRequired within parentModule API name.
Maximum length: 100
module.idstringOptionalModule tab identifier.
Maximum length: 64
List Email Drafts for a Record — response body — email drafts, info email drafts item linked record id, module — shared_linked-record_dfa5af433a40
FieldTypePresenceDescription and constraints
$objectRootCRM record linked to this draft; null if not linked.
Additional keys: not allowed
idstringRequired within parentLinked CRM record identifier.
Maximum length: 64
moduleobjectRequired within parentModule of the linked record.
Additional keys: not allowed
module.api_namestringRequired within parentModule API name.
Maximum length: 100
module.idstringOptionalModule tab identifier.
Maximum length: 64

SDK function policy ID: zoho.getemaildraft. Catalog operation: getEmailDraft. 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.

No-content response statuses: [204]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.