Sending Custom Emails to Contacts

Zoho Books API v3: Sending Custom Emails to Contacts

Zoho Books API v3: Sending Custom Emails to Contacts

The Email Contact API acts as a bridge between your custom application and the contact's inbox. Instead of using a third-party SMTP service, you can leverage Zoho Books' established mailing infrastructure to send personalized messages to your customers and vendors.

At Kalki LLP, we use this endpoint to trigger "Account Health" updates, such as notifying a customer when their account details have been successfully synced with our master database.


1. The Action Request (POST)

To send a custom email, you perform a POST request to the /email sub-resource.

Endpoint: POST /contacts/{contact_id}/email?organization_id={organization_id}

Request Requirements:

  • Method: POST

  • Authentication: Valid OAuth token with ZohoBooks.contacts.CREATE or UPDATE scope.

  • Payload: Requires a JSON body containing the recipients, subject, and message content.


2. API Payload Example (JSON)

You can include multiple recipients and custom message bodies. You can also specify an attachment_urls array if you need to include files from an external source.

JSON
{
"to_mail_ids": ["contact@kalkillp.com", "billing@kalkillp.com"],
"subject": "Update regarding your account status",
"body": "Dear Valued Partner, We have successfully updated your tax registration details in our records. Please reach out if you have questions.",
"send_customer_statement_report_as_pdf": false
}

Kalki LLP Pro-Tip: The to_mail_ids field is an array. Always validate that the emails provided are properly formatted strings; an invalid email address here will cause the API to reject the request.


3. Implementation in Deluge (Kalki LLP Automation)

This script is ideal for workflows where you want to notify a contact after a specific event, such as a successful credit limit increase or a change in payment terms.

Code snippet
// Target Contact ID
contactID = "460000000026049";
orgID = "123456789";

// Build the request body
mailBody = Map();
mailBody.put("to_mail_ids", {"client@example.com"});
mailBody.put("subject", "Account Status Update");
mailBody.put("body", "Hello, your account has been verified.");

// Execute the POST request
response = invokeurl
[
url :"https://www.zohoapis.in/books/v3/contacts/" + contactID + "/email?organization_id=" + orgID
type :POST
parameters :mailBody.toString()
connection :"kalki_books_connection"
];

if(response.get("code") == 0)
{
info "Kalki Success: Custom email dispatched to contact.";
}
else
{
info "Email failed: " + response.get("message");
}

4. Error Logs & Troubleshooting

Error CodeMeaningFix for Kalki LLP Developers
2Invalid IDThe contact_id in the URL does not exist.
57UnauthorizedYour OAuth token lacks the necessary scopes.
1005Missing EmailsThe to_mail_ids field is empty.
1038JSON Syntax ErrorEnsure your payload is strictly valid JSON format.

5. Strategic Advantage: Why "Email Contact" API?

For kalkillp.com clients, we utilize this API to:

  1. Centralize Communication: Keep a record of all emails sent to a contact within their Zoho Books "Comments & History" section, rather than keeping them hidden in personal mailboxes.

  2. Uniform Branding: Use Zoho’s email engine to ensure all correspondence carries your company's signature and branding.

  3. Developer Efficiency: Eliminate the need to manage separate SMTP credentials or mail services within your custom application.


Master Your Customer Correspondence

Communication is the key to strong business relationships. Kalki LLP specializes in building sophisticated automation flows that ensure your customers receive clear, timely, and professional correspondence every time your system updates their account status.

    • Related Articles

    • Zoho Books vs Tally: Which is Right for Your Business in 2025?

      Overview: Why Compare Zoho Books and Tally in 2025? In 2025, modern businesses are moving fast—and their accounting software needs to keep up. Two widely used solutions in India are Tally and Zoho Books, but they differ significantly in approach, ...
    • Zoho Books API v3: Update Contact via Unique Custom Field

      Zoho Books API v3: Update Contact via Unique Custom Field Updating records via internal IDs can be a bottleneck. Zoho Books allows you to bypass the contact_id by using a Custom Field as a unique identifier. This endpoint also supports the Upsert ...
    • Zoho Books API v3: How to List Contacts

      Zoho Books API v3: How to List and Filter Contacts The List Contacts API allows you to retrieve a collection of all customers and vendors within a Zoho Books organization. Because a business can have thousands of contacts, mastering the pagination ...
    • Zoho Books API v3: How to List and Filter Contacts

      Zoho Books API v3: How to List and Filter Contacts The List Contacts API allows you to retrieve a collection of all customers and vendors within a Zoho Books organization. Because businesses often have thousands of records, mastering the pagination ...
    • Trigger Assignment and Workflow Rules in Zoho CRM via Deluge & API

      How to Trigger Workflow Rules in Zoho CRM Using Deluge When working with Zoho CRM automation, records created, updated, or deleted via Deluge do not trigger workflow or assignment rules automatically. This is expected behavior. Zoho CRM separates ...