Email Sending API

Purpose

The API is used to send transactional emails.

Request URL

https://api.zeptomail.com/v1.1/email

Authorization token

You need to add send mail token to authenticate your API requests. This is a unique token that you can generate within your Mail Agent in your ZeptoMail account. Use the send mail token as a header when you call ZeptoMail REST Email Sending API.

Example

POST /v1.1/email

Query String:

Method: POST
HOST: https://api.zeptomail.com/v1.1/email
Header:
Authorization: zoho-enczapikey <space> <send mail token>

Steps to generate Send mail token:

  1. Navigate to the Mail Agents tab on the left panel of your ZeptoMail account and select a Mail Agent that you want to connect to your application.
  2. On the top right section, click on Setup Info (gear icon). This will open the Setup Details page.
  3. From here you can copy your Mail Agent specific send mail token under the API tab.
  4. You can use the default Send Mail Token or generate a new one.

Request Body (JSON object)

  • from* JSON object
    • Sender's details.
    • address String
      • Valid email address containing a verified domain.
    • name String
      • Sender's name.
  • to* JSON array
    • Recipient details.
    • email_address String
      • Contains information on the recipient details. Has the following parameters :
      • address String
        • Recipient email address field.
      • name String
        • Recipient's name.
  • cc JSON array
    • CC'd recipient details.
    • email_address String
      • Contains information on the cc'd recipient. Has the following parameters :
      • address String
        • CC recipient email address field.
      • name String
        • CC'd recipient's name.
  • bcc JSON array
    • BCC'd recipient details.
    • email_address String
      • Contains information on the bcc'd recipient. Has the following parameters :
      • address String
        • BCC recipient email address field.
      • name String
        • BCC'd recipient's name.
  • reply_to JSON array
    • Reply_to details.
    • email_address String
      • Contains information on the reply_to details. Has the following parameters :
      • address String
        • Email address field.
      • name String
        • Reply_to name's fields.
  • subject* String
    • Email's subject.
  • htmlbody String
    • Email body.
  • track_clicks Boolean
    • You can enable or disable email click tracking here.
    • You can also enable email click tracking in your Mail Agent under Email Tracking section.
    • Note: The API setting will override the Mail Agent settings in your ZeptoMail account. 
    • Allowed value - True : Enable email tracking.
                                  False : Disable email tracking.
  • track_opens Boolean
    • You can enable or disable email open tracking. 
    • You can also enable email open tracking in your Mail Agent under Email Tracking section.
    • Note: The API setting will override the Mail Agent settings in your ZeptoMail account. 
    • Allowed value - True : Enable email tracking.
                                  False : Disable email tracking. 
  • client_reference String
    • Identifier set by the user to track a particular transaction.
  • mime_headers JSON object
    • Additional headers sent in the email for your reference.
    • message String
      • Value sent with the email header.
  • attachements JSON array
    • The attachments you want to add to your transactional emails. Click here to view the list of unsupported formats. 
    • It can either be a base64 encoded content or file_cache_key or both.
    • name String
      • Attachment's name.
    • content String
      • Attachment's content.
      • Allowed value - Base64 encoded value of a file.
    • mime_type String
      • Indicates the content type in your attachment. 
      • Allowed value : Simple text message - plain/text ; Image file - image/jpg.
    • file_cache String
      • The unique key for your attached files in a Mail Agent.
      • Obtain file_cache_key from the File Cache section in your Mail Agent.
      • name String
        • File name of the file cache key available in the Mail Agent.
    • inline_images JSON array
      • This is the Inline image added to your email. 
      • Allowed value - base64 encoded content or a file cache key or both.
      • The base64 content contains mime-type, content and cid parameters.
      • cid String
        • the content id used by html body for content lookup. Each content should be given a separate cid value. 
        • Allowed value - base64 encoded content or file cache key or both.

 

Success response parameters

ParameterData Type Description
DataJSON array It consists of code, additional_info and message parameters
codeStringThe code corresponding to a success response
additional_infoJSON arrayProvides additional information about the action performed in the request
messageStringThe action taken for this request
messageStringThe status of the request made
request_idStringA unique id which is generated for every request
objectEmailIt signifies that the response is for email API

Failure response parameters

ParameterData Type Description
errorJSON object It consists of code, details, message and request_id parameters
codeStringThe code corresponding to the status of the request made
detailsJSON arrayConsists of code, message and target parameters
codeStringCode of the error found
messageStringReason for the error
targetStringThe field that caused the error
messageStringThe status of the request made
request_id StringUnique id generated for every request

HTTPS status code

Status codeDescription
2xxSuccess
4xx

Failure

Action needed by the user to fix the error

5xx

Failure

Action needed by ZeptoMail to fix the error

Error codes

Note:

Before you get started it is important to know that ZeptoMail is for sending transactional emails like welcome emailers, password resets emails, OTPs. We do not support sending of bulk emails or promotional emails like newsletters or marketing campaign emails. If you are looking for a bulk email provider, you can visit Zoho Campaigns.

Curl Request details

Copiedcurl "https://api.zeptomail.com/v1.1/email["](https://api.zeptomail.com/v1.1/email") \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-enczapikey ***" \
-d '{
"bounce_address":"bounces@info.zylker.com",
"from": { "address": "accounts@info.zylker.com", "name": "Paula"},
"to": [{"email_address": {"address": "Sara.d@zylker.com","name": "Sara"}}],
"subject":"Account Confirmation",
"htmlbody":"<div><b> Kindly click on Verify Account to confirm your account </b></div>",
"attachments": [
    {
        "file_cache_key":"ea36f19a.342fc7e29c25f1ed.h1.776d4400-9b3b-11ef-a4db-525400256d50.192faea6440"
    }
  ],
"client_reference":"reference",
"mime_headers":{"message":"value"},
}'