# Zoho Mail

> Business email. Send, reply to and draft emails, search and read them, and organise them with folders, labels and flags.

App · Email · 20 actions. Web page: https://docs.lodol.com/docs/integrations/zoho-mail

## Actions

### Apply label

Add one or more labels to emails.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Email IDs (`message_ids`, list, required): One or more emails' messageId values, from 'List emails' or 'Search emails'. Separate several with commas.
- Labels (`label_ids`, list, required): The labels to add.

**Outputs**: The labels were applied.

- `labelIds` (list): The labels.
- `messageIds` (list): The emails changed.
- `updated` (true/false): Always true.

**Example output**

```json
{
  "labelIds": [
    "2560636000000011003"
  ],
  "messageIds": [
    "1711540991815100000"
  ],
  "updated": true
}
```

### Archive emails

Archive emails, taking them out of their folder's view.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Email IDs (`message_ids`, list, required): One or more emails' messageId values, from 'List emails' or 'Search emails'. Separate several with commas.

**Outputs**: The emails were archived.

- `messageIds` (list): The emails changed.
- `updated` (true/false): Always true.

**Example output**

```json
{
  "messageIds": [
    "1711540991815100000"
  ],
  "updated": true
}
```

### Create folder

Create a mail folder, optionally inside another.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Folder name (`folder_name`, text, required): The new folder's name, unique among its siblings.
- Parent folder (`parent_folder_id`, text): Optional. Create it inside this folder.

**Outputs**: A mail folder.

- `URI` (text): The folder's API address.
- `folderId` (text): The folder's id.
- `folderName` (text): The folder's name.
- `folderType` (text): Inbox, Drafts, Sent, Spam, Trash and so on.
- `imapAccess` (true/false): Whether the folder is shown over IMAP.
- `isArchived` (number): 1 if the folder is archived, else 0.
- `path` (text): The folder's path, such as /Inbox/Receipts.
- `previousFolderId` (text): The id of the folder listed before it.

**Example output**

```json
{
  "folderId": "2560636000000008014",
  "folderName": "Receipts",
  "folderType": "Inbox",
  "imapAccess": true,
  "isArchived": 0,
  "path": "/Receipts"
}
```

### Create label

Create a label to tag emails with.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Label name (`display_name`, text, required): The label's name.
- Color (`color`, text): Optional. A hex colour such as #ffd700 (the default).

**Outputs**: A label.

- `URI` (text): The label's API address.
- `color` (text): The label's colour, such as #ffd700.
- `displayName` (text): The label's name.
- `labelId` (text): The label's id.
- `sequence` (number): The label's position.
- `tagId` (text): The label's tag id (the same number).

**Example output**

```json
{
  "color": "#ffd700",
  "displayName": "Clients",
  "labelId": "2560636000000011003",
  "sequence": 1,
  "tagId": "2560636000000011003"
}
```

### Delete email

Move an email to the Trash, or delete it permanently.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Folder (`folder_id`, text, required): The folder the email is in: the email's folderId from 'List emails' or 'Search emails'.
- Email ID (`message_id`, text, required): The email's messageId, from 'List emails' or 'Search emails'.
- Delete permanently (`permanently`, true/false): Optional. Skip the Trash; the email cannot be recovered. Default: `false`.

**Outputs**: The email was deleted.

- `data` (object): Zoho Mail's answer, as sent.
- `deleted` (true/false): Always true.
- `messageId` (text): The deleted email's id.
- `permanently` (true/false): Whether it skipped the Trash.

**Example output**

```json
{
  "data": {},
  "deleted": true,
  "messageId": "1711540991815100000",
  "permanently": false
}
```

### Delete folder

Delete a folder you created.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Folder (`folder_id`, text, required): The folder to delete.

**Outputs**: The folder was deleted.

- `deleted` (true/false): Always true.
- `folderId` (text): The deleted folder's id.

**Example output**

```json
{
  "deleted": true,
  "folderId": "2560636000000008014"
}
```

### Delete label

Delete a label and remove it from every email that has it.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Label (`label_id`, text, required): The label to delete.

**Outputs**: The label was deleted.

- `deleted` (true/false): Always true.
- `labelId` (text): The deleted label's id.

**Example output**

```json
{
  "deleted": true,
  "labelId": "2560636000000011003"
}
```

### Flag emails

Set or clear the flag on emails.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Email IDs (`message_ids`, list, required): One or more emails' messageId values, from 'List emails' or 'Search emails'. Separate several with commas.
- Flag (`flag`, text, required): The flag; No flag clears it. One of: `flag_not_set` (No flag), `info`, `important`, `followup` (Follow-up).

**Outputs**: The emails were flagged.

- `flag` (text): The flag set.
- `messageIds` (list): The emails changed.
- `updated` (true/false): Always true.

**Example output**

```json
{
  "flag": "important",
  "messageIds": [
    "1711540991815100000"
  ],
  "updated": true
}
```

### Get email content

Get an email's body as HTML.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Folder (`folder_id`, text, required): The folder the email is in: the email's folderId from 'List emails' or 'Search emails'.
- Email ID (`message_id`, text, required): The email's messageId, from 'List emails' or 'Search emails'.
- Include quoted text (`include_block_content`, true/false): Optional. Also include blockquoted (earlier) text. Default: `false`.

**Outputs**: An email's body.

- `content` (text): The body, as HTML.
- `messageId` (text): The email's id.

**Example output**

```json
{
  "content": "<div>Hello</div>",
  "messageId": "1711540991815100000"
}
```

### Get email details

Get an email's subject, sender, recipients, flag and status.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Folder (`folder_id`, text, required): The folder the email is in: the email's folderId from 'List emails' or 'Search emails'.
- Email ID (`message_id`, text, required): The email's messageId, from 'List emails' or 'Search emails'.

**Outputs**: An email.

- `calendarType` (text): Set when the email is an invitation.
- `ccAddress` (text): The Cc recipients; empty when there are none.
- `flagid` (text): The flag: flag_not_set, info, important or followup.
- `folderId` (text): The id of the folder the email is in.
- `fromAddress` (text): The sender's address.
- `hasAttachment` (text): 1 when the email has attachments.
- `hasInline` (text): Whether the email has inline images.
- `messageId` (text): The email's id.
- `priority` (text): The priority, 3 is normal.
- `receivedTime` (text): Epoch milliseconds.
- `sender` (text): The sender's name.
- `sentDateInGMT` (text): Epoch milliseconds.
- `size` (text): The size in bytes.
- `status` (text): 1 (or read) when read, 0 (or unread) when unread.
- `status2` (text): Zoho's secondary status.
- `subject` (text): The subject.
- `summary` (text): The start of the body.
- `threadCount` (text): How many emails are in the conversation.
- `threadId` (text): The id of the email's conversation.
- `toAddress` (text): The recipients.

**Example output**

```json
{
  "ccAddress": "",
  "flagid": "flag_not_set",
  "folderId": "2560636000000008014",
  "fromAddress": "paula@zylker.com",
  "hasAttachment": "0",
  "messageId": "1711540991815100000",
  "receivedTime": "1711540991815",
  "sender": "Paula",
  "status": "0",
  "subject": "Quarterly report",
  "summary": "Please find the numbers below.",
  "threadId": "1711540991815100001",
  "toAddress": "\"Rebecca\"<rebecca@zylker.com>"
}
```

### List accounts

List the signed-in user's mail accounts and their addresses.

**Inputs**: None.

**Outputs**

- `count` (number): How many mail accounts there are.
- `items` (list): The mail accounts.

**Example output**

```json
{
  "count": 1,
  "items": [
    {
      "accountDisplayName": "Rebecca",
      "accountId": "2560636000000008002",
      "accountName": "rebecca",
      "displayName": "Rebecca Smith",
      "emailAddress": [
        {
          "isAlias": false,
          "isConfirmed": true,
          "isPrimary": true,
          "mailId": "rebecca@zylker.com"
        }
      ],
      "enabled": true,
      "incomingUserName": "rebecca@zylker.com",
      "primaryEmailAddress": "rebecca@zylker.com",
      "type": "ZOHO_ACCOUNT"
    }
  ]
}
```

### List emails

List emails, newest first by default, optionally filtered.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Folder (`folder_id`, text): Optional. Only this folder.
- Read status (`read_status`, text): Optional. All emails (the default), unread or read. One of: `all`, `unread`, `read`.
- Flag (`flag`, text): Optional. Only emails with this flag. One of: `flag_not_set` (No flag), `info`, `important`, `followup` (Follow-up).
- Label (`label_id`, text): Optional. Only emails with this label.
- Conversation ID (`thread_id`, text): Optional. Only this conversation: an email's threadId.
- Sort by (`sort_by`, text): Optional. Date (the default), email id or size. One of: `date`, `messageId` (Email id), `size`.
- Order (`sort_order`, text): Optional. Descending (newest first, the default) or ascending. One of: `descending`, `ascending`.
- With attachments only (`attachments_only`, true/false): Optional. Only emails with attachments. Default: `false`.
- Flagged only (`flagged_only`, true/false): Optional. Only flagged emails. Default: `false`.
- Include archived (`include_archived`, true/false): Optional. Also list archived emails. Default: `false`.
- Page size (`limit`, number): Optional. How many to return, 1 to 200. Default 50. From 1 to 200.
- Offset (`offset`, number): Optional. How many to skip: the next_offset of the previous page. At least 0.

**Outputs**

- `count` (number): How many emails are on this page.
- `has_more` (true/false): Whether another page is probably available.
- `items` (list): The emails.
- `next_offset` (number): Pass as 'Offset' to fetch the next page; empty on the last.

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "items": [
    {
      "ccAddress": "",
      "flagid": "flag_not_set",
      "folderId": "2560636000000008014",
      "fromAddress": "paula@zylker.com",
      "hasAttachment": "0",
      "messageId": "1711540991815100000",
      "receivedTime": "1711540991815",
      "sender": "Paula",
      "status": "0",
      "subject": "Quarterly report",
      "summary": "Please find the numbers below.",
      "threadId": "1711540991815100001",
      "toAddress": "\"Rebecca\"<rebecca@zylker.com>"
    }
  ],
  "next_offset": null
}
```

### List folders

List the account's folders, optionally only one type.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Folder type (`folder_type`, text): Optional. Only folders of this type, such as Sent. One of: `Inbox`, `Drafts`, `Templates`, `Snoozed`, `Sent`, `Spam`, `Trash`, `Outbox`.

**Outputs**

- `count` (number): How many folders there are.
- `items` (list): The folders.

**Example output**

```json
{
  "count": 1,
  "items": [
    {
      "folderId": "2560636000000008014",
      "folderName": "Receipts",
      "folderType": "Inbox",
      "imapAccess": true,
      "isArchived": 0,
      "path": "/Receipts"
    }
  ]
}
```

### List labels

List the account's labels.

**Inputs**

- Account (`account_id`, text, required): The mail account.

**Outputs**

- `count` (number): How many labels there are.
- `items` (list): The labels.

**Example output**

```json
{
  "count": 1,
  "items": [
    {
      "color": "#ffd700",
      "displayName": "Clients",
      "labelId": "2560636000000011003",
      "sequence": 1,
      "tagId": "2560636000000011003"
    }
  ]
}
```

### Mark as read or unread

Mark emails as read or unread.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Email IDs (`message_ids`, list, required): One or more emails' messageId values, from 'List emails' or 'Search emails'. Separate several with commas.
- Mark as (`read_status`, text, required): Read or unread. One of: `read`, `unread`.

**Outputs**: The emails were marked.

- `messageIds` (list): The emails changed.
- `readStatus` (text): read or unread.
- `updated` (true/false): Always true.

**Example output**

```json
{
  "messageIds": [
    "1711540991815100000"
  ],
  "readStatus": "read",
  "updated": true
}
```

### Move emails

Move emails to another folder.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Email IDs (`message_ids`, list, required): One or more emails' messageId values, from 'List emails' or 'Search emails'. Separate several with commas.
- To folder (`destination_folder_id`, text, required): The folder to move them to.

**Outputs**: The emails were moved.

- `folderId` (text): The folder they were moved to.
- `messageIds` (list): The emails changed.
- `updated` (true/false): Always true.

**Example output**

```json
{
  "folderId": "2560636000000008014",
  "messageIds": [
    "1711540991815100000"
  ],
  "updated": true
}
```

### Reply to email

Reply to an email, keeping it in the same conversation.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Email ID (`message_id`, text, required): The email's messageId, from 'List emails' or 'Search emails'.
- To (`to_address`, text, required): The recipients' email addresses, separated by commas.
- From (`from_address`, text): Optional. The address to send from; the account's primary address by default.
- Cc (`cc_address`, text): Optional. Cc addresses, separated by commas.
- Bcc (`bcc_address`, text): Optional. Bcc addresses, separated by commas.
- Subject (`subject`, text): Optional. The subject line.
- Body (`content`, text): Optional. The email's body; HTML unless Format is Plain text.
- Format (`mail_format`, text): Optional. HTML (the default) or plain text. One of: `html`, `plaintext` (Plain text).
- Ask for a read receipt (`ask_receipt`, true/false): Optional. Ask the recipient to confirm they read it. Default: `false`.

**Outputs**: What Zoho Mail answered to a reply.

- `data` (object): Zoho Mail's answer, as sent.
- `fromAddress` (text): The address it was sent from.
- `inReplyTo` (text): The id of the email replied to.
- `messageId` (text): The reply's id, when Zoho Mail returns one.
- `subject` (text): The subject.
- `toAddress` (text): The recipients.

**Example output**

```json
{
  "data": {},
  "fromAddress": "rebecca@zylker.com",
  "inReplyTo": "1711540991815100000",
  "subject": "Quarterly report",
  "toAddress": "paula@zylker.com"
}
```

### Save draft

Save an email to the Drafts folder without sending it.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- To (`to_address`, text, required): The recipients' email addresses, separated by commas.
- From (`from_address`, text): Optional. The address to send from; the account's primary address by default.
- Cc (`cc_address`, text): Optional. Cc addresses, separated by commas.
- Bcc (`bcc_address`, text): Optional. Bcc addresses, separated by commas.
- Subject (`subject`, text): Optional. The subject line.
- Body (`content`, text): Optional. The email's body; HTML unless Format is Plain text.
- Format (`mail_format`, text): Optional. HTML (the default) or plain text. One of: `html`, `plaintext` (Plain text).

**Outputs**: What Zoho Mail answered to a saved draft.

- `data` (object): Zoho Mail's answer, as sent.
- `fromAddress` (text): The From address.
- `messageId` (text): The draft's id, when Zoho Mail returns one.
- `subject` (text): The subject.
- `toAddress` (text): The recipients.

**Example output**

```json
{
  "data": {},
  "fromAddress": "rebecca@zylker.com",
  "subject": "Quarterly report",
  "toAddress": "paula@zylker.com"
}
```

### Search emails

Search the account's emails with Zoho Mail's search syntax.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- Search (`search_key`, text): Optional if a date is set. field:value terms, such as subject:invoice, sender:ana@example.com, entire:hello or has:attachment. Join with :: for AND or :or: for OR.
- From date (`received_from`, date): Optional. Only emails from this day on.
- To date (`received_to`, date): Optional. Only emails up to this day.
- Page size (`limit`, number): Optional. How many to return, 1 to 200. Default 50. From 1 to 200.
- Offset (`offset`, number): Optional. How many to skip: the next_offset of the previous page. At least 0.

**Outputs**

- `count` (number): How many matching emails are on this page.
- `has_more` (true/false): Whether another page is probably available.
- `items` (list): The matching emails.
- `next_offset` (number): Pass as 'Offset' to fetch the next page; empty on the last.

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "items": [
    {
      "ccAddress": "",
      "flagid": "flag_not_set",
      "folderId": "2560636000000008014",
      "fromAddress": "paula@zylker.com",
      "hasAttachment": "0",
      "messageId": "1711540991815100000",
      "receivedTime": "1711540991815",
      "sender": "Paula",
      "status": "0",
      "subject": "Quarterly report",
      "summary": "Please find the numbers below.",
      "threadId": "1711540991815100001",
      "toAddress": "\"Rebecca\"<rebecca@zylker.com>"
    }
  ],
  "next_offset": null
}
```

### Send email

Send an email from the account.

**Inputs**

- Account (`account_id`, text, required): The mail account.
- To (`to_address`, text, required): The recipients' email addresses, separated by commas.
- From (`from_address`, text): Optional. The address to send from; the account's primary address by default.
- Cc (`cc_address`, text): Optional. Cc addresses, separated by commas.
- Bcc (`bcc_address`, text): Optional. Bcc addresses, separated by commas.
- Subject (`subject`, text): Optional. The subject line.
- Body (`content`, text): Optional. The email's body; HTML unless Format is Plain text.
- Format (`mail_format`, text): Optional. HTML (the default) or plain text. One of: `html`, `plaintext` (Plain text).
- Ask for a read receipt (`ask_receipt`, true/false): Optional. Ask the recipient to confirm they read it. Default: `false`.

**Outputs**: What Zoho Mail answered to a send.

- `data` (object): Zoho Mail's answer, as sent.
- `fromAddress` (text): The address it was sent from.
- `messageId` (text): The new email's id, when Zoho Mail returns one.
- `subject` (text): The subject.
- `toAddress` (text): The recipients.

**Example output**

```json
{
  "data": {},
  "fromAddress": "rebecca@zylker.com",
  "subject": "Quarterly report",
  "toAddress": "paula@zylker.com"
}
```
