Get the list of mail services mailservice.list
Scope:
mailserviceWho can execute the method: any user
The method mailservice.list returns a list of active mail services.
Method Parameters
No parameters.
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/mailservice.list
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"auth": "**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/mailservice.list
try
{
const response = await $b24.callMethod('mailservice.list', {});
console.log(response.getData().result);
}
catch (error)
{
console.error(error);
}
try {
$response = $b24Service
->core
->call('mailservice.list', []);
$result = $response->getResponseData()->getResult();
print_r($result);
} catch (Throwable $e) {
echo $e->getMessage();
}
BX24.callMethod(
'mailservice.list',
{},
function(result)
{
if (result.error())
{
console.error(result.error());
}
else
{
console.log(result.data());
}
}
);
require_once('crest.php');
$result = CRest::call('mailservice.list', []);
print_r($result);
Response Handling
HTTP status: 200
{
"result": [
{
"ID": "1",
"SITE_ID": "s1",
"ACTIVE": "Y",
"SORT": "100",
"NAME": "gmail",
"SERVER": "imap.gmail.com",
"PORT": "993",
"ENCRYPTION": "Y",
"LINK": "https://mail.google.com/",
"ICON": "https://cdn.com.bitrix24.com/b17053/mail/mailservices/icon/ac0/ac08d334f35100d98c1a628f4f57f25c/post_gmail_icon.png",
"SMTP_SERVER": "smtp.gmail.com",
"SMTP_PORT": "465",
"SMTP_LOGIN_AS_IMAP": "Y",
"SMTP_PASSWORD_AS_IMAP": "Y",
"SMTP_ENCRYPTION": "Y",
"UPLOAD_OUTGOING": "N"
},
... // description for each mail service
],
"time": {
"start": 1774009798,
"finish": 1774009798.248488,
"duration": 0.2484879493713379,
"processing": 0,
"date_start": "2026-03-20T15:29:58+02:00",
"date_finish": "2026-03-20T15:29:58+02:00",
"operating_reset_at": 1774010398,
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
Array of objects with information about mail services. The structure of the mail service object is described in detail below |
|
time |
Information about the request execution time |
Mailservice Object
|
Name |
Description |
|
ID |
Identifier of the mail service |
|
SITE_ID |
Identifier of the site in Bitrix24 |
|
ACTIVE |
Service activity, values |
|
SORT |
Sort index |
|
NAME |
Name of the service |
|
SERVER |
IMAP server address in lowercase |
|
PORT |
IMAP server port |
|
ENCRYPTION |
Indicator of secure connection, values |
|
LINK |
Address of the service's web interface |
|
ICON |
Path to the service's logo image |
|
SMTP server, if configured |
|
|
SMTP port, if configured |
|
|
SMTP_LOGIN_AS_IMAP |
Use IMAP login for SMTP, values |
|
SMTP_PASSWORD_AS_IMAP |
Use IMAP password for SMTP, values |
|
Indicator of secure SMTP connection, values |
|
|
Indicator of uploading outgoing e-mails, values |
Error Handling
HTTP status: 400
{
"error": "ERROR_CORE",
"error_description": "No mail services found"
}
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
error_description |
Textual description of the error. The description is not intended to be shown to the end user in its raw form |
Possible Error Codes
|
Status |
Code |
Description |
Value |
|
|
ERROR_CORE |
No mail services found |
No active mail services |
Statuses and System Error Codes
HTTP Status: 20x, 40x, 50x
The errors described below may occur when calling any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not allowed to be called using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The methods must be called using the HTTPS protocol |
|
|
|
The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support |
|
|
|
The REST API is available only on commercial plans |
|
|
|
The user whose access token or webhook was used to call the method lacks permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
The user does not have access to the application. This means that the application is installed, but the account administrator has allowed access to this application only for specific users |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the option "Temporary closure of the public part of the site". Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |
Continue Learning
- Create Mail Service mailservice.add
- Update Mail Service mailservice.update
- Get the mailservice.get method
- Delete Mail Service mailservice.delete
- Get Mail Service Fields mailservice.fields