Send Batch Emails

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

Send a batch of transactional emails to multiple recipients at once.

Endpoint

post /email/batch

Request URL

https://cpaas.zoho.com/v1.1/email/batch Copied!

Request Parameters

- Request Headers

ApiKeyAuthAPI Key

API Key of an agent. Send the header as Authorization: Zoho-enczapikey {apiKey}.
Follow the steps here to generate an API key

- Request Body

application/json
JSON Object
Show Sub-Attributes
ccJSON Array[object]Optional

Array of CC recipient email addresses.

Show Sub-Attributes
email_addressJSON ObjectOptional
Show Sub-Attributes
addressstringOptional
Example
manager@zylker.com
namestringOptional
Example
Manager
htmlbodystringOptional

HTML content of the email body.

Example
<div><b>Kindly click on Verify Account to confirm your account.</b></div>
client_referencestringOptional

A custom reference string to identify the email in your system.

Example
order-12345
bccJSON Array[object]Optional

Array of BCC recipient email addresses.

Show Sub-Attributes
email_addressJSON ObjectOptional
Show Sub-Attributes
addressstringOptional
Example
archive@zylker.com
namestringOptional
Example
Archive
attachmentsJSON Array[object]Optional

Array of file attachments. For each attachment supply EITHER content (inline base64) OR file_cache_key (a key returned by the file-upload API) — the two are mutually exclusive. If both are present, file_cache_key takes precedence and content is ignored. When content is used, name and mime_type are required; when file_cache_key is used, name is optional.

Example
[
  {
    "mime_type": "application/pdf",
    "name": "invoice.pdf",
    "content": "JVBERi0xLjQKJcTl8uXrp... (base64-encoded bytes)"
  },
  {
    "file_cache_key": "ea36f19a.a59e41437e3e1a1.h1.bbeabef0-d2c5-11f1-8876-2a30dd3b833c.1a18258b05f",
    "name": "terms.pdf"
  }
]
Show Sub-Attributes
file_cache_keystringOptional

Key of a file previously uploaded via the file-upload API (POST /v1.1/files). Required unless content is provided. Mutually exclusive with content.

Example
ea36f19a.a59e41437e3e1a1.h1.bbeabef0-d2c5-11f1-8876-2a30dd3b833c.1a18258b05f
mime_typestringOptional

MIME type of the file. Required when content is used.

Example
application/pdf
namestringOptional

File name shown to the recipient. Required when content is used; optional with file_cache_key.

Example
invoice.pdf
contentstringOptional

Base64-encoded file content. Required unless file_cache_key is provided. Mutually exclusive with file_cache_key.

subjectstringMandatory

Subject line of the email.

Example
Account Confirmation
bounce_addressemailOptional

Verified bounce (Return-Path) address that receives bounce notifications for this email. Must be a bounce address created and verified under the sending agent's domain.

Example
bounce@bounce-zem.zylker.com
track_opensbooleanOptional

Enable or disable open tracking.

Example
true
reply_toJSON Array[object]Optional

Reply-to email address.

Show Sub-Attributes
addressstringOptional
Example
support@zylker.com
namestringOptional
Example
Support
fromJSON ObjectMandatory

The sender's email address and optional display name.

Show Sub-Attributes
addressstringMandatory
Example
accounts@info.zylker.com
namestringOptional
Example
Paula
toJSON Array[object]Mandatory

Array of recipient email addresses.

Show Sub-Attributes
email_addressJSON ObjectMandatory
Show Sub-Attributes
addressstringMandatory
Example
rudra.d@zylker.com
namestringOptional
Example
Rudra
textbodystringOptional

Plain text content of the email body.

Example
Kindly click on Verify Account to confirm your account.
track_clicksbooleanOptional

Enable or disable click tracking.

Example
true

Sample Request

Curl
Java
Python
Deluge
Copied!
curl --request POST \
  --url https://cpaas.zoho.com/v1.1/email/batch \
  --header 'Authorization: Zoho-enczapikey {apiKey}' \
  --header 'content-type: application/json' \
  --data '{"cc":[{"email_address":{"address":"manager@zylker.com","name":"Manager"}}],"htmlbody":"<div><b>Kindly click on Verify Account to confirm your account.</b></div>","client_reference":"order-12345","bcc":[{"email_address":{"address":"archive@zylker.com","name":"Archive"}}],"attachments":[{"mime_type":"application/pdf","name":"invoice.pdf","content":"JVBERi0xLjQKJcTl8uXrp... (base64-encoded bytes)"},{"file_cache_key":"ea36f19a.a59e41437e3e1a1.h1.bbeabef0-d2c5-11f1-8876-2a30dd3b833c.1a18258b05f","name":"terms.pdf"}],"subject":"Account Confirmation","bounce_address":"bounce@bounce-zem.zylker.com","track_opens":true,"reply_to":[{"address":"support@zylker.com","name":"Support"}],"from":{"address":"accounts@info.zylker.com","name":"Paula"},"to":[{"email_address":{"address":"rudra.d@zylker.com","name":"Rudra"}}],"textbody":"Kindly click on Verify Account to confirm your account.","track_clicks":true}'

Sample Request Body

Copied!
  {
    "cc": [
      {
        "email_address": {
          "address": "manager@zylker.com",
          "name": "Manager"
        }
      }
    ],
    "htmlbody": "<div><b>Kindly click on Verify Account to confirm your account.</b></div>",
    "client_reference": "order-12345",
    "bcc": [
      {
        "email_address": {
          "address": "archive@zylker.com",
          "name": "Archive"
        }
      }
    ],
    "attachments": [
      {
        "mime_type": "application/pdf",
        "name": "invoice.pdf",
        "content": "JVBERi0xLjQKJcTl8uXrp... (base64-encoded bytes)"
      },
      {
        "file_cache_key": "ea36f19a.a59e41437e3e1a1.h1.bbeabef0-d2c5-11f1-8876-2a30dd3b833c.1a18258b05f",
        "name": "terms.pdf"
      }
    ],
    "subject": "Account Confirmation",
    "bounce_address": "bounce@bounce-zem.zylker.com",
    "track_opens": true,
    "reply_to": [
      {
        "address": "support@zylker.com",
        "name": "Support"
      }
    ],
    "from": {
      "address": "accounts@info.zylker.com",
      "name": "Paula"
    },
    "to": [
      {
        "email_address": {
          "address": "rudra.d@zylker.com",
          "name": "Rudra"
        }
      }
    ],
    "textbody": "Kindly click on Verify Account to confirm your account.",
    "track_clicks": true
  }
                
▼ Show full

Response Parameters

- HTTP code 200

Response Body - application/json
JSON Object
Show Sub-Attributes
dataJSON Array[object]
Show Sub-Attributes
codestringread-only
Example
EM_104
messagestringread-only
Example
OK
messagestringread-only
Example
OK
request_idstringread-only
Example
req-xxxx

- HTTP code 400

Response Body - application/json
JSON Object
Show Sub-Attributes
dataJSON Object
Show Sub-Attributes
error_codestringread-only
Example
TM_3004
messagestringread-only
Example
Invalid request
messagestringread-only
Example
error

Sample Response: HTTP 200

Copied!
  {
    "data": [
      {
        "code": "EM_104",
        "message": "OK"
      }
    ],
    "message": "OK",
    "request_id": "req-xxxx"
  }
                
▼ Show full

Sample Response: HTTP 400

Copied!
  {
    "data": {
      "error_code": "TM_3004",
      "message": "Invalid request"
    },
    "message": "error"
  }
                
▼ Show full