Send Batch Emails Using Template

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 using a pre-created CPaaS template.

Endpoint

Request URL

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

Request Parameters

- Request Headers

ApiKeyAuthAPI Key

API key of an agent. Send the header as Authorization: Zoho-enczapikey {apiKey}. The agent and account are derived from the key.

- Request Body

application/json
JSON Object
Show Sub-Attributes
ccarrayOptional

Array of CC recipient email addresses.

email_addressJSON ObjectOptional
Show Sub-Attributes
addressstringOptional
namestringOptional
template_keystringOptional

Unique key of the email template. Use either template_key or template_alias.

bccarrayOptional

Array of BCC recipient email addresses.

email_addressJSON ObjectOptional
Show Sub-Attributes
addressstringOptional
namestringOptional
attachmentsarrayOptional

Array of file attachments.

file_cache_keystringOptional
mime_typestringOptional
namestringOptional
contentstringOptional

Base64-encoded file content.

reply_toarrayOptional

Reply-to email address.

addressstringOptional
namestringOptional
fromobjectMandatory

The sender's email address and optional display name.

addressstringMandatory
namestringOptional
track_opensbooleanOptional

Enable or disable open tracking.

template_aliasstringOptional

Alias of the email template. Use either template_alias or template_key.

toJSON ArrayMandatory

List of recipients. Each recipient can have individual merge info.

Show Sub-Attributes
email_addressJSON ObjectOptional
Show Sub-Attributes
addressstringOptional
namestringOptional
merge_infoJSON ObjectOptional

Merge variables specific to this recipient.

Show Sub-Attributes
track_clicksbooleanOptional

Enable or disable click tracking.

Sample Request

Curl
Java
Python
Deluge
Copied!
curl --request POST \
  --url https://cpaas.zoho.com/v1.1/email/template/batch \
  --header 'Authorization: REPLACE_KEY_VALUE' \
  --header 'content-type: application/json' \
  --data '{"cc":[{"email_address":{"address":"manager@zylker.com","name":"Manager"}}],"template_key":"1234567890","bcc":[{"email_address":{"address":"archive@zylker.com","name":"Archive"}}],"attachments":[{"file_cache_key":"fc-xxxx-xxxx","mime_type":"application/pdf","name":"invoice.pdf","content":"string"}],"reply_to":[{"address":"support@zylker.com","name":"Support"}],"from":{"address":"accounts@info.zylker.com","name":"Paula"},"track_opens":true,"template_alias":"account-confirmation","to":[{"email_address":{"address":"accounts@info.zylker.com","name":"accounts"},"merge_info":{"property1":"string","property2":"string"}}],"track_clicks":true}'

Sample Request Body

Copied!
  {
    "cc": [
      {
        "email_address": {
          "address": "manager@zylker.com",
          "name": "Manager"
        }
      }
    ],
    "template_key": "1234567890",
    "bcc": [
      {
        "email_address": {
          "address": "archive@zylker.com",
          "name": "Archive"
        }
      }
    ],
    "attachments": [
      {
        "file_cache_key": "fc-xxxx-xxxx",
        "mime_type": "application/pdf",
        "name": "invoice.pdf",
        "content": "string"
      }
    ],
    "reply_to": [
      {
        "address": "support@zylker.com",
        "name": "Support"
      }
    ],
    "from": {
      "address": "accounts@info.zylker.com",
      "name": "Paula"
    },
    "track_opens": true,
    "template_alias": "account-confirmation",
    "to": [
      {
        "email_address": {
          "address": "accounts@info.zylker.com",
          "name": "accounts"
        },
        "merge_info": {
          "property1": "string",
          "property2": "string"
        }
      }
    ],
    "track_clicks": true
  }
                
▼ Show full

Response Parameters

- HTTP code 200

Response Body - application/json
JSON Object
Show Sub-Attributes
dataJSON Array
Show Sub-Attributes
codestring
messagestring
messagestring
request_idstring

- HTTP code 400

Response Body - application/json
JSON Object
Show Sub-Attributes
dataJSON Object
Show Sub-Attributes
error_codestring
messagestring
messagestring

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