POST
/
webhook
/
mail
/
send-direct
cURL
curl --request POST \
  --url https://webhook.cocoonmail.com/webhook/mail/send-direct \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email_content": "<string>",
  "sender": "<string>",
  "subject": "<string>",
  "to": [
    {
      "email": "recipient@example.com",
      "name": "John Doe"
    }
  ],
  "reply_to": "<string>",
  "cc": "<array>",
  "attachments": [
    {
      "filename": "document.pdf",
      "contentType": "application/pdf",
      "data": "U29tZSBiYXNlNjQtZW5jb2RlZCBkYXRh"
    }
  ]
}
'
{
    "success": true,
    "message": "Direct transactional email send completed",
    "sent_recipients": ["example2@example.com", "example1@example.com"],
    "failed_recipients": [],
    "invalid_recipients": []
}

Send direct email

Emails are delivered directly without Cocoonmail storing any data from the sending process, such as reports or analytics.
Note that your transactional email usage count will still reflect the emails sent.

Parameters

NameTypeRequiredDescription
email_contentstringYesThe rich HTML or text content of the email.
senderstringYesEmail address of the sender.
subjectstringYesSubject line of the email.
reply_tostringNoValid email address for replies.
ccarrayNoList of CC recipient addresses.
toarrayYesList of recipient objects.
attachmentsarrayNoList of attachment objects (Base64).

Response fields

Status CodeDescription
201Email sent successfully
400Bad request
401Authentication required
500Internal server error
{
    "success": true,
    "message": "Direct transactional email send completed",
    "sent_recipients": ["example2@example.com", "example1@example.com"],
    "failed_recipients": [],
    "invalid_recipients": []
}

Authorizations

Authorization
string
header
required

Use your API key with the 'Bearer ' prefix

Body

application/json

Emails are delivered directly without Cocoonmail storing any data from the sending process, such as reports or analytics. Note that your transactional email usage count will still reflect the emails sent.

email_content
string
required

Email content

sender
string
required

From email address

subject
string
required

Email subject

to
object[]
required

Email address of the recipient.

reply_to
string

Valid email address.

cc
array

Email address of the CC recipient.

attachments
object[]

Attachment

Response

Email sent successfully.

success
boolean
Example:

true

message
string
Example:

"Direct transactional email send completed"

sent_recipients
string<email>[]
Example:
[
"example2@example.com",
"example1@example.com"
]
failed_recipients
string<email>[]
Example:
[]
invalid_recipients
string<email>[]
Example:
[]