Zoho CRM Send Mail

API to send emails to a record's email ID through Zoho CRM. Published by Zoho in its first-party OpenAPI 3.1.0 repository github.com/zoho/crm-oas; 1 operation(s).

OpenAPI Specification

zoho-crm-send-mail-openapi.json Raw ↑
{
  "openapi": "3.1.0",
  "info": {
    "title": "Send Mail",
    "description": "API to send emails to a record's email ID through Zoho CRM.",
    "version": "8"
  },
  "servers": [
    {
      "url": "https://zohoapis.{dc}/crm/{version}",
      "description": "API Server URL",
      "variables": {
        "dc": {
          "enum": [
            "com",
            "eu",
            "in",
            "cn",
            "au",
            "jp",
            "ca",
            "sa"
          ],
          "default": "com",
          "description": "API Server URL TLD"
        },
        "version": {
          "default": "v8",
          "description": "API version"
        }
      }
    }
  ],
  "paths": {
    "/{moduleName}/{id}/actions/send_mail": {
      "post": {
        "operationId": "sendMail",
        "summary": "Send an email to a record",
        "description": "Sends an email using specific templates or custom content to a record in a given module.",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.send_mail.all.CREATE"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ModuleName"
          },
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "description": "Email details including sender, recipients, and content.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMailRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Mail sent successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Validation or Logic Error",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/StandardErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/FlatErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Permission or Confirmation Required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlatErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "ModuleName": {
        "name": "moduleName",
        "in": "path",
        "description": "The API name of the module",
        "required": true,
        "schema": {
          "type": "string",
          "maxLength": 100,
          "description": "Module API name"
        }
      },
      "Id": {
        "name": "id",
        "in": "path",
        "description": "The unique ID of the record",
        "required": true,
        "schema": {
          "type": "string",
          "maxLength": 100,
          "description": "Record ID"
        }
      }
    },
    "schemas": {
      "SendMailRequest": {
        "type": "object",
        "description": "Root object for the send mail request.",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "description": "List of mail objects.",
            "maxItems": 1,
            "items": {
              "type": "object",
              "description": "Detailed email configuration.",
              "additionalProperties": false,
              "required": [
                "from",
                "to"
              ],
              "properties": {
                "from": {
                  "$ref": "#/components/schemas/EmailUser"
                },
                "to": {
                  "type": "array",
                  "description": "Primary recipients",
                  "maxItems": 50,
                  "items": {
                    "$ref": "#/components/schemas/EmailUser"
                  }
                },
                "cc": {
                  "type": "array",
                  "description": "CC recipients",
                  "maxItems": 50,
                  "items": {
                    "$ref": "#/components/schemas/EmailUser"
                  }
                },
                "bcc": {
                  "type": "array",
                  "description": "BCC recipients",
                  "maxItems": 50,
                  "items": {
                    "$ref": "#/components/schemas/EmailUser"
                  }
                },
                "reply_to": {
                  "$ref": "#/components/schemas/EmailUser"
                },
                "subject": {
                  "type": "string",
                  "description": "Email subject",
                  "maxLength": 1000
                },
                "content": {
                  "type": "string",
                  "description": "Body content",
                  "maxLength": 100000
                },
                "mail_format": {
                  "type": "string",
                  "description": "Format",
                  "enum": [
                    "html",
                    "text"
                  ]
                },
                "org_email": {
                  "type": "boolean",
                  "description": "Send via org email"
                },
                "scheduled_time": {
                  "type": "string",
                  "description": "ISO8601 time",
                  "format": "date-time"
                },
                "consent_email": {
                  "type": "boolean",
                  "description": "GDPR consent flag"
                },
                "template": {
                  "type": "object",
                  "description": "Template reference",
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Template ID",
                      "maxLength": 100
                    }
                  }
                },
                "inventory_details": {
                  "type": "object",
                  "description": "Inventory details",
                  "additionalProperties": false,
                  "properties": {
                    "inventory_template": {
                      "type": "object",
                      "description": "Inventory template object",
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "ID",
                          "maxLength": 100
                        },
                        "name": {
                          "type": "string",
                          "description": "Name",
                          "maxLength": 100
                        }
                      }
                    },
                    "paper_type": {
                      "type": "string",
                      "description": "Paper size",
                      "enum": [
                        "default",
                        "A4",
                        "us_letter"
                      ]
                    },
                    "view_type": {
                      "type": "string",
                      "description": "Orientation",
                      "enum": [
                        "portrait",
                        "landscape"
                      ]
                    }
                  }
                },
                "data_subject_request": {
                  "type": "object",
                  "description": "GDPR request details",
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Request ID",
                      "maxLength": 100
                    },
                    "type": {
                      "type": "string",
                      "description": "Request type",
                      "enum": [
                        "access",
                        "rectify",
                        "export"
                      ]
                    }
                  }
                },
                "attachments": {
                  "type": "array",
                  "description": "ZFS file IDs",
                  "maxItems": 10,
                  "items": {
                    "type": "object",
                    "description": "File object",
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "File ID",
                        "maxLength": 255
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "EmailUser": {
        "type": "object",
        "description": "User email and name details.",
        "additionalProperties": false,
        "required": [
          "email"
        ],
        "properties": {
          "user_name": {
            "type": "string",
            "description": "Name",
            "maxLength": 255
          },
          "email": {
            "type": "string",
            "description": "Email address",
            "maxLength": 255
          }
        }
      },
      "SuccessResponse": {
        "type": "object",
        "description": "Successful operation response.",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "description": "Results list",
            "maxItems": 10,
            "items": {
              "type": "object",
              "description": "Status item",
              "additionalProperties": false,
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Code",
                  "enum": [
                    "SUCCESS"
                  ]
                },
                "status": {
                  "type": "string",
                  "description": "Status",
                  "enum": [
                    "success"
                  ]
                },
                "message": {
                  "type": "string",
                  "description": "Message",
                  "maxLength": 500
                },
                "details": {
                  "type": "object",
                  "description": "Meta details",
                  "additionalProperties": false,
                  "properties": {
                    "message_id": {
                      "type": "string",
                      "description": "Message ID",
                      "maxLength": 255
                    }
                  }
                }
              }
            }
          }
        }
      },
      "StandardErrorResponse": {
        "type": "object",
        "description": "Error data wrapper.",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "description": "Errors list",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            }
          }
        }
      },
      "FlatErrorResponse": {
        "type": "object",
        "description": "Flat error object.",
        "additionalProperties": false,
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code",
            "maxLength": 100
          },
          "details": {
            "type": "object",
            "description": "Details",
            "additionalProperties": true
          },
          "message": {
            "type": "string",
            "description": "Message",
            "maxLength": 1000
          },
          "status": {
            "type": "string",
            "description": "Status",
            "maxLength": 100
          }
        }
      },
      "ErrorDetail": {
        "type": "object",
        "description": "Individual error item.",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "description": "Code",
            "maxLength": 100
          },
          "details": {
            "type": "object",
            "description": "Details",
            "additionalProperties": true
          },
          "message": {
            "type": "string",
            "description": "Message",
            "maxLength": 1000
          },
          "status": {
            "type": "string",
            "description": "Status",
            "maxLength": 100
          }
        }
      }
    },
    "securitySchemes": {
      "iam-oauth2-schema": {
        "type": "oauth2",
        "description": "Zoho OAuth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://accounts.zoho.com/oauth/v2/auth",
            "tokenUrl": "https://accounts.zoho.com/oauth/v2/token",
            "scopes": {
              "ZohoCRM.send_mail.all.CREATE": "Send mail"
            }
          }
        }
      }
    }
  }
}