Send mail

Send emails from Bigin to the email addresses associated with records.

Request URL

{api-domain}/bigin/v2/{module_api_name}/{record_id}/actions/send_mail

Choose domain-specific URL to replace {api-domain}

You can use the domain-specific URL to access Bigin resources. Based on the data center in which the Bigin account's resources are available, replace {api-domain} in the preceding request with one of the following API domain URLs:

  • For US, https://www.zohoapis.com
  • For EU, https://www.zohoapis.eu
  • For AU, https://www.zohoapis.com.au
  • For IN, https://www.zohoapis.in
  • For CN, https://www.zohoapis.com.cn
  • For JP, https://www.zohoapis.jp

For more information, see Multi DC Support.

 

Authorization

For this endpoint, pass the access token as an authorization header. See OAuth Authentication for more information about access tokens.

Authorization: Zoho-oauthtoken <ACCESS_TOKEN>

You must authenticate using an access token that is associated with the following scope:

  • ZohoBigin.send_mail.all.CREATE

Request parameters

The available request parameters are given below:

Path parameters

module_api_name stringRequired

The API name of the module. The possible modules for this endpoint and their API name are given below:

ModuleAPI Name
ContactsContacts
PipelinesPipelines
CompaniesAccounts
record_id stringRequired

The unique identifier of the record to which the email will be sent. You can get the record ID from the Get records API.

 

Body parameters

from jsonobjectRequired

The sender's name and email address. You can obtain the allowed from-addresses from the Get configured from addresses API.

to jsonarrayRequired

The list of recipients' names and addresses that are associated with the Bigin records. Include multiple JSON objects if you want to email multiple users.

cc jsonarrayOptional

The list of users to be carbon copied (cc'd) on the email. Include multiple JSON objects if you want to cc multiple users.

bcc jsonarrayOptional

The recipient's name and email address to which the user may reply after receiving the email.

org_email booleanOptional

Indicates whether the mail is sent from the organization's email address. When set to true, the from-address will be used as the organization's email address instead of the configured SMTP server. The default value is false.

scheduled_time datetimeOptional

Use this parameter to specify the scheduled time for an email. The date and time should follow the ISO8601 format. Include this parameter only if you want to schedule an email.

subject stringOptional

The subject of the email.

content stringOptional

The body of the email. Can be in plain text or rich text.

mail_format stringOptional

The format of the email such as plain text or rich text. The value html indicates the rich text format and text indicates the plain text format.

attachments jsonarrayOptional

The list of encrypted Ids that you'll receive when you upload files to Bigin. Include multiple JSON objects if you want to attach multiple files.

Sample request

Copiedcurl "https://www.zohoapis.com/bigin/v2/Contacts/1908973000000450642/actions/send_mail" \
-X POST \
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf" \
-d "@newsendmail.json"

Sample request body

Copied{
    "data": [
        {
            "from": {
                "user_name": "Patricia Boyle",
                "email": "patricia.boyle@zoho.com"
            },
            "to": [
                {
                    "user_name": "Jason Smith",
                    "email": "jason.smith@zohocorp.com"
                }
            ],
            "cc": [
                {
                    "user_name": "user3",
                    "email": "user3email@zoho.com"
                }
            ],
            "bcc": [
                {
                    "user_name": "user4",
                    "email": "user4email@zoho.com"
                }
            ],
            "reply_to": {
                "user_name": "user5",
                "email": "patricia.boyle+reply@zoho.com"
            },
            "org_email": false,
            "scheduled_time": "2023-02-27T19:30:12+05:30",
            "subject": "Testing Send Mail API",
            "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)\"><img src=\"https://www.zohoapis.com/crm/viewInLineImage?fileContent=2cceafa194d037b63f2000181dd818646fd5e5167a274098b625c35654a20ed2\"></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",
            "attachments": [
                {
                    "id": "2cceafa194d037b63f2000181dd81864b4812b1f8b0b4fe0949a982de89fa75a"
                }
            ]
        }
    ]
}

Response object

The response object includes details regarding the message ID of the sent email, as well as success and status messages.

Possible error codes

The response of this resource includes HTTP status and error codes.

Copied{
    "data": [
        {
            "code": "SUCCESS",
            "details": {
                "message_id": "2cceafa194d037b63f2000181dd8186486f1eb0360aee76d802b6d376dea22e2"
            },
            "message": "Your mail has been scheduled successfully.",
            "status": "success"
        }
    ]
}