Okta.Sdk.Api.CustomTemplatesApi

October 22, 2025 ยท View on GitHub

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

MethodHTTP requestDescription
CreateEmailCustomizationPOST /api/v1/brands/{brandId}/templates/email/{templateName}/customizationsCreate an email customization
DeleteAllCustomizationsDELETE /api/v1/brands/{brandId}/templates/email/{templateName}/customizationsDelete all email customizations
DeleteEmailCustomizationDELETE /api/v1/brands/{brandId}/templates/email/{templateName}/customizations/{customizationId}Delete an email customization
GetCustomizationPreviewGET /api/v1/brands/{brandId}/templates/email/{templateName}/customizations/{customizationId}/previewRetrieve a preview of an email customization
GetEmailCustomizationGET /api/v1/brands/{brandId}/templates/email/{templateName}/customizations/{customizationId}Retrieve an email customization
GetEmailDefaultContentGET /api/v1/brands/{brandId}/templates/email/{templateName}/default-contentRetrieve an email template default content
GetEmailDefaultPreviewGET /api/v1/brands/{brandId}/templates/email/{templateName}/default-content/previewRetrieve a preview of the email template default content
GetEmailSettingsGET /api/v1/brands/{brandId}/templates/email/{templateName}/settingsRetrieve the email template settings
GetEmailTemplateGET /api/v1/brands/{brandId}/templates/email/{templateName}Retrieve an email template
ListEmailCustomizationsGET /api/v1/brands/{brandId}/templates/email/{templateName}/customizationsList all email customizations
ListEmailTemplatesGET /api/v1/brands/{brandId}/templates/emailList all email templates
ReplaceEmailCustomizationPUT /api/v1/brands/{brandId}/templates/email/{templateName}/customizations/{customizationId}Replace an email customization
ReplaceEmailSettingsPUT /api/v1/brands/{brandId}/templates/email/{templateName}/settingsReplace the email template settings
SendTestEmailPOST /api/v1/brands/{brandId}/templates/email/{templateName}/testSend a test email

CreateEmailCustomization

EmailCustomization CreateEmailCustomization (string brandId, string templateName, EmailCustomization instance = null)

Create an email customization

Creates a new Email Customization <x-lifecycle class="ea"> If Custom languages for Okta Email Templates is enabled, you can create a customization for any BCP47 language in addition to the Okta-supported languages.

Example

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

namespace Example
{
    public class CreateEmailCustomizationExample
    {
        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 CustomTemplatesApi(config);
            var brandId = "brandId_example";  // string | The ID of the brand
            var templateName = "templateName_example";  // string | The name of the email template
            var instance = new EmailCustomization(); // EmailCustomization |  (optional) 

            try
            {
                // Create an email customization
                EmailCustomization result = apiInstance.CreateEmailCustomization(brandId, templateName, instance);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomTemplatesApi.CreateEmailCustomization: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
brandIdstringThe ID of the brand
templateNamestringThe name of the email template
instanceEmailCustomization[optional]

Return type

EmailCustomization

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
201Successfully created the email customization.-
400Bad Request-
403Forbidden-
404Not Found-
409Could not create the email customization because it conflicts with an existing email customization.-
429Too Many Requests-

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

DeleteAllCustomizations

void DeleteAllCustomizations (string brandId, string templateName)

Delete all email customizations

Deletes all customizations for an email template <x-lifecycle class="ea"> If Custom languages for Okta Email Templates is enabled, all customizations are deleted, including customizations for additional languages. If disabled, only customizations in Okta-supported languages are deleted.

Example

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

namespace Example
{
    public class DeleteAllCustomizationsExample
    {
        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 CustomTemplatesApi(config);
            var brandId = "brandId_example";  // string | The ID of the brand
            var templateName = "templateName_example";  // string | The name of the email template

            try
            {
                // Delete all email customizations
                apiInstance.DeleteAllCustomizations(brandId, templateName);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomTemplatesApi.DeleteAllCustomizations: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
brandIdstringThe ID of the brand
templateNamestringThe name of the email template

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
204Successfully deleted all customizations for the email template.-
403Forbidden-
404Not Found-
429Too Many Requests-

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

DeleteEmailCustomization

void DeleteEmailCustomization (string brandId, string templateName, string customizationId)

Delete an email customization

Deletes an Email Customization by its unique identifier <x-lifecycle class="ea"> If Custom languages for Okta Email Templates is disabled, deletion of an existing additional language customization by ID doesn't register.

Example

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

namespace Example
{
    public class DeleteEmailCustomizationExample
    {
        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 CustomTemplatesApi(config);
            var brandId = "brandId_example";  // string | The ID of the brand
            var templateName = "templateName_example";  // string | The name of the email template
            var customizationId = "customizationId_example";  // string | The ID of the email customization

            try
            {
                // Delete an email customization
                apiInstance.DeleteEmailCustomization(brandId, templateName, customizationId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomTemplatesApi.DeleteEmailCustomization: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
brandIdstringThe ID of the brand
templateNamestringThe name of the email template
customizationIdstringThe ID of the email customization

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
204Successfully deleted the email customization.-
403Forbidden-
404Not Found-
409Could not delete the email customization deleted because it is the default email customization.-
429Too Many Requests-

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

GetCustomizationPreview

EmailPreview GetCustomizationPreview (string brandId, string templateName, string customizationId)

Retrieve a preview of an email customization

Retrieves a Preview of an Email Customization. All variable references are populated from the current user's context. For example, ${user.profile.firstName}. <x-lifecycle class="ea"> If Custom languages for Okta Email Templates is disabled, requests for the preview of an additional language customization by ID return a 404 Not Found error response.

Example

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

namespace Example
{
    public class GetCustomizationPreviewExample
    {
        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 CustomTemplatesApi(config);
            var brandId = "brandId_example";  // string | The ID of the brand
            var templateName = "templateName_example";  // string | The name of the email template
            var customizationId = "customizationId_example";  // string | The ID of the email customization

            try
            {
                // Retrieve a preview of an email customization
                EmailPreview result = apiInstance.GetCustomizationPreview(brandId, templateName, customizationId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomTemplatesApi.GetCustomizationPreview: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
brandIdstringThe ID of the brand
templateNamestringThe name of the email template
customizationIdstringThe ID of the email customization

Return type

EmailPreview

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Successfully generated a preview of the email customization.-
403Forbidden-
404Not Found-
429Too Many Requests-

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

GetEmailCustomization

EmailCustomization GetEmailCustomization (string brandId, string templateName, string customizationId)

Retrieve an email customization

Retrieves an email customization by its unique identifier <x-lifecycle class="ea"> If Custom languages for Okta Email Templates is disabled, requests to retrieve an additional language customization by ID result in a 404 Not Found error response.

Example

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

namespace Example
{
    public class GetEmailCustomizationExample
    {
        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 CustomTemplatesApi(config);
            var brandId = "brandId_example";  // string | The ID of the brand
            var templateName = "templateName_example";  // string | The name of the email template
            var customizationId = "customizationId_example";  // string | The ID of the email customization

            try
            {
                // Retrieve an email customization
                EmailCustomization result = apiInstance.GetEmailCustomization(brandId, templateName, customizationId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomTemplatesApi.GetEmailCustomization: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
brandIdstringThe ID of the brand
templateNamestringThe name of the email template
customizationIdstringThe ID of the email customization

Return type

EmailCustomization

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Successfully retrieved the email customization.-
403Forbidden-
404Not Found-
429Too Many Requests-

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

GetEmailDefaultContent

EmailDefaultContent GetEmailDefaultContent (string brandId, string templateName, string language = null)

Retrieve an email template default content

Retrieves an email template's default content <x-lifecycle class="ea"> Defaults to the current user's language given the following: - Custom languages for Okta Email Templates is enabled - An additional language is specified for the language parameter

Example

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

namespace Example
{
    public class GetEmailDefaultContentExample
    {
        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 CustomTemplatesApi(config);
            var brandId = "brandId_example";  // string | The ID of the brand
            var templateName = "templateName_example";  // string | The name of the email template
            var language = "language_example";  // string | The language to use for the email. Defaults to the current user's language if unspecified. (optional) 

            try
            {
                // Retrieve an email template default content
                EmailDefaultContent result = apiInstance.GetEmailDefaultContent(brandId, templateName, language);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomTemplatesApi.GetEmailDefaultContent: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
brandIdstringThe ID of the brand
templateNamestringThe name of the email template
languagestringThe language to use for the email. Defaults to the current user's language if unspecified.[optional]

Return type

EmailDefaultContent

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Successfully retrieved the email template's default content.-
403Forbidden-
404Not Found-
429Too Many Requests-

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

GetEmailDefaultPreview

EmailPreview GetEmailDefaultPreview (string brandId, string templateName, string language = null)

Retrieve a preview of the email template default content

Retrieves a preview of an Email Template's default content. All variable references are populated using the current user's context. For example, ${user.profile.firstName}. <x-lifecycle class="ea"> Defaults to the current user's language given the following: - Custom languages for Okta Email Templates is enabled - An additional language is specified for the language parameter

Example

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

namespace Example
{
    public class GetEmailDefaultPreviewExample
    {
        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 CustomTemplatesApi(config);
            var brandId = "brandId_example";  // string | The ID of the brand
            var templateName = "templateName_example";  // string | The name of the email template
            var language = "language_example";  // string | The language to use for the email. Defaults to the current user's language if unspecified. (optional) 

            try
            {
                // Retrieve a preview of the email template default content
                EmailPreview result = apiInstance.GetEmailDefaultPreview(brandId, templateName, language);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomTemplatesApi.GetEmailDefaultPreview: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
brandIdstringThe ID of the brand
templateNamestringThe name of the email template
languagestringThe language to use for the email. Defaults to the current user's language if unspecified.[optional]

Return type

EmailPreview

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Successfully generated a preview of the email template's default content.-
403Forbidden-
404Not Found-
429Too Many Requests-

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

GetEmailSettings

EmailSettingsResponse GetEmailSettings (string brandId, string templateName)

Retrieve the email template settings

Retrieves an email template's settings

Example

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

namespace Example
{
    public class GetEmailSettingsExample
    {
        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 CustomTemplatesApi(config);
            var brandId = "brandId_example";  // string | The ID of the brand
            var templateName = "templateName_example";  // string | The name of the email template

            try
            {
                // Retrieve the email template settings
                EmailSettingsResponse result = apiInstance.GetEmailSettings(brandId, templateName);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomTemplatesApi.GetEmailSettings: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
brandIdstringThe ID of the brand
templateNamestringThe name of the email template

Return type

EmailSettingsResponse

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Successfully retrieved the email template's settings.-
403Forbidden-
404Not Found-
429Too Many Requests-

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

GetEmailTemplate

EmailTemplateResponse GetEmailTemplate (string brandId, string templateName, List expand = null)

Retrieve an email template

Retrieves the details of an email template by name

Example

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

namespace Example
{
    public class GetEmailTemplateExample
    {
        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 CustomTemplatesApi(config);
            var brandId = "brandId_example";  // string | The ID of the brand
            var templateName = "templateName_example";  // string | The name of the email template
            var expand = new List<string>(); // List<string> | Specifies additional metadata to be included in the response (optional) 

            try
            {
                // Retrieve an email template
                EmailTemplateResponse result = apiInstance.GetEmailTemplate(brandId, templateName, expand);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomTemplatesApi.GetEmailTemplate: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
brandIdstringThe ID of the brand
templateNamestringThe name of the email template
expandList<string>Specifies additional metadata to be included in the response[optional]

Return type

EmailTemplateResponse

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Successfully retrieved the email template.-
403Forbidden-
404Not Found-
429Too Many Requests-

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

ListEmailCustomizations

List<EmailCustomization> ListEmailCustomizations (string brandId, string templateName, string after = null, int? limit = null)

List all email customizations

Lists all customizations of an email template <x-lifecycle class="ea"> If Custom languages for Okta Email Templates is enabled, all existing customizations are retrieved, including customizations for additional languages. If disabled, only customizations for Okta-supported languages are returned.

Example

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

namespace Example
{
    public class ListEmailCustomizationsExample
    {
        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 CustomTemplatesApi(config);
            var brandId = "brandId_example";  // string | The ID of the brand
            var templateName = "templateName_example";  // string | The name of the email template
            var after = "after_example";  // string | The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional) 
            var limit = 20;  // int? | A limit on the number of objects to return (optional)  (default to 20)

            try
            {
                // List all email customizations
                List<EmailCustomization> result = apiInstance.ListEmailCustomizations(brandId, templateName, after, limit).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomTemplatesApi.ListEmailCustomizations: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
brandIdstringThe ID of the brand
templateNamestringThe name of the email template
afterstringThe cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See Pagination.[optional]
limitint?A limit on the number of objects to return[optional] [default to 20]

Return type

List<EmailCustomization>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Successfully retrieved all email customizations for the specified email template.-
403Forbidden-
404Not Found-
429Too Many Requests-

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

ListEmailTemplates

List<EmailTemplateResponse> ListEmailTemplates (string brandId, string after = null, int? limit = null, List expand = null)

List all email templates

Lists all supported email templates

Example

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

namespace Example
{
    public class ListEmailTemplatesExample
    {
        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 CustomTemplatesApi(config);
            var brandId = "brandId_example";  // string | The ID of the brand
            var after = "after_example";  // string | The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional) 
            var limit = 20;  // int? | A limit on the number of objects to return (optional)  (default to 20)
            var expand = new List<string>(); // List<string> | Specifies additional metadata to be included in the response (optional) 

            try
            {
                // List all email templates
                List<EmailTemplateResponse> result = apiInstance.ListEmailTemplates(brandId, after, limit, expand).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomTemplatesApi.ListEmailTemplates: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
brandIdstringThe ID of the brand
afterstringThe cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See Pagination.[optional]
limitint?A limit on the number of objects to return[optional] [default to 20]
expandList<string>Specifies additional metadata to be included in the response[optional]

Return type

List<EmailTemplateResponse>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Successfully returned the list of email templates.* Link - The pagination header containing links to the current and next page of results. See Pagination for more information.
403Forbidden-
404Not Found-
429Too Many Requests-

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

ReplaceEmailCustomization

EmailCustomization ReplaceEmailCustomization (string brandId, string templateName, string customizationId, EmailCustomization instance = null)

Replace an email customization

Replaces an email customization using property values <x-lifecycle class="ea"> If Custom languages for Okta Email Templates is disabled, requests to update a customization for an additional language return a 404 Not Found error response.

Example

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

namespace Example
{
    public class ReplaceEmailCustomizationExample
    {
        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 CustomTemplatesApi(config);
            var brandId = "brandId_example";  // string | The ID of the brand
            var templateName = "templateName_example";  // string | The name of the email template
            var customizationId = "customizationId_example";  // string | The ID of the email customization
            var instance = new EmailCustomization(); // EmailCustomization | Request (optional) 

            try
            {
                // Replace an email customization
                EmailCustomization result = apiInstance.ReplaceEmailCustomization(brandId, templateName, customizationId, instance);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomTemplatesApi.ReplaceEmailCustomization: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
brandIdstringThe ID of the brand
templateNamestringThe name of the email template
customizationIdstringThe ID of the email customization
instanceEmailCustomizationRequest[optional]

Return type

EmailCustomization

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Successfully updated the email customization.-
400Bad Request-
403Forbidden-
404Not Found-
409Could not update the email customization because the update would cause a conflict with an existing email customization.-
429Too Many Requests-

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

ReplaceEmailSettings

EmailSettings ReplaceEmailSettings (string brandId, string templateName, EmailSettings emailSettings = null)

Replace the email template settings

Replaces an email template's settings

Example

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

namespace Example
{
    public class ReplaceEmailSettingsExample
    {
        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 CustomTemplatesApi(config);
            var brandId = "brandId_example";  // string | The ID of the brand
            var templateName = "templateName_example";  // string | The name of the email template
            var emailSettings = new EmailSettings(); // EmailSettings |  (optional) 

            try
            {
                // Replace the email template settings
                EmailSettings result = apiInstance.ReplaceEmailSettings(brandId, templateName, emailSettings);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomTemplatesApi.ReplaceEmailSettings: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
brandIdstringThe ID of the brand
templateNamestringThe name of the email template
emailSettingsEmailSettings[optional]

Return type

EmailSettings

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Successfully updated the email template's settings.-
400Bad Request-
403Forbidden-
404Not Found-
409Conflict-
422Could not update the email template's settings due to an invalid setting value.-
429Too Many Requests-

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

SendTestEmail

void SendTestEmail (string brandId, string templateName, string language = null)

Send a test email

Sends a test email to the current user's primary and secondary email addresses. The email content is selected based on the following priority: 1. The email customization for the language specified in the language query parameter <x-lifecycle class="ea"> If Custom languages for Okta Email Templates is enabled and the language parameter is an additional language, the test email uses the customization corresponding to the language. 2. The email template's default customization 3. The email template's default content, translated to the current user's language > Note: Super admins can view customized email templates with the Send a test email request. However, when custom email templates are sent to super admins as part of actual email notification flows, the customizations aren't applied. Instead, the default email template is used. This only applies to super admins.

Example

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

namespace Example
{
    public class SendTestEmailExample
    {
        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 CustomTemplatesApi(config);
            var brandId = "brandId_example";  // string | The ID of the brand
            var templateName = "templateName_example";  // string | The name of the email template
            var language = "language_example";  // string | The language to use for the email. Defaults to the current user's language if unspecified. (optional) 

            try
            {
                // Send a test email
                apiInstance.SendTestEmail(brandId, templateName, language);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomTemplatesApi.SendTestEmail: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
brandIdstringThe ID of the brand
templateNamestringThe name of the email template
languagestringThe language to use for the email. Defaults to the current user's language if unspecified.[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
204Successfully sent a test email.-
403Forbidden-
404Not Found-
429Too Many Requests-

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