Expand a method to see parameters and responses.
POST
Sending a letter to the specified address
/api/v2/sendEmail
Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| token | formData | string | Yes | Your API key |
| sender_email | formData | string | Yes | The email address of the sender from whom the letter will be sent |
| sender_name | formData | string | No | Sender name |
| subject | formData | string | Yes | Letter title |
| message | formData | string | Yes | Letter contents |
| attachment | formData | file | No | Attached file |
| formData | string | Yes | Recipient's email address | |
| d_schedule | formData | string | No | If you want to delay sending the letter, specify the sending date here in the format 'YYYY-MM-DD HH:MM' |
| track_open | formData | number | No | 1: track email opening, 0: do not track. If not specified, will be set to 1. |
| track_click | formData | number | No | 1: track clicks on links in the email, 0: do not track. If not specified, will be set to 1. |
Responses
200 — Completed successfully
{
"status": "OK",
"result": {
"email_id": 1234567
}
}
POST
Sending a letter to a mailing list
/api/v2/sendEmailByList
Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| token | formData | string | Yes | Your API key |
| name | formData | string | No | Mailing list name. If not specified, it will be generated automatically |
| list_id | formData | number | Yes | Mailing list ID |
| sender_email | formData | string | Yes | The email address of the sender from whom the letter will be sent |
| sender_name | formData | string | No | Sender name |
| subject | formData | string | Yes | Letter title |
| message | formData | string | Yes | Letter contents |
| attachment | formData | file | No | Attached file |
| d_schedule | formData | string | No | Time of sending the message, specified in the format 'YYYY-MM-DD HH:MM'. If not specified, sending of letters will begin immediately |
| track_open | formData | number | No | 1: track email opening, 0: do not track. If not specified, will be set to 1. |
| track_click | formData | number | No | 1: track clicks on links in the email, 0: do not track. If not specified, will be set to 1. |
Responses
200 — Completed successfully
{
"status": "OK",
"result": {
"message_id": 1234,
"count_emails": 100
}
}
POST
Viewing the list of mailing recipients with delivery statuses
/api/v2/getEmailDeliveryList
Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| token | formData | string | Yes | Your API key |
| message_id | formData | number | Yes | Mailing list ID |
Responses
200 — Completed successfully
{
"status": "OK",
"result": [
{
"email_id": "654321",
"email": " email1@email.by",
"status": "DELIVERED",
"error": ""
},
{
"email_id": "654322",
"email": "email2@emailby",
"status": "UNDELIVERED",
"error": "Bad recipient address syntax"
}
]
}
POST
Sending letters to multiple addresses, as well as personal letters in batch mode
If you need to send one email to multiple addresses, then set the 'message_type' parameter to 'bulk'…
/api/v2/sendBulkEmail
'delivery_list': [
'email1@mail.com',
'email2@mail.com',
]
If you need to send each email to a separate address, use 'message_type': 'personal', passing the header, message content, and address each time:
'delivery_list': [
{
'email': 'email1@mail.com',
'subject': 'Letter Heading 1',
'message': 'Letter 1'
},
{
'email': 'email2@mail.com',
'subject': 'Letter Heading 2',
'message': 'Letter 2'
}
API request examples
{
'token': 'eyJpdiI6Ij...',
'name': 'Newsletter №1',
'sender_email': 'from@test.com',
'sender_name': 'SENDER',
'message_type': 'bulk',
'subject': 'Letter Heading',
'message': 'Letter',
'd_schedule': '2024-12-31 12:00',
'track_open': '1',
'track_click': '1',
'delivery_list': [
'email1@mail.com',
'email2@mail.com'
]
}
{
'token': 'eyJpdiI6Ij...',
'name': 'Newsletter №2',
'sender_email': 'from@test.com',
'sender_name': 'SENDER',
'message_type': 'personal',
'd_schedule': '2024-12-31 12:00',
'track_open': '1',
'track_click': '1',
'delivery_list': [
{
'email': 'email1@mail.com',
'subject': 'Letter Heading 1',
'message': 'Letter 1'
},
{
'email': 'email2@mail.com',
'subject': 'Letter Heading 2',
'message': 'Letter 2'
}
]
}Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| token | formData | string | Yes | Your API key |
| name | formData | string | No | Mailing list name. If not specified, it will be generated automatically. |
| sender_email | formData | string | Yes | The email address of the sender from whom the letter will be sent |
| sender_name | formData | string | No | Sender's name |
| message_type | formData | string | No | Multiple sending type, default is bulk |
| subject | formData | string | Yes | Letter heading |
| message | formData | string | Yes | Contents of the letter |
| d_schedule | formData | string | No | Message sending time, specified in the format 'YYYY-MM-DD HH:MM'. If not specified, sending of letters will begin immediately. |
| track_open | formData | number | No | 1: track email opening, 0: do not track. If not specified, will be set to 1. |
| track_click | formData | number | No | 1: track clicks on links in the email, 0: do not track. If not specified, will be set to 1. |
| delivery_list[0] | formData | string | No | First recipient address |
| delivery_list[1] | formData | string | No | Second recipient's address |
Responses
200 — Completed successfully
{
"status": "OK",
"result": {
"uuid": "cc9c8043-8caf-11ef-b035-9e8f47954dec"
}
}
POST
Get email statuses and errors, if any, from a mailing created using the sendBulkEmail method
/api/v2/statusBulkEmail
Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| token | formData | string | Yes | Your API key |
| uuid | formData | string | Yes | UUID received in the response of the sendBulkEmail method |
Responses
200 — Completed successfully
{
"status": "OK",
"result": [
{
"message_id": "12345",
"name": "Newsletter name",
"sender_email": "from@test.com",
"sender_name": "SENDER",
"success": [
{
"email_id": "654321",
"recipient": "email1@mail.com",
"status": "DELIVERED",
"error": null
},
{
"email_id": "654322",
"recipient": "email2@mail.com",
"status": "OPEN",
"error": null
}
],
"errors": [
{
"email": "email3@mail",
"error": "The recipient's email address is incorrect"
}
]
}
]
}
POST
Adding an address to the list of those who have unsubscribed from email newsletters
/api/v2/unsubscribeEmail
Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| token | formData | string | Yes | Your API key |
| formData | string | Yes | Email address to unsubscribe from | |
| list_ids | formData | string | No | Comma-separated mailing list IDs from which the email address will be unsubscribed. If the parameter is not passed, the email address will be unsubscribed from all mailing lists. |
| reason | formData | string | No | Unsubscribe comment |
Responses
200 — Completed successfully
{
"status": "OK"
}
POST
Removing an address from the list of those who have unsubscribed from email newsletters
/api/v2/subscribeEmail
Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| token | formData | string | Yes | Your API key |
| formData | string | Yes | Email address | |
| list_ids | formData | string | No | Comma separated mailing list IDs for which the unsubscription will be unsubscribed. If the parameter is not passed, the email address will be unsubscribed for all mailing lists. |
Responses
200 — Completed successfully
{
"status": "OK"
}
POST
Get all email templates
/api/v2/getEmailTemplates
Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| token | query | string | Yes | Your API key |
Responses
200 — Completed successfully
{
"status": "OK",
"result": [
{
"id": 11,
"title": "Template name"
},
{
"id": 12,
"title": "Name of the second template"
}
]
}
