> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Zoho CRM: README

> Get email drafts for a record. Includes SDK V2 and CLI requests, input constraints, response fields, and Deepline credit cost.

Get email drafts for a record.

<Info>
  Tool ID: `zoho_crm_email_drafts_get_email_drafts`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'zoho_crm_email_drafts_get_email_drafts',
  {
    "module": "example",
    "record": "example"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={null}
deepline tools execute zoho_crm_email_drafts_get_email_drafts --input '{
  "module": "example",
  "record": "example"
}' --json
```

## Example response

The static output schema is not detailed enough to generate a reliable example. Use `deepline tools get zoho_crm_email_drafts_get_email_drafts --json` for the complete live contract.

## Input reference

Retrieves the list of email drafts associated with the specified record in the given module.

| Name               | Type           | Required | Default | Details                                                              |
| ------------------ | -------------- | -------- | ------- | -------------------------------------------------------------------- |
| `payload.module`   | `string`       | Yes      | —       | module of the record Maximum length: 100.                            |
| `payload.record`   | `string`       | Yes      | —       | Entity id of the record Maximum length: 100.                         |
| `payload.page`     | `1 \| 2`       | No       | —       | Page number for pagination Allowed: `1`, `2`. Format: `int32`.       |
| `payload.per_page` | `1 \| 5 \| 10` | No       | —       | Number of records per page Allowed: `1`, `5`, `10`. Format: `int32`. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Retrieves the list of email drafts associated with the specified record in the given module.",
    "properties": {
      "module": {
        "type": "string",
        "description": "module of the record",
        "maxLength": 100
      },
      "record": {
        "type": "string",
        "description": "Entity id of the record",
        "maxLength": 100
      },
      "page": {
        "type": "integer",
        "description": "Page number for pagination",
        "enum": [
          1,
          2
        ],
        "format": "int32"
      },
      "per_page": {
        "type": "integer",
        "description": "Number of records per page",
        "enum": [
          1,
          5,
          10
        ],
        "format": "int32"
      }
    },
    "required": [
      "module",
      "record"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name                                                                     | Type                                                                                     | Required | Default | Details                                                                                                                   |
| ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------- |
| `result.data`                                                            | `object`                                                                                 | Yes      | —       | Response containing the list of email drafts and additional info (e.g., pagination).                                      |
| `result.data.__email_drafts`                                             | `array`                                                                                  | Yes      | —       | List of email draft objects. Maximum items: 100.                                                                          |
| `result.data.__email_drafts[].id`                                        | `string`                                                                                 | Yes      | —       | Unique draft identifier. Maximum length: 64.                                                                              |
| `result.data.__email_drafts[].modified_time`                             | `string`                                                                                 | Yes      | —       | Timestamp when the draft was last modified. Format: `date-time`.                                                          |
| `result.data.__email_drafts[].created_time`                              | `string`                                                                                 | Yes      | —       | Timestamp when the draft was created. Format: `date-time`.                                                                |
| `result.data.__email_drafts[].from`                                      | `string`                                                                                 | Yes      | —       | Sender email address. Maximum length: 100. Pattern: `^[a-z]&#123;7&#125;@zoho\.com$`.                                     |
| `result.data.__email_drafts[].to`                                        | `array`                                                                                  | Yes      | —       | Primary recipients for the draft. Maximum items: 100.                                                                     |
| `result.data.__email_drafts[].to[].user_name`                            | `string`                                                                                 | Yes      | —       | Recipient display name. Maximum length: 100.                                                                              |
| `result.data.__email_drafts[].to[].email`                                | `string`                                                                                 | Yes      | —       | Recipient email address. Maximum length: 100. Pattern: `^[a-z]&#123;7&#125;@zoho\.com$`.                                  |
| `result.data.__email_drafts[].reply_to`                                  | `string \| null`                                                                         | Yes      | —       | Reply-to email address. Maximum length: 100. Pattern: `^[a-z]&#123;7&#125;@zoho\.com$`.                                   |
| `result.data.__email_drafts[].cc`                                        | `array`                                                                                  | Yes      | —       | CC recipients for the draft. Maximum items: 100.                                                                          |
| `result.data.__email_drafts[].cc[].user_name`                            | `string`                                                                                 | Yes      | —       | CC recipient display name. Maximum length: 100.                                                                           |
| `result.data.__email_drafts[].cc[].email`                                | `string`                                                                                 | Yes      | —       | CC recipient email address. Maximum length: 100. Pattern: `^[a-z]&#123;7&#125;@zoho\.com$`.                               |
| `result.data.__email_drafts[].bcc`                                       | `array`                                                                                  | Yes      | —       | BCC recipients for the draft. Maximum items: 100.                                                                         |
| `result.data.__email_drafts[].bcc[].user_name`                           | `string`                                                                                 | Yes      | —       | BCC recipient display name. Maximum length: 100.                                                                          |
| `result.data.__email_drafts[].bcc[].email`                               | `string`                                                                                 | Yes      | —       | BCC recipient email address. Maximum length: 100. Pattern: `^[a-z]&#123;7&#125;@zoho\.com$`.                              |
| `result.data.__email_drafts[].$sharing_permission`                       | `string`                                                                                 | Yes      | —       | Sharing permission level for the draft. Maximum length: 64.                                                               |
| `result.data.__email_drafts[].inventory_details`                         | `object`                                                                                 | Yes      | —       | Inventory related details for the draft.                                                                                  |
| `result.data.__email_drafts[].inventory_details.inventory_template`      | `object`                                                                                 | Yes      | —       | Inventory template details.                                                                                               |
| `result.data.__email_drafts[].inventory_details.inventory_template.name` | `string`                                                                                 | Yes      | —       | Inventory template name. Maximum length: 100.                                                                             |
| `result.data.__email_drafts[].inventory_details.inventory_template.id`   | `string`                                                                                 | Yes      | —       | Inventory template identifier. Maximum length: 100.                                                                       |
| `result.data.__email_drafts[].inventory_details.paper_type`              | `"A4" \| "USLetter"`                                                                     | Yes      | —       | Paper type for rendered inventory. Allowed: `A4`, `USLetter`.                                                             |
| `result.data.__email_drafts[].inventory_details.view_type`               | `"portrait" \| "landscape"`                                                              | Yes      | —       | Layout/view type for the inventory. Allowed: `portrait`, `landscape`.                                                     |
| `result.data.__email_drafts[].attachments`                               | `array`                                                                                  | Yes      | —       | Attachments included with the draft. Maximum items: 10.                                                                   |
| `result.data.__email_drafts[].attachments[].service_name`                | `string`                                                                                 | Yes      | —       | Name of the storage/service holding the file. Maximum length: 100.                                                        |
| `result.data.__email_drafts[].attachments[].file_size`                   | `string`                                                                                 | Yes      | —       | File size in bytes (string). Maximum length: 20. Pattern: `^[0-9]+$`.                                                     |
| `result.data.__email_drafts[].attachments[].id`                          | `string`                                                                                 | Yes      | —       | Attachment identifier. Maximum length: 64.                                                                                |
| `result.data.__email_drafts[].attachments[].file_name`                   | `string`                                                                                 | Yes      | —       | Original file name. Maximum length: 255.                                                                                  |
| `result.data.__email_drafts[].schedule_details`                          | `object`                                                                                 | Yes      | —       | Scheduling information for when the draft should be sent.                                                                 |
| `result.data.__email_drafts[].schedule_details.time`                     | `string`                                                                                 | Yes      | —       | Scheduled send time. Format: `date-time`.                                                                                 |
| `result.data.__email_drafts[].schedule_details.timezone`                 | `object \| null`                                                                         | Yes      | —       | Timezone information or null.                                                                                             |
| `result.data.__email_drafts[].schedule_details.source`                   | `"ecOneHourAhead" \| "upTime" \| "ecSchduleBestTime" \| "ecUpComing" \| "ecSchduleTime"` | Yes      | —       | Source of the schedule decision. Allowed: `ecOneHourAhead`, `upTime`, `ecSchduleBestTime`, `ecUpComing`, `ecSchduleTime`. |
| `result.data.__email_drafts[].rich_text`                                 | `boolean`                                                                                | Yes      | —       | Indicates whether the content is rich text.                                                                               |
| `result.data.__email_drafts[].subject`                                   | `string \| null`                                                                         | Yes      | —       | Email subject. Maximum length: 512.                                                                                       |
| `result.data.__email_drafts[].content`                                   | `string \| null`                                                                         | Yes      | —       | Email content/HTML/plain text.                                                                                            |
| `result.data.__email_drafts[].summary`                                   | `string \| null`                                                                         | Yes      | —       | Short summary or preview of the draft.                                                                                    |
| `result.data.__email_drafts[].owner`                                     | `object`                                                                                 | Yes      | —       | Owner/user who created the draft.                                                                                         |
| `result.data.__email_drafts[].owner.name`                                | `string`                                                                                 | Yes      | —       | Owner display name. Maximum length: 100.                                                                                  |
| `result.data.__email_drafts[].owner.id`                                  | `string`                                                                                 | Yes      | —       | Owner identifier. Maximum length: 64.                                                                                     |
| `result.data.info`                                                       | `record`                                                                                 | Yes      | —       | Additional response info (pagination, cursors, etc.).                                                                     |
| `result.meta`                                                            | `object`                                                                                 | No       | —       | Additional response metadata (status, paging).                                                                            |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Response containing the list of email drafts and additional info (e.g., pagination).",
        "properties": {
          "__email_drafts": {
            "type": "array",
            "description": "List of email draft objects.",
            "maxItems": 100,
            "items": {
              "type": "object",
              "description": "Email draft object with metadata, recipients and attachments.",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique draft identifier.",
                  "maxLength": 64
                },
                "modified_time": {
                  "type": "string",
                  "description": "Timestamp when the draft was last modified.",
                  "format": "date-time"
                },
                "created_time": {
                  "type": "string",
                  "description": "Timestamp when the draft was created.",
                  "format": "date-time"
                },
                "from": {
                  "type": "string",
                  "description": "Sender email address.",
                  "maxLength": 100,
                  "pattern": "^[a-z]{7}@zoho\\.com$"
                },
                "to": {
                  "type": "array",
                  "description": "Primary recipients for the draft.",
                  "maxItems": 100,
                  "items": {
                    "type": "object",
                    "description": "Recipient object.",
                    "properties": {
                      "user_name": {
                        "type": "string",
                        "description": "Recipient display name.",
                        "maxLength": 100
                      },
                      "email": {
                        "type": "string",
                        "description": "Recipient email address.",
                        "maxLength": 100,
                        "pattern": "^[a-z]{7}@zoho\\.com$"
                      }
                    },
                    "required": [
                      "user_name",
                      "email"
                    ],
                    "additionalProperties": false
                  }
                },
                "reply_to": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Reply-to email address.",
                  "maxLength": 100,
                  "pattern": "^[a-z]{7}@zoho\\.com$"
                },
                "cc": {
                  "type": "array",
                  "description": "CC recipients for the draft.",
                  "maxItems": 100,
                  "items": {
                    "type": "object",
                    "description": "CC recipient object.",
                    "properties": {
                      "user_name": {
                        "type": "string",
                        "description": "CC recipient display name.",
                        "maxLength": 100
                      },
                      "email": {
                        "type": "string",
                        "description": "CC recipient email address.",
                        "maxLength": 100,
                        "pattern": "^[a-z]{7}@zoho\\.com$"
                      }
                    },
                    "required": [
                      "user_name",
                      "email"
                    ],
                    "additionalProperties": false
                  }
                },
                "bcc": {
                  "type": "array",
                  "description": "BCC recipients for the draft.",
                  "maxItems": 100,
                  "items": {
                    "type": "object",
                    "description": "BCC recipient object.",
                    "properties": {
                      "user_name": {
                        "type": "string",
                        "description": "BCC recipient display name.",
                        "maxLength": 100
                      },
                      "email": {
                        "type": "string",
                        "description": "BCC recipient email address.",
                        "maxLength": 100,
                        "pattern": "^[a-z]{7}@zoho\\.com$"
                      }
                    },
                    "required": [
                      "user_name",
                      "email"
                    ],
                    "additionalProperties": false
                  }
                },
                "$sharing_permission": {
                  "type": "string",
                  "description": "Sharing permission level for the draft.",
                  "maxLength": 64
                },
                "inventory_details": {
                  "type": "object",
                  "description": "Inventory related details for the draft.",
                  "properties": {
                    "inventory_template": {
                      "type": "object",
                      "description": "Inventory template details.",
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "Inventory template name.",
                          "maxLength": 100
                        },
                        "id": {
                          "type": "string",
                          "description": "Inventory template identifier.",
                          "maxLength": 100
                        }
                      },
                      "required": [
                        "name",
                        "id"
                      ],
                      "additionalProperties": false
                    },
                    "paper_type": {
                      "type": "string",
                      "description": "Paper type for rendered inventory.",
                      "enum": [
                        "A4",
                        "USLetter"
                      ]
                    },
                    "view_type": {
                      "type": "string",
                      "description": "Layout/view type for the inventory.",
                      "enum": [
                        "portrait",
                        "landscape"
                      ]
                    }
                  },
                  "required": [
                    "inventory_template",
                    "paper_type",
                    "view_type"
                  ],
                  "additionalProperties": false
                },
                "attachments": {
                  "type": "array",
                  "description": "Attachments included with the draft.",
                  "maxItems": 10,
                  "items": {
                    "type": "object",
                    "description": "Attachment metadata.",
                    "properties": {
                      "service_name": {
                        "type": "string",
                        "description": "Name of the storage/service holding the file.",
                        "maxLength": 100
                      },
                      "file_size": {
                        "type": "string",
                        "description": "File size in bytes (string).",
                        "maxLength": 20,
                        "pattern": "^[0-9]+$"
                      },
                      "id": {
                        "type": "string",
                        "description": "Attachment identifier.",
                        "maxLength": 64
                      },
                      "file_name": {
                        "type": "string",
                        "description": "Original file name.",
                        "maxLength": 255
                      }
                    },
                    "required": [
                      "service_name",
                      "file_size",
                      "id",
                      "file_name"
                    ],
                    "additionalProperties": false
                  }
                },
                "schedule_details": {
                  "type": "object",
                  "description": "Scheduling information for when the draft should be sent.",
                  "properties": {
                    "time": {
                      "type": "string",
                      "description": "Scheduled send time.",
                      "format": "date-time"
                    },
                    "timezone": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Timezone information or null."
                    },
                    "source": {
                      "type": "string",
                      "description": "Source of the schedule decision.",
                      "enum": [
                        "ecOneHourAhead",
                        "upTime",
                        "ecSchduleBestTime",
                        "ecUpComing",
                        "ecSchduleTime"
                      ]
                    }
                  },
                  "required": [
                    "time",
                    "timezone",
                    "source"
                  ],
                  "additionalProperties": false
                },
                "rich_text": {
                  "type": "boolean",
                  "description": "Indicates whether the content is rich text."
                },
                "subject": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Email subject.",
                  "maxLength": 512
                },
                "content": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Email content/HTML/plain text."
                },
                "summary": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Short summary or preview of the draft."
                },
                "owner": {
                  "type": "object",
                  "description": "Owner/user who created the draft.",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Owner display name.",
                      "maxLength": 100
                    },
                    "id": {
                      "type": "string",
                      "description": "Owner identifier.",
                      "maxLength": 64
                    }
                  },
                  "required": [
                    "name",
                    "id"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "id",
                "modified_time",
                "created_time",
                "from",
                "to",
                "reply_to",
                "cc",
                "bcc",
                "$sharing_permission",
                "inventory_details",
                "attachments",
                "schedule_details",
                "rich_text",
                "subject",
                "content",
                "summary",
                "owner"
              ],
              "additionalProperties": false
            }
          },
          "info": {
            "type": "object",
            "description": "Additional response info (pagination, cursors, etc.).",
            "additionalProperties": false
          }
        },
        "required": [
          "__email_drafts",
          "info"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)
