Configure a mail server

put

/api/20210901/system/mail/server

Configure an email server to deliver reports and visualizations.

Request

There are no request parameters for this operation.

Supported Media Types
Request Body - application/json ()
Root Schema : schema
Type: object
Mail server used to deliver visualizations and reports to users by email.
Show Source
  • Discriminator: authType
    Discriminator: { "propertyName":"authType", "mapping":{ "NO_AUTH":"#/components/schemas/MailServerNoAuth", "USERNAME_PASSWORD_AUTH":"#/components/schemas/MailServerUsernamePasswordAuth", "OAUTH2_AUTH":"#/components/schemas/MailServerOAuth2Auth" } }
    Mail server authentication type.
  • Discriminator: connectionSecurityType
    Discriminator: { "propertyName":"connectionSecurityType", "mapping":{ "NO_CONNECTION_SECURITY":"#/components/schemas/NoConnectionSecurity", "SSL_TLS_CONNECTION_SECURITY":"#/components/schemas/SslTlsConnectionSecurity", "START_TLS_CONNECTION_SECURITY":"#/components/schemas/StartTlsConnectionSecurity" } }
    Connection security options for the mail server connection.
  • Minimum Length: 1
    Host name of the SMTP server you want to use to deliver emails. The SMTP server must be accessible from the public internet.
  • Minimum Value: 1
    Maximum Value: 65535
    Port number on the mail server. Common SMTP ports include: 25 (no security), 465 (SSL TLS), 587 (STARTTLS)
  • MailSender
    Sender of emails
Nested Schema : Discriminator: authType
Type: object
Discriminator: authType

Discriminator Values

Mail server authentication type.
Match One Schema
Show Source
Nested Schema : Discriminator: connectionSecurityType
Type: object
Discriminator: connectionSecurityType

Discriminator Values

Connection security options for the mail server connection.
Match One Schema
Show Source
Nested Schema : MailSender
Type: object
Sender of emails
Show Source
Nested Schema : MailServerNoAuth
Type: object
Mail server doesn???t require authentication.
Show Source
Nested Schema : MailServerUsernamePasswordAuth
Type: object
Mail server authentication requires a username and password.
Show Source
Nested Schema : MailServerOAuth2Auth
Type: object
Mail server authentication uses OAuth2
Show Source
Nested Schema : authType
No authentication type
Default Value: NO_AUTH
Match All
No authentication type
Show Source
  • Allowed Values: [ "NO_AUTH", "USERNAME_PASSWORD_AUTH", "OAUTH2_AUTH" ]
    Type of authentication the mail server requires.
Nested Schema : authType
Username and password required for authentication.
Default Value: USERNAME_PASSWORD_AUTH
Match All
Username and password required for authentication.
Show Source
  • Allowed Values: [ "NO_AUTH", "USERNAME_PASSWORD_AUTH", "OAUTH2_AUTH" ]
    Type of authentication the mail server requires.
Nested Schema : authType
OAuth2 AuthType
Default Value: OAUTH2_AUTH
Match All
OAuth2 AuthType
Show Source
  • Allowed Values: [ "OSS_AUTH_OCI_USER_ID", "OCI_RESOURCE_PRINCIPAL" ]
    Type of authentication.
Nested Schema : Discriminator: oAuth2Provider
Type: object
Discriminator: oAuth2Provider

Discriminator Values

Configuration details for a specific OAuth2 provider.
Match One Schema
Show Source
Nested Schema : MailServerMSOAuth2
Type: object
Mail server authentication that uses the Microsoft OAuth2 client credential flow.
Show Source
Nested Schema : oAuth2Provider
Specific OAuth2 AuthType
Default Value: MS_OAUTH2
Match All
Specific OAuth2 AuthType
Show Source
  • Allowed Values: [ "MS_OAUTH2" ]
    OAuth2 services provider.
Nested Schema : NoConnectionSecurity
Type: object
No conection security.
Show Source
Nested Schema : SslTlsConnectionSecurity
Type: object
SSL TLS security for the mail server connection.
Show Source
Nested Schema : StartTlsConnectionSecurity
Type: object
STARTTLS security for the mail server connection.
Show Source
Nested Schema : connectionSecurityType
No connection security.
Default Value: NO_CONNECTION_SECURITY
Match All
No connection security.
Show Source
  • Allowed Values: [ "NO_CONNECTION_SECURITY", "SSL_TLS_CONNECTION_SECURITY", "START_TLS_CONNECTION_SECURITY" ]
    Type of security on the mail server connection.
Nested Schema : connectionSecurityType
SSL TLS connection security.
Default Value: SSL_TLS_CONNECTION_SECURITY
Match All
SSL TLS connection security.
Show Source
  • Allowed Values: [ "NO_CONNECTION_SECURITY", "SSL_TLS_CONNECTION_SECURITY", "START_TLS_CONNECTION_SECURITY" ]
    Type of security on the mail server connection.
Nested Schema : Discriminator: certificateType
Type: object
Discriminator: certificateType

Discriminator Values

Certificate for SSL TLS or START TLS connection security.
Match One Schema
Show Source
Nested Schema : DefaultTlsCertificate
Type: object
Use the default certificate provided for an SSL-enabled mail server.
Show Source
Nested Schema : CustomTlsCertificate
Type: object
Use a custom TLS certificate for an SSL-enabled mail server.
Show Source
Nested Schema : certificateType
Use the mail server???s default TLS certificate.
Default Value: DEFAULT_TLS_CERTIFICATE
Match All
Use the mail server???s default TLS certificate.
Show Source
  • Allowed Values: [ "DEFAULT_TLS_CERTIFICATE", "CUSTOM_TLS_CERTIFICATE" ]
    Type of TLS certificate, default or custom.
Nested Schema : certificateType
CustomTlsCertificate CertificateType
Default Value: CUSTOM_TLS_CERTIFICATE
Match All
CustomTlsCertificate CertificateType
Show Source
  • Allowed Values: [ "DEFAULT_TLS_CERTIFICATE", "CUSTOM_TLS_CERTIFICATE" ]
    Type of TLS certificate, default or custom.
Nested Schema : connectionSecurityType
STARTTLS connection security.
Default Value: START_TLS_CONNECTION_SECURITY
Match All
STARTTLS connection security.
Show Source
  • Allowed Values: [ "NO_CONNECTION_SECURITY", "SSL_TLS_CONNECTION_SECURITY", "START_TLS_CONNECTION_SECURITY" ]
    Type of security on the mail server connection.
Back to Top

Response

Supported Media Types

200 Response

Mail server successfully configured.
Body ()
Root Schema : schema
Type: object
Mail server used to deliver visualizations and reports to users by email.
Show Source
  • Discriminator: authType
    Discriminator: { "propertyName":"authType", "mapping":{ "NO_AUTH":"#/components/schemas/MailServerNoAuth", "USERNAME_PASSWORD_AUTH":"#/components/schemas/MailServerUsernamePasswordAuth", "OAUTH2_AUTH":"#/components/schemas/MailServerOAuth2Auth" } }
    Mail server authentication type.
  • Discriminator: connectionSecurityType
    Discriminator: { "propertyName":"connectionSecurityType", "mapping":{ "NO_CONNECTION_SECURITY":"#/components/schemas/NoConnectionSecurity", "SSL_TLS_CONNECTION_SECURITY":"#/components/schemas/SslTlsConnectionSecurity", "START_TLS_CONNECTION_SECURITY":"#/components/schemas/StartTlsConnectionSecurity" } }
    Connection security options for the mail server connection.
  • Minimum Length: 1
    Host name of the SMTP server you want to use to deliver emails. The SMTP server must be accessible from the public internet.
  • Minimum Value: 1
    Maximum Value: 65535
    Port number on the mail server. Common SMTP ports include: 25 (no security), 465 (SSL TLS), 587 (STARTTLS)
  • MailSender
    Sender of emails
Nested Schema : Discriminator: authType
Type: object
Discriminator: authType

Discriminator Values

Mail server authentication type.
Match One Schema
Show Source
Nested Schema : Discriminator: connectionSecurityType
Type: object
Discriminator: connectionSecurityType

Discriminator Values

Connection security options for the mail server connection.
Match One Schema
Show Source
Nested Schema : MailSender
Type: object
Sender of emails
Show Source
Nested Schema : MailServerNoAuth
Type: object
Mail server doesn???t require authentication.
Show Source
Nested Schema : MailServerUsernamePasswordAuth
Type: object
Mail server authentication requires a username and password.
Show Source
Nested Schema : MailServerOAuth2Auth
Type: object
Mail server authentication uses OAuth2
Show Source
Nested Schema : authType
No authentication type
Default Value: NO_AUTH
Match All
No authentication type
Show Source
  • Allowed Values: [ "NO_AUTH", "USERNAME_PASSWORD_AUTH", "OAUTH2_AUTH" ]
    Type of authentication the mail server requires.
Nested Schema : authType
Username and password required for authentication.
Default Value: USERNAME_PASSWORD_AUTH
Match All
Username and password required for authentication.
Show Source
  • Allowed Values: [ "NO_AUTH", "USERNAME_PASSWORD_AUTH", "OAUTH2_AUTH" ]
    Type of authentication the mail server requires.
Nested Schema : authType
OAuth2 AuthType
Default Value: OAUTH2_AUTH
Match All
OAuth2 AuthType
Show Source
  • Allowed Values: [ "OSS_AUTH_OCI_USER_ID", "OCI_RESOURCE_PRINCIPAL" ]
    Type of authentication.
Nested Schema : Discriminator: oAuth2Provider
Type: object
Discriminator: oAuth2Provider

Discriminator Values

Configuration details for a specific OAuth2 provider.
Match One Schema
Show Source
Nested Schema : MailServerMSOAuth2
Type: object
Mail server authentication that uses the Microsoft OAuth2 client credential flow.
Show Source
Nested Schema : oAuth2Provider
Specific OAuth2 AuthType
Default Value: MS_OAUTH2
Match All
Specific OAuth2 AuthType
Show Source
  • Allowed Values: [ "MS_OAUTH2" ]
    OAuth2 services provider.
Nested Schema : NoConnectionSecurity
Type: object
No conection security.
Show Source
Nested Schema : SslTlsConnectionSecurity
Type: object
SSL TLS security for the mail server connection.
Show Source
Nested Schema : StartTlsConnectionSecurity
Type: object
STARTTLS security for the mail server connection.
Show Source
Nested Schema : connectionSecurityType
No connection security.
Default Value: NO_CONNECTION_SECURITY
Match All
No connection security.
Show Source
  • Allowed Values: [ "NO_CONNECTION_SECURITY", "SSL_TLS_CONNECTION_SECURITY", "START_TLS_CONNECTION_SECURITY" ]
    Type of security on the mail server connection.
Nested Schema : connectionSecurityType
SSL TLS connection security.
Default Value: SSL_TLS_CONNECTION_SECURITY
Match All
SSL TLS connection security.
Show Source
  • Allowed Values: [ "NO_CONNECTION_SECURITY", "SSL_TLS_CONNECTION_SECURITY", "START_TLS_CONNECTION_SECURITY" ]
    Type of security on the mail server connection.
Nested Schema : Discriminator: certificateType
Type: object
Discriminator: certificateType

Discriminator Values

Certificate for SSL TLS or START TLS connection security.
Match One Schema
Show Source
Nested Schema : DefaultTlsCertificate
Type: object
Use the default certificate provided for an SSL-enabled mail server.
Show Source
Nested Schema : CustomTlsCertificate
Type: object
Use a custom TLS certificate for an SSL-enabled mail server.
Show Source
Nested Schema : certificateType
Use the mail server???s default TLS certificate.
Default Value: DEFAULT_TLS_CERTIFICATE
Match All
Use the mail server???s default TLS certificate.
Show Source
  • Allowed Values: [ "DEFAULT_TLS_CERTIFICATE", "CUSTOM_TLS_CERTIFICATE" ]
    Type of TLS certificate, default or custom.
Nested Schema : certificateType
CustomTlsCertificate CertificateType
Default Value: CUSTOM_TLS_CERTIFICATE
Match All
CustomTlsCertificate CertificateType
Show Source
  • Allowed Values: [ "DEFAULT_TLS_CERTIFICATE", "CUSTOM_TLS_CERTIFICATE" ]
    Type of TLS certificate, default or custom.
Nested Schema : connectionSecurityType
STARTTLS connection security.
Default Value: START_TLS_CONNECTION_SECURITY
Match All
STARTTLS connection security.
Show Source
  • Allowed Values: [ "NO_CONNECTION_SECURITY", "SSL_TLS_CONNECTION_SECURITY", "START_TLS_CONNECTION_SECURITY" ]
    Type of security on the mail server connection.

201 Response

Mail server configuration successfully updated.
Body ()
Root Schema : schema
Type: object
Mail server used to deliver visualizations and reports to users by email.
Show Source
  • Discriminator: authType
    Discriminator: { "propertyName":"authType", "mapping":{ "NO_AUTH":"#/components/schemas/MailServerNoAuth", "USERNAME_PASSWORD_AUTH":"#/components/schemas/MailServerUsernamePasswordAuth", "OAUTH2_AUTH":"#/components/schemas/MailServerOAuth2Auth" } }
    Mail server authentication type.
  • Discriminator: connectionSecurityType
    Discriminator: { "propertyName":"connectionSecurityType", "mapping":{ "NO_CONNECTION_SECURITY":"#/components/schemas/NoConnectionSecurity", "SSL_TLS_CONNECTION_SECURITY":"#/components/schemas/SslTlsConnectionSecurity", "START_TLS_CONNECTION_SECURITY":"#/components/schemas/StartTlsConnectionSecurity" } }
    Connection security options for the mail server connection.
  • Minimum Length: 1
    Host name of the SMTP server you want to use to deliver emails. The SMTP server must be accessible from the public internet.
  • Minimum Value: 1
    Maximum Value: 65535
    Port number on the mail server. Common SMTP ports include: 25 (no security), 465 (SSL TLS), 587 (STARTTLS)
  • MailSender
    Sender of emails
Nested Schema : Discriminator: authType
Type: object
Discriminator: authType

Discriminator Values

Mail server authentication type.
Match One Schema
Show Source
Nested Schema : Discriminator: connectionSecurityType
Type: object
Discriminator: connectionSecurityType

Discriminator Values

Connection security options for the mail server connection.
Match One Schema
Show Source
Nested Schema : MailSender
Type: object
Sender of emails
Show Source
Nested Schema : MailServerNoAuth
Type: object
Mail server doesn???t require authentication.
Show Source
Nested Schema : MailServerUsernamePasswordAuth
Type: object
Mail server authentication requires a username and password.
Show Source
Nested Schema : MailServerOAuth2Auth
Type: object
Mail server authentication uses OAuth2
Show Source
Nested Schema : authType
No authentication type
Default Value: NO_AUTH
Match All
No authentication type
Show Source
  • Allowed Values: [ "NO_AUTH", "USERNAME_PASSWORD_AUTH", "OAUTH2_AUTH" ]
    Type of authentication the mail server requires.
Nested Schema : authType
Username and password required for authentication.
Default Value: USERNAME_PASSWORD_AUTH
Match All
Username and password required for authentication.
Show Source
  • Allowed Values: [ "NO_AUTH", "USERNAME_PASSWORD_AUTH", "OAUTH2_AUTH" ]
    Type of authentication the mail server requires.
Nested Schema : authType
OAuth2 AuthType
Default Value: OAUTH2_AUTH
Match All
OAuth2 AuthType
Show Source
  • Allowed Values: [ "OSS_AUTH_OCI_USER_ID", "OCI_RESOURCE_PRINCIPAL" ]
    Type of authentication.
Nested Schema : Discriminator: oAuth2Provider
Type: object
Discriminator: oAuth2Provider

Discriminator Values

Configuration details for a specific OAuth2 provider.
Match One Schema
Show Source
Nested Schema : MailServerMSOAuth2
Type: object
Mail server authentication that uses the Microsoft OAuth2 client credential flow.
Show Source
Nested Schema : oAuth2Provider
Specific OAuth2 AuthType
Default Value: MS_OAUTH2
Match All
Specific OAuth2 AuthType
Show Source
  • Allowed Values: [ "MS_OAUTH2" ]
    OAuth2 services provider.
Nested Schema : NoConnectionSecurity
Type: object
No conection security.
Show Source
Nested Schema : SslTlsConnectionSecurity
Type: object
SSL TLS security for the mail server connection.
Show Source
Nested Schema : StartTlsConnectionSecurity
Type: object
STARTTLS security for the mail server connection.
Show Source
Nested Schema : connectionSecurityType
No connection security.
Default Value: NO_CONNECTION_SECURITY
Match All
No connection security.
Show Source
  • Allowed Values: [ "NO_CONNECTION_SECURITY", "SSL_TLS_CONNECTION_SECURITY", "START_TLS_CONNECTION_SECURITY" ]
    Type of security on the mail server connection.
Nested Schema : connectionSecurityType
SSL TLS connection security.
Default Value: SSL_TLS_CONNECTION_SECURITY
Match All
SSL TLS connection security.
Show Source
  • Allowed Values: [ "NO_CONNECTION_SECURITY", "SSL_TLS_CONNECTION_SECURITY", "START_TLS_CONNECTION_SECURITY" ]
    Type of security on the mail server connection.
Nested Schema : Discriminator: certificateType
Type: object
Discriminator: certificateType

Discriminator Values

Certificate for SSL TLS or START TLS connection security.
Match One Schema
Show Source
Nested Schema : DefaultTlsCertificate
Type: object
Use the default certificate provided for an SSL-enabled mail server.
Show Source
Nested Schema : CustomTlsCertificate
Type: object
Use a custom TLS certificate for an SSL-enabled mail server.
Show Source
Nested Schema : certificateType
Use the mail server???s default TLS certificate.
Default Value: DEFAULT_TLS_CERTIFICATE
Match All
Use the mail server???s default TLS certificate.
Show Source
  • Allowed Values: [ "DEFAULT_TLS_CERTIFICATE", "CUSTOM_TLS_CERTIFICATE" ]
    Type of TLS certificate, default or custom.
Nested Schema : certificateType
CustomTlsCertificate CertificateType
Default Value: CUSTOM_TLS_CERTIFICATE
Match All
CustomTlsCertificate CertificateType
Show Source
  • Allowed Values: [ "DEFAULT_TLS_CERTIFICATE", "CUSTOM_TLS_CERTIFICATE" ]
    Type of TLS certificate, default or custom.
Nested Schema : connectionSecurityType
STARTTLS connection security.
Default Value: START_TLS_CONNECTION_SECURITY
Match All
STARTTLS connection security.
Show Source
  • Allowed Values: [ "NO_CONNECTION_SECURITY", "SSL_TLS_CONNECTION_SECURITY", "START_TLS_CONNECTION_SECURITY" ]
    Type of security on the mail server connection.

400 Response

Bad Request (invalid query parameters, malformed headers, and so on).
Body ()
Root Schema : Error
Type: object
Show Source

401 Response

Unauthorized (missing or expired credentials, and so on).
Body ()
Root Schema : Error
Type: object
Show Source
Back to Top

Examples

In this example, you configure a mail server by first creating update_mail_server.json with the required properties. Running this either creates a new mail server configuration (if one doesn't exist) or updates an existing configuration, using the settings in the update_mail_server.json file.

cURL Example

curl -i  \
      --header 'Authorization: Bearer <token>' \
      --header 'Content-Type: application/json' \
      --request PUT 'http://<hostname>/api/20210901/system/mail/server' \
      --data @update_mail_server.json

Examples of Properties JSON

The properties in the JSON file you pass to the mail server API depends on your authentication and certificate requirements. Use the examples below to determine what properties to include in your JSON.

JSON for mail server with authentication and SSLTLS using the default certificate

{
  "host": "mail-server.com",
  "port": 465,
  "sender": {
    "displayName": "John Smith",
    "emailAddress": "john.smith@myorg.com"
  },
  "auth": {
    "authType": "USERNAME_PASSWORD_AUTH",
    "username": "jsmith",
    "password": "mypassword123"
  },
  "connectionSecurity": {
    "connectionSecurityType": "SSL_TLS_CONNECTION_SECURITY",
    "tlsCertificateDetails": {
      "certificateType": "DEFAULT_TLS_CERTIFICATE"
    }
  }
}

JSON for mail server with authentication and STARTTLS using a custom certificate

{
  "host": "mail-server.com",
  "port": 587,
  "sender": {
    "displayName": "John Smith",
    "emailAddress": "john.smith@myorg.com"
  },
  "auth": {
    "authType": "USERNAME_PASSWORD_AUTH",
    "username": "jsmith",
    "password": "mypassword123"
  },
  "connectionSecurity": {
    "connectionSecurityType": "START_TLS_CONNECTION_SECURITY",
    "tlsCertificateDetails": {
      "certificateType": "CUSTOM_TLS_CERTIFICATE",
      "certificate": "-----BEGIN CERTIFICATE-----\nMIIDzD..."
    }
  }
}

Example of Request Body

Not applicable.

Example of Response Body - New mail server created

Status 201:
{
  "host": "mail-server.com",
  "port": 25,
  "sender": {
    "displayName": "John Smith",
    "emailAddress": "john.smith@myorg.com"
  },
  "auth": {
    "authType": "NO_AUTH"
  },
  "connectionSecurity": {
    "connectionSecurityType": "NO_CONNECTION_SECURITY"
  }
}

Example of Response Body - Authentication and SSLTLS using the default certificate

Status 200:
{
  "host": "mail-server.com",
  "port": 465,
  "sender": {
    "displayName": "John Smith",
    "emailAddress": "john.smith@myorg.com"
  },
  "auth": {
    "authType": "USERNAME_PASSWORD_AUTH",
    "username": "jsmith"
  },
  "connectionSecurity": {
    "connectionSecurityType": "SSL_TLS_CONNECTION_SECURITY",
    "tlsCertificateDetails": {
      "certificateType": "DEFAULT_TLS_CERTIFICATE"
    }
  }
}

Example of Response Body - Authentication and STARTTLS using a custom certificate

Status 200:
{
  "host": "mail-server.com",
  "port": 587,
  "sender": {
    "displayName": "John Smith",
    "emailAddress": "john.smith@myorg.com"
  },
  "auth": {
    "authType": "USERNAME_PASSWORD_AUTH",
    "username": "jsmith"
  },
  "connectionSecurity": {
    "connectionSecurityType": "START_TLS_CONNECTION_SECURITY",
    "tlsCertificateDetails": {
      "certificateType": "CUSTOM_TLS_CERTIFICATE"
    }
  }
}
Back to Top