v1
latestOpenAPI 3.0.02026-07-2411724301.7 KBEmail
Send a single email
Send one email payload to one or more recipients (To/CC/BCC). Attachments supported; total payload ≤ 20 MB.
post/v2/{sid}/email/messages
Path parameters
sidstring required
Example:HXAP16XXXXXX97IN
Kaleyra Account SID (e.g., HXAP16XXXXXX97IN).
Headers
api-keystring required
Example:Ac4XXXXX21f
API Key generated by kaleyra.io. Example - Ac4XXXXX21f
Content-Typestring required
The format in which the data is sent.
Request body
Example request
{
"from": "no-reply@kaleyra.com",
"from_name": "No Reply Email from Kaleyra",
"to": "john.d@example.com,jack.l@example.com",
"cc": "liz.r@example.com",
"bcc": "bean.d@example.com",
"subject": "Sample Email from API",
"tag": "Invitation",
"type": "MKT",
"priority": 1,
"html_body": "<b>Hello</b>",
"html_content": "Hello, welcome!",
"text_body": "Hello",
"reply_to": "replyto@kaleyra.com",
"dynamic_content": true,
"params": {
"username": "Tom",
"quantity": "50",
"dMarketValue": "819167.0000",
"subjectBrandName": "samplebrandname"
},
"attachments": [
{
"content": "https://github.com/kaleyra/kaleyrapython/blob/master/requirements.txt",
"content_type": "text/plain",
"filename": "requirements.txt"
}
],
"callback_profile_id": "xxxxx_850bxx8a-bdc2-4axx-a0bd-xxa2b1b176d1",
"ref": "campaign2",
"ref1": "companyID",
"ref2": "productname",
"ref3": "segment_789",
"template_id": "6ffbe894-d0c2-4159-9f54-26ca774f1a06",
"template_name": "email-test-28",
"metadata": {
"quantity": "5000",
"dMarketValue": "8167.00",
"symbol": "PMBND"
}
}Response
Request accepted; messages queued for delivery.
Example response
{
"data": [
{
"message_id": "xxxxx56e-3be8-49ad-9fd9-xxxxx4b452f3:1",
"to": "recipient@gmail.com,recipient1@gmail.com",
"from": "sender@gmail.com",
"subject": "subject"
}
],
"error": {}
}