Skip to content

SMTP Settings

Configuration of the SMTP server used for sending outbound emails from the tenant.

OPTIONS /api/administration/smtp-settings/

Permissions

Requires authentication only.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
OPTIONS /api/administration/smtp-settings/

Response

  • Successful status 200 OK
  • Response body:
json
{
    "details": {
        "schema": [
            {
                "alias": "password",
                "type": "string",
                "required": true,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 128
                    }
                ]
            },
            {
                "alias": "host",
                "type": "string",
                "required": true,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 63
                    }
                ]
            },
            {
                "alias": "port",
                "required": true,
                "type": "int"
            },
            {
                "alias": "tls",
                "type": "bool"
            },
            {
                "alias": "username",
                "type": "string",
                "required": true,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 254
                    }
                ]
            },
            {
                "alias": "from_email",
                "type": "string",
                "required": true,
                "validators": [
                    {
                        "type": "email"
                    },
                    {
                        "type": "max_length",
                        "length": 254
                    }
                ]
            },
            {
                "alias": "failure_email",
                "type": "string",
                "required": true,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 255
                    },
                    {
                        "type": "max_value",
                        "length": 10
                    }
                ]
            },
            {
                "alias": "authorization_method",
                "type": "enum",
                "required": false,
                "values": [
                    {
                        "value": "username_and_password",
                        "text": "Username and Password"
                    },
                    {
                        "value": "microsoft_client_credentials",
                        "text": "Microsoft Client Credentials"
                    }
                ],
                "schema_by_authorization_method": [
                    {
                        "authorization_method": "username_and_password",
                        "schema": [
                            {
                                "alias": "password",
                                "type": "string",
                                "required": true,
                                "validators": [
                                    {
                                        "type": "max_length",
                                        "length": 128
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "authorization_method": "microsoft_client_credentials",
                        "schema": [
                            {
                                "alias": "authentication_object",
                                "type": "enum",
                                "required": true,
                                "autocomplete": "/api/authentication-objects/?provider=microsoft_client_credentials"
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

GET /api/administration/smtp-settings/

Permissions

Requires authentication and outbound_mail_setup.view permission.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
GET /api/administration/smtp-settings/

Response

KeyTypeNotes
usernamestring
portint
tlsbool
hoststring
from_emailstring
failure_emailstring
authorization_methodenumValues: username_and_password, microsoft_client_credentials
authentication_objectint
  • Successful status 200 OK
  • Response body schema:
json
{ 
 "username": "ticket.branch.mailserver@autologyx.net", 
 "port": 10587, 
 "tls": true, 
 "host": "clust.mx.nwc.xxx", 
 "from_email": "example1@email.com", 
 "failure_email": "example2@email.com, example9@email.com, example10@email.com, example11@email.com",
 "authorization_method": "username_and_password", 
 "authentication_object": null
}

Errors

ErrorResponse codeMessage
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."

PATCH /api/administration/smtp-settings/

Permissions

Requires authentication and outbound_mail_setup.edit permission.

Request

KeyTypeNotes
passwordstring
usernamestring
portint
tlsbool
hoststring
from_emailstring
failure_emailstring
authorization_methodenumValues: username_and_password, microsoft_client_credentials
authentication_objectintRequired when authorization_method is microsoft_client_credentials
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
PATCH /api/administration/smtp-settings/ 

{ 
   "password": "Passwod", 
   "username": "ticket.branch.mailserver@autologyx.net", 
   "port": 10587, 
   "tls": true, 
   "host": "clust.mx.nwc.xxx", 
   "from_email": "example1@email.com", 
   "failure_email": "example6@email.com, example7@email.com",
   "authorization_method": "microsoft_client_credentials",
   "authentication_object": 1
}

Response

KeyTypeNotes
usernamestring
portint
tlsbool
hoststring
from_emailstring
failure_emailstring
authorization_methodstring
authentication_objectint
  • Successful status 200 OK
  • Response body schema:
json
{ 
 "username": "ticket.branch.mailserver@autologyx.net", 
 "port": 10587, 
 "tls": true, 
 "host": "clust.mx.nwc.xxx", 
 "from_email": "example1@email.com", 
 "failure_email": "example6@email.com, example7@email.com",
 "authorization_method": "microsoft_client_credentials",
 "authentication_object": 1
}

Errors

CauseResponse codeMessage
"username" is empty string400 Bad Request"username": ["This field may not be blank."]
"username" is null400 Bad Request"username": ["This field may not be null."]
"username" has > 254 chars400 Bad Request"username": ["Ensure this field has no more than 254 characters."]
"password" is empty string400 Bad Request"password": ["This field may not be blank."]
"password" is null400 Bad Request"password": ["This field may not be null."]
"password" has > 128 chars400 Bad Request"password": ["Ensure this field has no more than 128 characters."]
"port" is required400 Bad Request"port": ["This field is required."]
"port" is invalid400 Bad Request"port": ["A valid integer is required."]
"port" < 0400 Bad Request"port": ["Ensure this value is greater than or equal to 0."]
"port" > 65535400 Bad Request"port": ["Ensure this value is less than or equal to 65535."]
"tls" invalid400 Bad Request"tls": ["Must be a valid boolean."]
"host" is required400 Bad Request"host": ["This field is required."]
"host" has > 63 chars400 Bad Request"host": ["Ensure this field has no more than 63 characters."]
"from_email" has > 254 chars400 Bad Request"from_email": ["Ensure this field has no more than 254 characters."]
"failure_email" has > 255 chars400 Bad Request"failure_email": ["Ensure this field has no more than 255 characters."]
"failure_email" has > 10 comma separated items400 Bad Request"failure_email": ["Up to 10 items allowed."]
"authorization_method" has invalid value400 Bad Request"authorization_method": ["{value} is not a valid choice."]
"authentication_object" is absent when "authorization_method" is "microsoft_client_credentials"400 Bad Request"authentication_object": ["This field is required."]
"authentication_object" has the wrong provider type for a given "authorization_method"400 Bad Request"authentication_object": ["{value} is not a valid choice."]
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."

POST /api/administration/smtp-settings/test/

Permissions

Requires authentication and outbound_mail_setup.edit permission.

Request

KeyTypeNotes
passwordstring
usernamestring
portint
tlsbool
hoststring
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
POST /api/administration/smtp-settings/test/ 

{ 
   "password": "Passwod", 
   "username": "ticket.branch.mailserver@autologyx.net", 
   "port": 10587, 
   "tls": true, 
   "host": "clust.mx.nwc.xxx",
   "authorization_method": "username_and_password"	
}

Response

KeyTypeNotes
statusstring
msgstring
  • Successful status 200 OK
  • Response body schema:
json
{
  "status":"OK",
  "msg":"Connection successfully tested."
}

Errors

CauseResponse codeMessage
"username" is empty string400 Bad Request"username": ["This field may not be blank."]
"username" is null400 Bad Request"username": ["This field may not be null."]
"username" has > 254 chars400 Bad Request"username": ["Ensure this field has no more than 254 characters."]
"password" is empty string400 Bad Request"password": ["This field may not be blank."]
"password" is null400 Bad Request"password": ["This field may not be null."]
"password" has > 128 chars400 Bad Request"password": ["Ensure this field has no more than 128 characters."]
"port" is required400 Bad Request"port": ["This field is required."]
"port" is invalid400 Bad Request"port": ["A valid integer is required."]
"port" < 0400 Bad Request"port": ["Ensure this value is greater than or equal to 0."]
"port" > 65535400 Bad Request"port": ["Ensure this value is less than or equal to 65535."]
"tls" invalid400 Bad Request"tls": ["Must be a valid boolean."]
"host" is required400 Bad Request"host": ["This field is required."]
"host" has > 63 chars400 Bad Request"host": ["Ensure this field has no more than 63 characters."]
Failure during Ms Graph testing400 Bad Request"detail": "Error. Please check username, authentication object and MS Graph settings"
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."