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.
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"]["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 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.get_email_draft(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 |
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 containing a single email draft. Additional keys: not allowed |
$ (anyOf 1).__email_drafts | array | Required within parent | Array containing exactly one email draft object. Maximum items: 1 |
$ (anyOf 1).__email_drafts[] | object | Each item | Email draft object with metadata, recipients, and attachments. Additional keys: not allowed |
$ (anyOf 1).__email_drafts[].$sharing_permission | string | Optional | Sharing permission level for the requesting user. Maximum length: 64 |
$ (anyOf 1).__email_drafts[].attachments | JSON | Optional | |
$ (anyOf 1).__email_drafts[].attachments (anyOf 1) | array | Alternative | Attachments included with the draft; null if none. Maximum items: 50 |
$ (anyOf 1).__email_drafts[].attachments (anyOf 1)[] | Model | Each item | Expand 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) | null | Alternative | Attachments included with the draft; null if none. Maximum items: 50 |
$ (anyOf 1).__email_drafts[].attachments (anyOf 2)[] | Model | Each item | Expand 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[].bcc | JSON | Required within parent | |
$ (anyOf 1).__email_drafts[].bcc (anyOf 1) | array | Alternative | BCC recipients; null if none. Maximum items: 100 |
$ (anyOf 1).__email_drafts[].bcc (anyOf 1)[] | object | Each item | BCC recipient object. Additional keys: not allowed |
$ (anyOf 1).__email_drafts[].bcc (anyOf 1)[].email | string | Required within parent | BCC recipient email address. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].bcc (anyOf 1)[].user_name | JSON | Required within parent | |
$ (anyOf 1).__email_drafts[].bcc (anyOf 1)[].user_name (anyOf 1) | string | Alternative | BCC recipient display name; null if not available. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].bcc (anyOf 1)[].user_name (anyOf 2) | null | Alternative | BCC recipient display name; null if not available. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].bcc (anyOf 2) | null | Alternative | BCC recipients; null if none. Maximum items: 100 |
$ (anyOf 1).__email_drafts[].bcc (anyOf 2)[] | object | Each item | BCC recipient object. Additional keys: not allowed |
$ (anyOf 1).__email_drafts[].bcc (anyOf 2)[].email | string | Required within parent | BCC recipient email address. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].bcc (anyOf 2)[].user_name | JSON | Required within parent | |
$ (anyOf 1).__email_drafts[].bcc (anyOf 2)[].user_name (anyOf 1) | string | Alternative | BCC recipient display name; null if not available. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].bcc (anyOf 2)[].user_name (anyOf 2) | null | Alternative | BCC recipient display name; null if not available. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].cc | JSON | Required within parent | |
$ (anyOf 1).__email_drafts[].cc (anyOf 1) | array | Alternative | CC recipients; null if none. Maximum items: 100 |
$ (anyOf 1).__email_drafts[].cc (anyOf 1)[] | object | Each item | CC recipient object. Additional keys: not allowed |
$ (anyOf 1).__email_drafts[].cc (anyOf 1)[].email | string | Required within parent | CC recipient email address. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].cc (anyOf 1)[].user_name | JSON | Required within parent | |
$ (anyOf 1).__email_drafts[].cc (anyOf 1)[].user_name (anyOf 1) | string | Alternative | CC recipient display name; null if not available. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].cc (anyOf 1)[].user_name (anyOf 2) | null | Alternative | CC recipient display name; null if not available. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].cc (anyOf 2) | null | Alternative | CC recipients; null if none. Maximum items: 100 |
$ (anyOf 1).__email_drafts[].cc (anyOf 2)[] | object | Each item | CC recipient object. Additional keys: not allowed |
$ (anyOf 1).__email_drafts[].cc (anyOf 2)[].email | string | Required within parent | CC recipient email address. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].cc (anyOf 2)[].user_name | JSON | Required within parent | |
$ (anyOf 1).__email_drafts[].cc (anyOf 2)[].user_name (anyOf 1) | string | Alternative | CC recipient display name; null if not available. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].cc (anyOf 2)[].user_name (anyOf 2) | null | Alternative | CC recipient display name; null if not available. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].content | JSON | Required within parent | |
$ (anyOf 1).__email_drafts[].content (anyOf 1) | string | Alternative | Email HTML body content; null if not set. Maximum length: 200000 |
$ (anyOf 1).__email_drafts[].content (anyOf 2) | null | Alternative | Email HTML body content; null if not set. Maximum length: 200000 |
$ (anyOf 1).__email_drafts[].created_time | string | Required within parent | Timestamp when the draft was created (ISO 8601 format). Format: date-time |
$ (anyOf 1).__email_drafts[].from | string | Required within parent | Sender email address. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].id | string | Required within parent | Unique encrypted draft identifier. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].inventory_details | JSON | Optional | |
$ (anyOf 1).__email_drafts[].inventory_details (anyOf 1) | Model | Alternative | Expand 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) | Model | Alternative | Expand 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_record | JSON | Optional | |
$ (anyOf 1).__email_drafts[].linked_record (anyOf 1) | Model | Alternative | Expand 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) | Model | Alternative | Expand 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_time | string | Required within parent | Timestamp when the draft was last modified (ISO 8601 format). Format: date-time |
$ (anyOf 1).__email_drafts[].owner | object | Required within parent | Owner who created the draft. Additional keys: not allowed |
$ (anyOf 1).__email_drafts[].owner.id | string | Required within parent | Owner user identifier. Use the [Users API](users.yaml#$.paths./users/bulk.get) to retrieve user IDs. Maximum length: 64 |
$ (anyOf 1).__email_drafts[].owner.name | string | Required within parent | Owner display name. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].reply_to | JSON | Required within parent | |
$ (anyOf 1).__email_drafts[].reply_to (anyOf 1) | string | Alternative | Reply-to email address; null if not set. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].reply_to (anyOf 2) | null | Alternative | Reply-to email address; null if not set. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].rich_text | boolean | Required within parent | true when HTML editor was used; false for plain text. |
$ (anyOf 1).__email_drafts[].schedule_details | JSON | Optional | |
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 1) | object | Alternative | Scheduling information; null if not scheduled. Additional keys: not allowed |
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 1).source | string | Optional | Source of the schedule decision. Known values: ecOneHourAhead, upTime, ecSchduleBestTime, ecUpComing, ecSchduleTime |
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 1).time | string | Required within parent | Scheduled send time (ISO 8601 format). Format: date-time |
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 1).timezone | JSON | Optional | |
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 1).timezone (anyOf 1) | string | Alternative | Timezone identifier or null. Maximum length: 100 |
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 1).timezone (anyOf 2) | null | Alternative | Timezone identifier or null. Maximum length: 100 |
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 2) | null | Alternative | Scheduling information; null if not scheduled. Additional keys: not allowed |
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 2).source | string | Optional | Source of the schedule decision. Known values: ecOneHourAhead, upTime, ecSchduleBestTime, ecUpComing, ecSchduleTime |
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 2).time | string | Required within parent | Scheduled send time (ISO 8601 format). Format: date-time |
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 2).timezone | JSON | Optional | |
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 2).timezone (anyOf 1) | string | Alternative | Timezone identifier or null. Maximum length: 100 |
$ (anyOf 1).__email_drafts[].schedule_details (anyOf 2).timezone (anyOf 2) | null | Alternative | Timezone identifier or null. Maximum length: 100 |
$ (anyOf 1).__email_drafts[].source | string | Optional | Source identifier string stored at draft creation time. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].subject | JSON | Required within parent | |
$ (anyOf 1).__email_drafts[].subject (anyOf 1) | string | Alternative | Email subject; null if not set. Maximum length: 512 |
$ (anyOf 1).__email_drafts[].subject (anyOf 2) | null | Alternative | Email subject; null if not set. Maximum length: 512 |
$ (anyOf 1).__email_drafts[].summary | JSON | Required within parent | |
$ (anyOf 1).__email_drafts[].summary (anyOf 1) | string | Alternative | Plain text preview of the draft body; null if empty. Maximum length: 500 |
$ (anyOf 1).__email_drafts[].summary (anyOf 2) | null | Alternative | Plain text preview of the draft body; null if empty. Maximum length: 500 |
$ (anyOf 1).__email_drafts[].to | JSON | Required within parent | |
$ (anyOf 1).__email_drafts[].to (anyOf 1) | array | Alternative | Primary recipients; null if none. Maximum items: 100 |
$ (anyOf 1).__email_drafts[].to (anyOf 1)[] | object | Each item | Recipient object. Additional keys: not allowed |
$ (anyOf 1).__email_drafts[].to (anyOf 1)[].email | string | Required within parent | Recipient email address. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].to (anyOf 1)[].user_name | JSON | Required within parent | |
$ (anyOf 1).__email_drafts[].to (anyOf 1)[].user_name (anyOf 1) | string | Alternative | Recipient display name; null if not available. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].to (anyOf 1)[].user_name (anyOf 2) | null | Alternative | Recipient display name; null if not available. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].to (anyOf 2) | null | Alternative | Primary recipients; null if none. Maximum items: 100 |
$ (anyOf 1).__email_drafts[].to (anyOf 2)[] | object | Each item | Recipient object. Additional keys: not allowed |
$ (anyOf 1).__email_drafts[].to (anyOf 2)[].email | string | Required within parent | Recipient email address. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].to (anyOf 2)[].user_name | JSON | Required within parent | |
$ (anyOf 1).__email_drafts[].to (anyOf 2)[].user_name (anyOf 1) | string | Alternative | Recipient display name; null if not available. Maximum length: 256 |
$ (anyOf 1).__email_drafts[].to (anyOf 2)[].user_name (anyOf 2) | null | Alternative | Recipient display name; null if not available. Maximum length: 256 |
$ (anyOf 2) | null | Alternative |
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
Schemas
Section titled “Schemas”List Email Drafts for a Record — response body — email drafts, info email drafts item attachments Attachments included with the draft; null if none item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Attachment metadata. Additional keys: not allowed |
file_name | string | Required within parent | Original file name. Maximum length: 512 |
file_size | string | Required within parent | File size in bytes as a numeric string. Maximum length: 20 |
id | string | Required within parent | Encrypted attachment/file identifier. Maximum length: 256 |
service_name | string | Required within parent | Storage 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Inventory email details; null if not an inventory draft. Additional keys: not allowed |
inventory_template | object | Required within parent | Inventory template details. Additional keys: not allowed |
inventory_template.id | string | Required within parent | Inventory template identifier. Maximum length: 64 |
inventory_template.name | string | Required within parent | Inventory template name. Maximum length: 256 |
paper_type | string | Required within parent | Paper type for rendered inventory. Known values: A4, USLetter |
record | object | Optional | CRM record associated with this inventory draft. Additional keys: not allowed |
record.id | string | Required within parent | CRM record identifier. Maximum length: 64 |
record.name | string | Required within parent | CRM record display name. Maximum length: 256 |
view_type | string | Required within parent | Layout/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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | null | Root | Inventory email details; null if not an inventory draft. Additional keys: not allowed |
inventory_template | object | Required within parent | Inventory template details. Additional keys: not allowed |
inventory_template.id | string | Required within parent | Inventory template identifier. Maximum length: 64 |
inventory_template.name | string | Required within parent | Inventory template name. Maximum length: 256 |
paper_type | string | Required within parent | Paper type for rendered inventory. Known values: A4, USLetter |
record | object | Optional | CRM record associated with this inventory draft. Additional keys: not allowed |
record.id | string | Required within parent | CRM record identifier. Maximum length: 64 |
record.name | string | Required within parent | CRM record display name. Maximum length: 256 |
view_type | string | Required within parent | Layout/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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | null | Root | CRM record linked to this draft; null if not linked. Additional keys: not allowed |
id | string | Required within parent | Linked CRM record identifier. Maximum length: 64 |
module | object | Required within parent | Module of the linked record. Additional keys: not allowed |
module.api_name | string | Required within parent | Module API name. Maximum length: 100 |
module.id | string | Optional | Module 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | CRM record linked to this draft; null if not linked. Additional keys: not allowed |
id | string | Required within parent | Linked CRM record identifier. Maximum length: 64 |
module | object | Required within parent | Module of the linked record. Additional keys: not allowed |
module.api_name | string | Required within parent | Module API name. Maximum length: 100 |
module.id | string | Optional | Module tab identifier. Maximum length: 64 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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]