> ## 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

> Link Emails to Deals. Zoho CRM Deal Link Emails Link Emails To Deals reference includes SDK V2 and CLI requests, input constraints, response fields,.

Link Emails to Deals.

<Info>
  Tool ID: `zoho_crm_deal_link_emails_link_emails_to_deals`
</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_deal_link_emails_link_emails_to_deals',
  {
    "contactId": "1238016000000476011"
  },
);

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

### CLI

```bash theme={null}
deepline tools execute zoho_crm_deal_link_emails_link_emails_to_deals --input '{
  "contactId": "1238016000000476011"
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "Emails": [
      {
        "status": "success",
        "code": "SUCCESS",
        "message": "Example message",
        "details": {
          "message_id": "message_123"
        }
      }
    ]
  }
}
```

Use `deepline tools get zoho_crm_deal_link_emails_link_emails_to_deals --json` for the latest machine-readable contract.

## Input reference

Request body schema

| Name                | Type                                             | Required | Default | Details                                                                                                                     |
| ------------------- | ------------------------------------------------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------- |
| `payload.contactId` | `"1238016000000476011" \| "1238016000000674013"` | Yes      | —       | The ID of the contact to which the email is to be linked or unlinked Allowed: `1238016000000476011`, `1238016000000674013`. |
| `payload.Emails`    | `array`                                          | No       | —       | List of emails to be linked to deals Maximum items: 20.                                                                     |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Request body schema",
    "properties": {
      "contactId": {
        "type": "string",
        "description": "The ID of the contact to which the email is to be linked or unlinked",
        "enum": [
          "1238016000000476011",
          "1238016000000674013"
        ]
      },
      "Emails": {
        "type": "array",
        "description": "List of emails to be linked to deals",
        "maxItems": 20,
        "items": {
          "type": "object",
          "description": "Email link details",
          "properties": {
            "message_id": {
              "type": "string",
              "description": "Unique identifier of the email message",
              "enum": [
                "fa3efd2e3d21c63dfb3a1ead81cfbcac3428b9eb290577709d7f12289b5aa1bf5b2bd0f6744144c7a9aae67068ccdc7f"
              ]
            },
            "owner": {
              "type": "object",
              "description": "Owner of the email",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique identifier of the owner",
                  "enum": [
                    "1238016000000362001"
                  ]
                }
              },
              "additionalProperties": false
            },
            "linked_record": {
              "type": "object",
              "description": "Details of the record to which the email is to be linked",
              "properties": {
                "module": {
                  "type": "object",
                  "description": "Module information",
                  "properties": {
                    "api_name": {
                      "type": "string",
                      "description": "API name of the module",
                      "enum": [
                        "Deals"
                      ]
                    },
                    "id": {
                      "type": "string",
                      "description": "Unique identifier of the module",
                      "enum": [
                        "1238016000000000131"
                      ]
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "additionalProperties": false
                },
                "name": {
                  "type": "string",
                  "description": "Name of the linked record",
                  "enum": [
                    "Sai Deal"
                  ]
                },
                "id": {
                  "type": "string",
                  "description": "Unique identifier of the linked record",
                  "enum": [
                    "1238016000000514024",
                    "1238016000000002676"
                  ]
                }
              },
              "required": [
                "module",
                "id"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "message_id",
            "owner",
            "linked_record"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "contactId"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name                                      | Type        | Required | Default | Details                                                        |
| ----------------------------------------- | ----------- | -------- | ------- | -------------------------------------------------------------- |
| `result.data`                             | `object`    | Yes      | —       | Response schema                                                |
| `result.data.Emails`                      | `array`     | Yes      | —       | List of email link operation results Maximum items: 20.        |
| `result.data.Emails[].status`             | `"success"` | Yes      | —       | Status of the link operation Allowed: `success`.               |
| `result.data.Emails[].code`               | `"SUCCESS"` | Yes      | —       | Result code of the link operation Allowed: `SUCCESS`.          |
| `result.data.Emails[].message`            | `string`    | Yes      | —       | Detailed message about the link operation Maximum length: 256. |
| `result.data.Emails[].details`            | `object`    | Yes      | —       | Additional details about the link operation                    |
| `result.data.Emails[].details.message_id` | `string`    | Yes      | —       | Unique identifier of the email message Maximum length: 255.    |
| `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 schema",
        "properties": {
          "Emails": {
            "type": "array",
            "description": "List of email link operation results",
            "maxItems": 20,
            "items": {
              "type": "object",
              "description": "Email link operation result",
              "properties": {
                "status": {
                  "type": "string",
                  "description": "Status of the link operation",
                  "enum": [
                    "success"
                  ]
                },
                "code": {
                  "type": "string",
                  "description": "Result code of the link operation",
                  "enum": [
                    "SUCCESS"
                  ]
                },
                "message": {
                  "type": "string",
                  "description": "Detailed message about the link operation",
                  "maxLength": 256
                },
                "details": {
                  "type": "object",
                  "description": "Additional details about the link operation",
                  "properties": {
                    "message_id": {
                      "type": "string",
                      "description": "Unique identifier of the email message",
                      "maxLength": 255
                    }
                  },
                  "required": [
                    "message_id"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "status",
                "code",
                "message",
                "details"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "Emails"
        ],
        "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)
