Okta.Sdk.Api.EmailServerApi

October 22, 2025 ยท View on GitHub

All URIs are relative to https://subdomain.okta.com

MethodHTTP requestDescription
CreateEmailServerPOST /api/v1/email-serversCreate a custom SMTP server
DeleteEmailServerDELETE /api/v1/email-servers/{emailServerId}Delete an SMTP server configuration
GetEmailServerGET /api/v1/email-servers/{emailServerId}Retrieve an SMTP server configuration
ListEmailServersGET /api/v1/email-serversList all enrolled SMTP servers
TestEmailServerPOST /api/v1/email-servers/{emailServerId}/testTest an SMTP server configuration
UpdateEmailServerPATCH /api/v1/email-servers/{emailServerId}Update an SMTP server configuration

CreateEmailServer

EmailServerResponse CreateEmailServer (EmailServerPost emailServerPost = null)

Create a custom SMTP server

Creates a custom email SMTP server configuration for your org

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class CreateEmailServerExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new EmailServerApi(config);
            var emailServerPost = new EmailServerPost(); // EmailServerPost |  (optional) 

            try
            {
                // Create a custom SMTP server
                EmailServerResponse result = apiInstance.CreateEmailServer(emailServerPost);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EmailServerApi.CreateEmailServer: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
emailServerPostEmailServerPost[optional]

Return type

EmailServerResponse

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
201Successfully enrolled server credentials-
400Bad Request-
403Forbidden-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteEmailServer

void DeleteEmailServer (string emailServerId)

Delete an SMTP server configuration

Deletes the specified custom SMTP server configuration

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class DeleteEmailServerExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new EmailServerApi(config);
            var emailServerId = "emailServerId_example";  // string | 

            try
            {
                // Delete an SMTP server configuration
                apiInstance.DeleteEmailServer(emailServerId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EmailServerApi.DeleteEmailServer: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
emailServerIdstring

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
204No content-
403Forbidden-
404Not Found-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetEmailServer

EmailServerListResponse GetEmailServer (string emailServerId)

Retrieve an SMTP server configuration

Retrieves the specified custom SMTP server configuration

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class GetEmailServerExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new EmailServerApi(config);
            var emailServerId = "emailServerId_example";  // string | 

            try
            {
                // Retrieve an SMTP server configuration
                EmailServerListResponse result = apiInstance.GetEmailServer(emailServerId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EmailServerApi.GetEmailServer: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
emailServerIdstring

Return type

EmailServerListResponse

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200OK-
403Forbidden-
404Not Found-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListEmailServers

EmailServerListResponse ListEmailServers ()

List all enrolled SMTP servers

Lists all the enrolled custom SMTP server configurations

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class ListEmailServersExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new EmailServerApi(config);

            try
            {
                // List all enrolled SMTP servers
                EmailServerListResponse result = apiInstance.ListEmailServers();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EmailServerApi.ListEmailServers: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

EmailServerListResponse

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200OK-
403Forbidden-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TestEmailServer

void TestEmailServer (string emailServerId, EmailTestAddresses emailTestAddresses = null)

Test an SMTP server configuration

Tests the specified custom SMTP Server configuration

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class TestEmailServerExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new EmailServerApi(config);
            var emailServerId = "emailServerId_example";  // string | 
            var emailTestAddresses = new EmailTestAddresses(); // EmailTestAddresses |  (optional) 

            try
            {
                // Test an SMTP server configuration
                apiInstance.TestEmailServer(emailServerId, emailTestAddresses);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EmailServerApi.TestEmailServer: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
emailServerIdstring
emailTestAddressesEmailTestAddresses[optional]

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
204No content-
400Bad Request-
403Forbidden-
404Not Found-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateEmailServer

EmailServerResponse UpdateEmailServer (string emailServerId, EmailServerRequest emailServerRequest = null)

Update an SMTP server configuration

Updates the specified custom SMTP server configuration

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class UpdateEmailServerExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new EmailServerApi(config);
            var emailServerId = "emailServerId_example";  // string | 
            var emailServerRequest = new EmailServerRequest(); // EmailServerRequest |  (optional) 

            try
            {
                // Update an SMTP server configuration
                EmailServerResponse result = apiInstance.UpdateEmailServer(emailServerId, emailServerRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EmailServerApi.UpdateEmailServer: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
emailServerIdstring
emailServerRequestEmailServerRequest[optional]

Return type

EmailServerResponse

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200OK-
400Bad Request-
403Forbidden-
404Not Found-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]