get_mail_server¶
- ManagementApi.get_mail_server(role_id, server_id, projection_expression=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get a mail server
Returns one mail server and its SMTP HealthStatus. Requires system-settings.view. Password is not returned. Service users are rejected (GE-1014).
- Parameters:
role_id (str) – Amorphic role ID the request is authorized against. Must be a role the user belongs to. Also recorded in audit logs. (required)
server_id (str) – Mail server id (server-<uuid>). (required)
projection_expression (str) – Comma-separated attributes to keep on the returned object, including HealthStatus if listed.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: GET /mailservers/{server_id}
Success (HTTP 200)¶
mailservers is a single object, with HealthStatus set after an SMTP check.
Request / response example
{
"mailservers": {
"ServerId": "server-a2f7d3b1-8e5c-4a6f-9d1e-2b3c4d5e6f7a",
"ServerName": "corp-smtp",
"ServerDescription": "Corporate SMTP",
"Port": 587,
"Enabled": true,
"UserName": "smtp-user",
"AccountEmail": "alerts@example.com",
"LastModifiedTime": "2026-08-13 10:15:00",
"LastModifiedBy": "jane.doe",
"CreatedBy": "jane.doe",
"HealthStatus": "available"
}
}
Errors¶
Documented error codes: AUTH-1001, AUTH-1003, AUTH-1030, IPV-1002, GE-1014, GE-1008.
HTTP 400
Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: AUTH-1001, AUTH-1003, AUTH-1030 (missing system-settings.view), IPV-1002 (role_id not found, or unknown server_id), GE-1014 (service user).
role_id header missing
{
"Message": "AUTH-1001 - Missing role information in event header"
}
Caller lacks system-settings.view
{
"Message": "AUTH-1030 - User is not authorized to get details about the mail server due to the following missing permission(s) - {'System Settings': ['view']}"
}
server_id does not exist
{
"Message": "IPV-1002 - Invalid MailServerId - server-a2f7d3b1-8e5c-4a6f-9d1e-2b3c4d5e6f7a, resource not found."
}
Service user is not allowed
{
"Message": "GE-1014 - MailServer related operations are not supported for service users"
}
HTTP 500
Uncaught errors use {“Message”: “GE-1008 - Could not complete the request. Please try again.”}.
Uncaught handler failure
{
"Message": "GE-1008 - Could not complete the request. Please try again."
}