Okta.Sdk.Api.EmailDomainApi
October 22, 2025 ยท View on GitHub
All URIs are relative to https://subdomain.okta.com
| Method | HTTP request | Description |
|---|---|---|
| CreateEmailDomain | POST /api/v1/email-domains | Create an email domain |
| DeleteEmailDomain | DELETE /api/v1/email-domains/{emailDomainId} | Delete an email domain |
| GetEmailDomain | GET /api/v1/email-domains/{emailDomainId} | Retrieve an email domain |
| ListEmailDomains | GET /api/v1/email-domains | List all email domains |
| ReplaceEmailDomain | PUT /api/v1/email-domains/{emailDomainId} | Replace an email domain |
| VerifyEmailDomain | POST /api/v1/email-domains/{emailDomainId}/verify | Verify 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
| Name | Type | Description | Notes |
|---|---|---|---|
| emailDomain | EmailDomain | ||
| expand | List<string> | Specifies additional metadata to be included in the response | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 409 | Conflict | - |
| 429 | Too 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
| Name | Type | Description | Notes |
|---|---|---|---|
| emailDomainId | string | ||
| expand | List<string> | Specifies additional metadata to be included in the response | [optional] |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | No Content | - |
| 400 | Unable to delete custom email domain due to mail provider specific restrictions | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 429 | Too 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
| Name | Type | Description | Notes |
|---|---|---|---|
| emailDomainId | string | ||
| expand | List<string> | Specifies additional metadata to be included in the response | [optional] |
Return type
EmailDomainResponseWithEmbedded
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 429 | Too 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
| Name | Type | Description | Notes |
|---|---|---|---|
| expand | List<string> | Specifies additional metadata to be included in the response | [optional] |
Return type
List<EmailDomainResponseWithEmbedded>
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 403 | Forbidden | - |
| 429 | Too 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
| Name | Type | Description | Notes |
|---|---|---|---|
| emailDomainId | string | ||
| updateEmailDomain | UpdateEmailDomain | ||
| expand | List<string> | Specifies additional metadata to be included in the response | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 429 | Too 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
| Name | Type | Description | Notes |
|---|---|---|---|
| emailDomainId | string |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 400 | Email domain could not be verified by mail provider | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]