This method is intended for sending an email via the API when the Campaigns mailing functionality through the Service UI is not suitable for some reason. The data is transmitted in application/json format.
HTTP Request
- URL:
https://sender-solutions.com/api/emails/send-instant-email/ - HTTP Method: POST
- Content-Type:
application/json
Request Body (JSON)
{
"SendEmail": {
"TrackingSettings": {
"TrackLinks": true,
"TrackPlainTextLinks": true,
"TrackOpen": true,
"TrackUnsubscribe": true
},
"EmailSettings": {
"InlineImages": true,
"SendAt": 1769356236,
"UseDkim": true,
"UseDkimSelector": null
},
"Email": {
"To": [
{
"Email": "cat@example.com",
"Name": "Mr Cat"
}
],
"Cc": [],
"Bcc": [],
"ReplyTo": [],
"From": {
"Email": "info@example.org",
"Name": "MyCompany Title"
},
"Headers": [
{
"Name": "X-Request-Id",
"Value": "X-abc-123"
}
],
"Html": "<!doctype html>\r <html lang=\"en\">\r <head>\r <meta charset=\"UTF-8\">\r <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r <title>Test Email<\/title>\r <\/head>\r <body>\r <h1>Hello<\/h1>\r <p>Test email content<\/p>\r <\/body>\r <\/html>",
"PlainText": "Hello\r\nIt's test email content",
"Subject": "Test Email via API",
"Attachments": [
{
"ContentBase64": "VGVzdCBGaWxlIGNvbnRlbnQ=",
"ContentId": "ec91464b58363fac4924587afecf53d0",
"Disposition": "attachment",
"Filename": "Attachment12.txt",
"Type": "text/plain"
}
]
}
}
} Example request using cURL
curl --location 'https://sender-solutions.com/api/emails/send-instant-email/' \
--header 'Content-Type: application/json' \
--header 'Authorization: {{api-token}}' \
--data-raw '{
"SendEmail": {
"TrackingSettings": {
"TrackLinks": true,
"TrackPlainTextLinks": true,
"TrackOpen": true,
"TrackUnsubscribe": true
},
"EmailSettings": {
"InlineImages": true,
"SendAt": 1769356236,
"UseDkim": true,
"UseDkimSelector": null
},
"Email": {
"To": [
{
"Email": "cat@example.com",
"Name": "Mr Cat"
}
],
"Cc": [],
"Bcc": [],
"ReplyTo": [],
"From": {
"Email": "info@example.org",
"Name": "MyCompany Title"
},
"Headers": [
{
"Name": "X-Request-Id",
"Value": "X-abc-123"
}
],
"Html": "<!doctype html>\r <html lang=\"en\">\r <head>\r <meta charset=\"UTF-8\">\r <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r <title>Test Email<\/title>\r <\/head>\r <body>\r <h1>Hello<\/h1>\r <p>Test email content<\/p>\r <\/body>\r <\/html>",
"PlainText": "Hello\r\nIt'\''s test email content",
"Subject": "Test Email via API",
"Attachments": [
{
"ContentBase64": "VGVzdCBGaWxlIGNvbnRlbnQ=",
"ContentId": "ec91464b58363fac4924587afecf53d0",
"Disposition": "attachment",
"Filename": "Attachment12.txt",
"Type": "text/plain"
}
]
}
}
}'
Field Description
If a null value is sent in the fields SendEmail.TrackingSettings.* or SendEmail.EmailSettings.* (or if the field is not sent at all), the system will independently decide how to process the email. It is recommended to always specify all settings fields that are important to you so that the system behavior is predictable.
| Field | Type | Required | Description |
|---|---|---|---|
SendEmail.TrackingSettings.TrackLinks | boolean | null | This setting controls link click tracking. When enabled, links in the HTML part of the email will be modified to enable click tracking. | |
SendEmail.TrackingSettings.TrackPlainTextLinks | boolean | null | This setting controls link click tracking. When enabled, links in the plain text part of the email will be modified to enable click tracking. | |
SendEmail.TrackingSettings.TrackOpen | boolean | null | This setting controls email open tracking. | |
SendEmail.TrackingSettings.TrackUnsubscribe | boolean | null | This setting controls unsubscribe tracking. | |
SendEmail.EmailSettings.InlineImages | boolean | null | When enabled, the HTML part of the email will be optimized: external images will be added as inline attachments (they cannot be downloaded). Visually, the email will not change, but mail clients will have more trust in such an email. | |
SendEmail.EmailSettings.SendAt | int | null | The minimum send date of the email (Unix timestamp). Used for scheduled sending. | |
SendEmail.EmailSettings.UseDkim | boolean | null | Whether to use a DKIM signature. The system will automatically find a DKIM key suitable for this email. | |
SendEmail.EmailSettings.UseDkimSelector | string | null | The selector value of the DKIM key that should be used for signing. Providing a non-empty value for this property causes the system to treat SendEmail.EmailSettings.UseDkim as enabled, even if it was passed as false. If no suitable key with the specified selector is found, the system will try to find and use another DKIM key suitable for this email. | |
SendEmail.Email.To | array | An array of objects with Email and Name keys. Each object represents a separate email recipient. At least one recipient is required. | |
SendEmail.Email.CcSendEmail.Email.BccSendEmail.Email.ReplyTo | array | An array of objects with Email and Name keys. Each object represents a separate email address and adds it to the corresponding email header (Cc, Bcc, Reply-To). | |
SendEmail.Email.To.*.Email | string | The recipient’s email address. This field is required for each object in SendEmail.Email.To.*. | |
SendEmail.Email.To.*.Name | string | The recipient’s name. It is recommended to specify this field if the value is available. | |
SendEmail.Email.Cc.*.EmailSendEmail.Email.Bcc.*.EmailSendEmail.Email.ReplyTo.*.Email | string | The email address. This field is required for each element in the Cc, Bcc, and Reply-To arrays. The arrays themselves are optional, but if an element is provided, the Email field must be specified. | |
SendEmail.Email.Cc.*.NameSendEmail.Email.Bcc.*.NameSendEmail.Email.ReplyTo.*.Name | string | The recipient’s name. It is recommended to specify this field if the value is available. | |
SendEmail.Email.From.Email | string | The sender’s email address. Based on this address, the sending domain will be determined. This domain must be added to the project in the Personal Account and its ownership must be confirmed. | |
SendEmail.Email.From.Name | string | The sender’s name. It is recommended to specify this field so recipients can easily understand who the email is from. | |
SendEmail.Email.Headers | array | An array of objects containing string properties Name and Value. These headers will be added to the email. Some headers are protected and cannot be added or overridden via the API. Only pass headers that are truly necessary. | |
SendEmail.Email.Html | string | The HTML content of the email. It may be empty or omitted if the SendEmail.Email.PlainText field is provided. | |
SendEmail.Email.PlainText | string | The plain text version of the email. It may be empty or omitted if the SendEmail.Email.Html field is provided. | |
SendEmail.Email.Subject | string | The email subject. | |
SendEmail.Email.Attachments | array | An array of objects, each representing an attachment. Attachments are optional. If provided, all fields are required except ContentId, which is required only for attachments with Disposition = inline. | |
SendEmail.Email.Attachments.*.ContentBase64 | string | The attachment content encoded in base64. | |
SendEmail.Email.Attachments.*.ContentId | string | The attachment ContentId. It must be unique within a single email and is required for attachments with Disposition = inline. | |
SendEmail.Email.Attachments.*.Disposition | string | Defines the attachment type. Possible values: attachment — a downloadable attachment, and inline — an attachment used inside the email body. | |
SendEmail.Email.Attachments.*.Filename | string | The attachment filename. | |
SendEmail.Email.Attachments.*.Type | string | The MIME type of the attachment, for example application/pdf. |
Example of a Successful Response
{
"success": true,
"SendEmail": {
"SendMessageRequestId": 49,
"MessageId": "1vb1rzxzem2naah3dxp3t9k6zoj9d4hc@sender-solutions.com"
}
} In the response body, the SendEmail.SendMessageRequestId field represents the unique identifier of the task responsible for sending a single email. The SendEmail.MessageId field represents the unique value of the Message-ID email header.
This information may be useful for making other API requests or when contacting technical support.