Skip to product menu
close
  • Recent Launches
    Press Space or Enter to display list of options
EXPLORE ALL PRODUCTS

Recent Launches

New

Payroll software with automated tax payments and filing.

Try now
New

Robotic process automation software to automate high-volume, rule-based tasks.

Try for free
New

Low-code IoT platform and solutions for connected businesses.

Try now
New

Business formation service to launch and grow your businesses.

Try now
New

Privacy-friendly application analytics solution.

Try for free

Sales

 
CRM

Comprehensive CRM platform for customer-facing teams.

CRM
 
Bigin

Simple CRM for small businesses moving from spreadsheets.

Bigin
 
Forms

Build online forms for every business need.

Forms
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Sign

Digital signature app for businesses.

Sign
 
RouteIQ

Comprehensive sales map visualization and optimal route planning solution.

RouteIQ
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
Suites
CRM Plus

Unified platform to deliver top-notch customer experience.

CRM Plus

Marketing

 
Social

All-in-one social media management software.

Social
 
Campaigns

Create, send, and track targeted email campaigns that drive sales.

Campaigns
 
Forms

Build online forms for every business need.

Forms
 
Survey

Design surveys to reach and interact with your audience.

Survey
 
Sites

Online website builder with extensive customisation options.

Sites
 
PageSense

Website conversion optimization and personalisation platform.

PageSense
 
Backstage

End-to-end event management software.

Backstage
 
Webinar

Webinar platform for webcasting online webinars.

Webinar
 
Marketing Automation

All-in-one marketing automation software.

Marketing Automation
 
LandingPage

Smart landing page builder to increase conversion rates

LandingPage
 
Publish

Manage all your local business listings on a single platform.

Publish
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Sign

Digital signature app for businesses.

Sign
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
LeadChain

Sync, manage, and convert leads across channels seamlessly.

LeadChain
 
NEW
CommunitySpaces

Online community platform for individuals and businesses to grow their network and brand.

CommunitySpaces
 
Suites
Marketing Plus

Unified marketing platform for marketing teams.

Marketing Plus

Commerce and POS

 
Commerce

eCommerce platform to manage and market your online store.

Commerce

Service

 
Desk

Helpdesk software to deliver great customer support.

Desk
 
Assist

Remote support and unattended remote access software.

Assist
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
FSM

End-to-end field service management platform for service businesses.

FSM
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Suites
Service Plus

Unified platform for customer service and support teams.

Service Plus

Finance

 
Books

Powerful accounting platform for growing businesses.

Books
 
FREE
Invoice

100% Free invoicing solution.

Invoice
 
Expense

Effortless expense reporting platform.

Expense
 
Inventory

Powerful stock management and inventory control software.

Inventory
 
Billing

End-to-end billing solution for your business.

Billing
 
Checkout

Collect payments online with custom branded pages.

Checkout
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Practice

Practice management software for accounting firms.

Practice
 
Sign

Digital signature app for businesses.

Sign
 
Commerce

eCommerce platform to manage and market your online store.

Commerce
 
Suites
Finance Plus

All-in-one suite to manage your operations and finances.

Finance Plus

Email and Collaboration

 
Mail

Secure email service for teams of all sizes.

Mail
 
Meeting

Online meeting software for all your video conferencing & webinar needs.

Meeting
 
Writer

Word processor for focused writing and discussions.

Writer
 
Sheet

Spreadsheet software for collaborative teams.

Sheet
 
Show

Create, edit, and share slides with a sleek presentation app.

Show
 
Notebook

Beautiful home for all your notes.

Notebook
 
Cliq

Stay in touch with teams no matter where you are.

Cliq
 
Connect

Employee experience platform to communicate, engage, and build positive employee relations.

Connect
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
TeamInbox

Shared inboxes for teams.

TeamInbox
 
WorkDrive

Online file management for teams.

WorkDrive
 
Sign

Digital signature app for businesses.

Sign
 
Office Suite

Powerful collaborative work platform for teams.

Office Suite
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
Calendar

Online business calendar to manage events and schedule appointments.

Calendar
 
Learn

Knowledge and learning management platform.

Learn
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
ToDo

Collaborative task management for individuals and teams.

ToDo
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
FREE
PDF Editor

Collaborative online PDF editing tool.

PDF Editor
 
Suites
Workplace

Application suite built to improve team productivity and collaboration.

Workplace

Human Resources

 
People

Organize, automate, and simplify your HR processes.

People
 
Recruit

Intuitive recruiting platform built to provide hiring solutions.

Recruit
 
Expense

Effortless expense reporting platform.

Expense
 
Workerly

Manage temporary staffing with an employee scheduling solution.

Workerly
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
Shifts

Employee scheduling and time tracking app.

Shifts
 
Sign

Digital signature app for businesses.

Sign
 
Suites
People Plus

Comprehensive HR platform for seamless employee experiences.

People Plus

Security and IT Management

 
Creator

Build custom apps to simplify business processes.

Creator
 
Directory

Workforce identity and access management solution for cloud businesses.

Directory
 
FREE
OneAuth

Secure multi-factor authenticator (MFA) for all your online accounts.

OneAuth
 
Vault

Online password manager for teams.

Vault
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Toolkit

Complete resource for any admin-related lookup queries.

Toolkit
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
Assist

Remote support and unattended remote access software.

Assist
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA

BI and Analytics

 
Analytics

Modern self-service BI and analytics platform.

Analytics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep
 
NEW
IoT

Harnessing IoT analytics for real-time operational intelligence.

IoT

Project Management

 
Projects

Manage, track, and collaborate on projects with teams.

Projects
 
Sprints

Planning and tracking tool for scrum teams.

Sprints
 
BugTracker

Automatic bug tracking software for managing bugs.

BugTracker
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo

Developer Platforms

 
Creator

Build custom apps to simplify business processes.

Creator
 
Flow

Automate business workflows by creating smart integrations.

Flow
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
 
NEW
Apptics

Application analytics for all apps.

Apptics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
NEW
IoT

Build, deploy, and scale IoT solutions for connected businesses.

IoT
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep

IoT

 
NEW
IoT

Low-code IoT platform and solutions for connected businesses.

IoT

Search Result

 
CRM Plus

Unified platform to deliver top-notch customer experience.

Try now
CRM Plus
 
Service Plus

Unified platform for customer service and support teams.

Try now
Service Plus
 
Finance Plus

All-in-one suite to manage your operations and finances.

Try now
Finance Plus
 
People Plus

Comprehensive HR platform for seamless employee experiences.

Try now
People Plus
 
Workplace

Application suite built to improve team productivity and collaboration.

Try now
Workplace
 
Marketing Plus

Unified marketing platform for marketing teams.

Try now
Marketing Plus
 
All-in-one suite

Zoho One

The Operating System for Business

Run your entire business on Zoho with our unified cloud software, designed to help you break down silos between departments and increase organizational efficiency.

TRY ZOHO ONE
Zoho One
Zoho Marketplace

With over 2000 ready-to-use extensions across 40+ categories, connect your favorite business tools with the Zoho products you already use.

EXPLORE MARKETPLACE
Marketplace
Skip to main content

Associate Email with a Record

Zoho CRM allows its users to associate emails with record entities. You can also associate an email entry with a record, and map another record to the same. For example, if you are associating an email to a Deal, you might also need to map a contact with it. This is facilitated using the associate email API.

Purpose

To associate an email with a record entity.

Request Details

Request URL

{api-domain}/crm/{version}/{module}/{record_id}/actions/associate_email

Supported modules

Leads, Contacts, Quotes, Invoices, Sales_Orders, Purchase_Orders, Deals, Accounts and Custom

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

scope=ZohoCRM.modules.emails.ALL
(AND)
scope=ZohoCRM.modules.{module}.ALL

Possible modules

Leads, Contacts, Quotes, Invoices, Sales_Orders, Purchase_Orders, Deals, Accounts and Custom

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v6/Deals/4876876000000333267/actions/associate_email"
-X POST
-d "assoc-email.json"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"

Input JSON Keys

  • fromJSON object, mandatory

    Represents the from user of the associated email. The array consists of user_name and email.

  • toJSON array, mandatory

    Represents the user to whom the associated email is addressed to. The array consists of user_name and email.

  • ccJSON array, optional

    Represents the users to whom the associated email is addressed in cc. The array consists of user_name and email.

  • bccJSON array, optional

    Represents the users to whom the associated email is addressed in bcc. The array consists of user_name and email.

  • subjectstring, mandatory

    Represents the email subject.

  • contentstring, mandatory

    Represents the email content.

  • mail_formatstring, optional

    Represents format of the associated email. Possible value is html.

  • attachmentsJSON array, optional

    Represents the attachments in the associated email. The array consists of id and file_name. The id represents the file id after uploading the file to ZFS. Please refer to Upload Files documentation for more details. Please not that the size limit on attachment file(s) is 10MB.

  • date_timeDateTime, mandatory

    The date and time at which the email was sent.

  • sentboolean, mandatory

    Represents whether the email was sent or received. If the value is true, the email is sent, and if the value is false, the email is a received email.

  • linked_recordJSON object, optional

    Represents the entity details to which you want to map the email additionally. The array contains the id and name of the entity, and the module details.

  • original_message_idstring, mandatory

    Represents the unique message ID from the email header.

Sample Input

Copied{
  "Emails": [
    {
      "from": {
        "user_name": "user1",
        "email": "test@zoho.com"
      },
      "to": [
        {
          "user_name": "user2",
          "email": "test1@zoho.com"
        }
      ],
      "cc": [
        {
          "user_name": "user3",
          "email": "test2@zoho.com"
        }
      ],
      "bcc": [
        {
          "user_name": "user4",
          "email": "test3@zoho.com"
        }
      ],
      "subject": "Mail subject",
       "content": "<h3><span style=\"background-color: rgb(254, 255, 102)\">Mail is of rich text format</span></h3><h3><span style=\"background-color: rgb(254, 255, 102)\">REGARDS,</span></h3><div><span style=\"background-color: rgb(254, 255, 102)\">AZ</span></div><div><span style=\"background-color: rgb(254, 255, 102)\">ADMIN</span></div> <div></div>", 
      "mail_format": "html",
      "date_time": "2018-06-12T12:12:12+05:30",
      "sent": true,
       "attachments": [
        {
          "id": "39c17f1033cd120e62f8104c545af0ef95a1bd5438fe9159ee8ff6d1bee480cd",
          "name": "Test File"
        }
      ],
       "linked_record": {
         "id" : "4876876000001355087",
         "name" : "Simmons Truhlar",
         "module": {
          "api_name": "Contacts",
          "id": "4876876000000002179"
         }             
    },
      "original_message_id": "1234534dead-asds3322w243"
    }
  ]
}

Request format for content with inline image

If you want the associated email content to include an inline image, you should upload the image to ZFS with the parameter type=inline. The file id from the response should be used in the content section of the input body. For more details, kindly check the Sample Inputsection.

Sample Input for content with Inline Image

Copied{
  "Emails": [
    {
      "from": {
        "user_name": "user1",
        "email": "test@zoho.com"
      },
      "to": [
        {
          "user_name": "user2",
          "email": "test1@zoho.com"
        }
      ],
      "cc": [
        {
          "user_name": "user3",
          "email": "test2@zoho.com"
        }
      ],
      "bcc": [
        {
          "user_name": "user4",
          "email": "test3@zoho.com"
        }
      ],
      "subject": "Inline Image Content",
       "content": "<br><br><br><br>Hi Inline image<br><br><h3><span style=\"background-color: rgb(254, 255, 102)\"><img class=\"ZCrmImage\" src=\"crm\/img_id:39c17f1033cd120e62f8104c545af0ef3933f668cfda215fbe50a2cc5226de1d\"></span></h3><h3><span style=\"background-color: rgb(254, 255, 102)\">REGARDS,</span></h3><div><span style=\"background-color: rgb(254, 255, 102)\">AZ</span></div><div><span style=\"background-color: rgb(254, 255, 102)\">ADMIN</span></div> <div></div>", 
      "mail_format": "html",
      "date_time": "2018-06-12T12:12:12+05:30",
      "sent": true,
      "original_message_id": "1234523asad-asds23324374"
    }
  ]
}

Show full

Show less

Request format for users with admin role to associate other user's mail

An admin user can associate other user's email with any record. Please note that only users with admin privilege can associate another user's email with a record. You need to give an extra input key to represent the owner of the email.

Input JSON Keys

  • ownerJSON object, mandatory if associating other user's email.

    Represents the owner of the email.

Sample Input for admin user to associate other user's mail

Copied{
  "Emails": [
    {
      "from": {
        "user_name": "user1",
        "email": "test@zoho.com"
      },
      "to": [
        {
          "user_name": "user2",
          "email": "test1@zoho.com"
        }
      ],
      "cc": [
        {
          "user_name": "user3",
          "email": "test2@zoho.com"
        }
      ],
      "bcc": [
        {
          "user_name": "user4",
          "email": "test3@zoho.com"
        }
      ],
      "owner" : {
          "id" : "4876876000001360001"
      },
      "subject": "Other User email",
      "content": "<h3><span style=\"background-color: rgb(254, 255, 102)\">Mail is of rich text format</span></h3><h3><span style=\"background-color: rgb(254, 255, 102)\">REGARDS,</span></h3><div><span style=\"background-color: rgb(254, 255, 102)\">AZ</span></div><div><span style=\"background-color: rgb(254, 255, 102)\">ADMIN</span></div> <div></div>",
      "mail_format": "html",
      "date_time": "2018-06-12T12:12:12+05:30",
      "sent": false,
       "attachments": [
        {
          "id": "39c17f1033cd120e62f8104c545af0ef95a1bd5438fe9159ee8ff6d1bee480cd",
          "name": "Test File"
        }
      ],
      "original_message_id": "1234534frad-aers2332w243"
    }
  ]
}

Show full

Show less

Possible Errors

  • INVALID_URL_PATTERNHTTP 404

    Please check if the URL trying to access is a correct one
    Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to request URL section above.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    Unauthorized
    Resolution: Client does not have the required scope. Create a new client with valid scope. Refer to scope section above for more details.

  • NO_PERMISSIONHTTP 403

    Only Admin Role/Profile Users will have permission
    Resolution: The user does not have permission to associate emails with records. Contact your system administrator.

  • INTERNAL_ERRORHTTP 500

    Internal Server Error
    Resolution: Unexpected and unhandled exception in Server. Contact support team.

  • INVALID_REQUEST_METHODHTTP 400

    The http request method type is not a valid one
    Resolution: You have specified an invalid HTTP method to access the API URL. Specify a valid request method. Refer to endpoints section above.

  • FILE_SIZE_EXCEEDSHTTP 400

    Total file(s) size should not exceed 10MB
    Resolution: Limit the total attachment file size to 10MB.

  • DUPLICATE_DATAHTTP 400

    duplicate data
    Resolution: The message id you have specified is already associated with the record. Specify another valid message id for original_message_id key.

  • INVALID_DATAHTTP 400

    provided file id is improper
    Resolution: Specify a valid attachment id.

  • INVALID_DATAHTTP 400

    Provide a Proper owner id
    Resolution: You have specified an invalid owner ID. Provide a valid owner ID.

  • INVALID_DATAHTTP 400

    the parent entity id given seems to be invalid
    Resolution: You have specified an invalid record ID for the linked record. Provide a valid record ID.

  • INVALID_DATAHTTP 400

    the api_name given seems to be invalid
    Resolution: Specify a valid and supported module api name in the linked_records key.

  • MANDATORY_NOT_FOUNDHTTP 400

    required field not found
    Resolution: You have not specified one or more of the mandatory keys in the input JSON. Please refer to the Input JSON Keys section above, and specify all mandatory keys.

  • INVALID_MODULEHTTP 400

    permission denied to access the api
    Resolution: You have tried to associate the email with an unsupported module. Check the Supported modules section above to know which all modules are supported, and associate the email with a supported module entity.

  • STORAGE_ SPACE_EXCEEDSHTTP 400

    storage space exceeds
    Resolution: You have exceeded the storage space of your Zoho CRM Org. Please contact your administrator.

Sample Response

Copied{
    "Emails": [
        {
            "code": "SUCCESS",
            "details": {
                "message_id": "39c17f1033cd120e62f8104c545af0ef3bf9a4d702dd9c006bc737afa46d6975"
            },
            "message": "Your mail has been added successfully",
            "status": "success"
        }
    ]
}