Get the mailservice.get method
If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.
Scope:
mailserviceWho can execute the method: any user
The mailservice.get method returns the parameters of the mail service by its identifier.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
ID* |
Identifier of the mail service. You can obtain the identifier using the mailservice.list method. |
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"ID": 31}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/mailservice.get
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"ID": 31, "auth": "**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/mailservice.get
try
{
const response = await $b24.callMethod(
'mailservice.get',
{ ID: 31 }
);
console.log(response.getData().result);
}
catch (error)
{
console.error(error);
}
try {
$response = $b24Service
->core
->call(
'mailservice.get',
['ID' => 31]
);
$result = $response->getResponseData()->getResult();
print_r($result);
} catch (Throwable $e) {
echo $e->getMessage();
}
BX24.callMethod(
'mailservice.get',
{ ID: 31 },
function(result)
{
if (result.error())
{
console.error(result.error());
}
else
{
console.log(result.data());
}
}
);
require_once('crest.php');
$result = CRest::call(
'mailservice.get',
['ID' => 31]
);
print_r($result);
Response Handling
HTTP status: 200
{
"result": {
"ID": "31",
"SITE_ID": "s1",
"ACTIVE": "N",
"SORT": "600",
"NAME": "Updated mail service",
"SERVER": "imap.my2-mail.com",
"PORT": "993",
"ENCRYPTION": "Y",
"LINK": "https://mail.my2-mail.com/",
"ICON": null,
"SMTP_SERVER": null,
"SMTP_PORT": null,
"SMTP_LOGIN_AS_IMAP": "N",
"SMTP_PASSWORD_AS_IMAP": "N",
"SMTP_ENCRYPTION": null,
"UPLOAD_OUTGOING": null
},
"time": {
"start": 1774009408,
"finish": 1774009408.234421,
"duration": 0.2344210147857666,
"processing": 0,
"date_start": "2026-03-20T15:23:28+02:00",
"date_finish": "2026-03-20T15:23:28+02:00",
"operating_reset_at": 1774010008,
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
Parameters of the mail service. The structure of the object is described in detail below |
|
time |
Information about the execution time of the request |
Object result
|
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 |
Secure connection indicator, 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 |
|
Secure SMTP connection indicator, values |
|
|
Indicator of uploading outgoing emails, values |
Error Handling
HTTP status: 400
{
"error": "ERROR_CORE",
"error_description": "Mail service not 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 |
|
|
|
Mail service ID not specified |
Required parameter |
|
|
|
Mail service not found |
Mail service with the specified |
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 permitted for calls using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The HTTPS protocol is required for method calls |
|
|
|
The REST API is blocked due to overload. This is a manual individual block; please contact Bitrix24 technical support to lift it |
|
|
|
The REST API is only available on commercial plans |
|
|
|
The user associated with the access token or webhook used to call the method lacks the necessary 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 portal administrator has restricted access to this application to specific users only |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the "Temporary closure of the public part of the site" option. 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 list of mail services mailservice.list
- Delete Mail Service mailservice.delete
- Get Mail Service Fields mailservice.fields