Okta.Sdk.Api.EmailDomainApi

October 22, 2025 ยท View on GitHub

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

MethodHTTP requestDescription
CreateEmailDomainPOST /api/v1/email-domainsCreate an email domain
DeleteEmailDomainDELETE /api/v1/email-domains/{emailDomainId}Delete an email domain
GetEmailDomainGET /api/v1/email-domains/{emailDomainId}Retrieve an email domain
ListEmailDomainsGET /api/v1/email-domainsList all email domains
ReplaceEmailDomainPUT /api/v1/email-domains/{emailDomainId}Replace an email domain
VerifyEmailDomainPOST /api/v1/email-domains/{emailDomainId}/verifyVerify an email domain

CreateEmailDomain

EmailDomainResponse CreateEmailDomain (EmailDomain emailDomain, List expand = null)

Create an email domain

Creates an Email Domain in 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 CreateEmailDomainExample
    {
        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 EmailDomainApi(config);
            var emailDomain = new EmailDomain(); // EmailDomain | 
            var expand = new List<string>(); // List<string> | Specifies additional metadata to be included in the response (optional) 

            try
            {
                // Create an email domain
                EmailDomainResponse result = apiInstance.CreateEmailDomain(emailDomain, expand);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EmailDomainApi.CreateEmailDomain: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
emailDomainEmailDomain
expandList<string>Specifies additional metadata to be included in the response[optional]

Return type

EmailDomainResponse

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

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

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

DeleteEmailDomain

void DeleteEmailDomain (string emailDomainId, List expand = null)

Delete an email domain

Deletes an Email Domain by emailDomainId

Example

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

namespace Example
{
    public class DeleteEmailDomainExample
    {
        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 EmailDomainApi(config);
            var emailDomainId = "emailDomainId_example";  // string | 
            var expand = new List<string>(); // List<string> | Specifies additional metadata to be included in the response (optional) 

            try
            {
                // Delete an email domain
                apiInstance.DeleteEmailDomain(emailDomainId, expand);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EmailDomainApi.DeleteEmailDomain: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
emailDomainIdstring
expandList<string>Specifies additional metadata to be included in the response[optional]

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-
400Unable to delete custom email domain due to mail provider specific restrictions-
403Forbidden-
404Not Found-
429Too Many Requests-

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

GetEmailDomain

EmailDomainResponseWithEmbedded GetEmailDomain (string emailDomainId, List expand = null)

Retrieve an email domain

Retrieves an Email Domain by emailDomainId

Example

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

namespace Example
{
    public class GetEmailDomainExample
    {
        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 EmailDomainApi(config);
            var emailDomainId = "emailDomainId_example";  // string | 
            var expand = new List<string>(); // List<string> | Specifies additional metadata to be included in the response (optional) 

            try
            {
                // Retrieve an email domain
                EmailDomainResponseWithEmbedded result = apiInstance.GetEmailDomain(emailDomainId, expand);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EmailDomainApi.GetEmailDomain: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
emailDomainIdstring
expandList<string>Specifies additional metadata to be included in the response[optional]

Return type

EmailDomainResponseWithEmbedded

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

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

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

ListEmailDomains

List<EmailDomainResponseWithEmbedded> ListEmailDomains (List expand = null)

List all email domains

Lists all the Email Domains in 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 ListEmailDomainsExample
    {
        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 EmailDomainApi(config);
            var expand = new List<string>(); // List<string> | Specifies additional metadata to be included in the response (optional) 

            try
            {
                // List all email domains
                List<EmailDomainResponseWithEmbedded> result = apiInstance.ListEmailDomains(expand).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EmailDomainApi.ListEmailDomains: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
expandList<string>Specifies additional metadata to be included in the response[optional]

Return type

List<EmailDomainResponseWithEmbedded>

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]

ReplaceEmailDomain

EmailDomainResponse ReplaceEmailDomain (string emailDomainId, UpdateEmailDomain updateEmailDomain, List expand = null)

Replace an email domain

Replaces associated username and sender display name by emailDomainId

Example

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

namespace Example
{
    public class ReplaceEmailDomainExample
    {
        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 EmailDomainApi(config);
            var emailDomainId = "emailDomainId_example";  // string | 
            var updateEmailDomain = new UpdateEmailDomain(); // UpdateEmailDomain | 
            var expand = new List<string>(); // List<string> | Specifies additional metadata to be included in the response (optional) 

            try
            {
                // Replace an email domain
                EmailDomainResponse result = apiInstance.ReplaceEmailDomain(emailDomainId, updateEmailDomain, expand);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EmailDomainApi.ReplaceEmailDomain: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
emailDomainIdstring
updateEmailDomainUpdateEmailDomain
expandList<string>Specifies additional metadata to be included in the response[optional]

Return type

EmailDomainResponse

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]

VerifyEmailDomain

EmailDomainResponse VerifyEmailDomain (string emailDomainId)

Verify an email domain

Verifies an Email Domain by emailDomainId

Example

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

namespace Example
{
    public class VerifyEmailDomainExample
    {
        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 EmailDomainApi(config);
            var emailDomainId = "emailDomainId_example";  // string | 

            try
            {
                // Verify an email domain
                EmailDomainResponse result = apiInstance.VerifyEmailDomain(emailDomainId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EmailDomainApi.VerifyEmailDomain: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
emailDomainIdstring

Return type

EmailDomainResponse

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Success-
400Email domain could not be verified by mail provider-
403Forbidden-
404Not Found-
429Too Many Requests-

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