Okta.Sdk.Api.CustomDomainApi

October 22, 2025 ยท View on GitHub

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

MethodHTTP requestDescription
CreateCustomDomainPOST /api/v1/domainsCreate a Custom Domain
DeleteCustomDomainDELETE /api/v1/domains/{domainId}Delete a custom domain
GetCustomDomainGET /api/v1/domains/{domainId}Retrieve a custom domain
ListCustomDomainsGET /api/v1/domainsList all Custom Domains
ReplaceCustomDomainPUT /api/v1/domains/{domainId}Replace a custom domain's brand
UpsertCertificatePUT /api/v1/domains/{domainId}/certificateUpsert the custom domain's certificate
VerifyDomainPOST /api/v1/domains/{domainId}/verifyVerify a custom domain

CreateCustomDomain

DomainResponse CreateCustomDomain (DomainRequest domain)

Create a Custom Domain

Creates your custom domain

Example

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

namespace Example
{
    public class CreateCustomDomainExample
    {
        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 CustomDomainApi(config);
            var domain = new DomainRequest(); // DomainRequest | 

            try
            {
                // Create a Custom Domain
                DomainResponse result = apiInstance.CreateCustomDomain(domain);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomDomainApi.CreateCustomDomain: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
domainDomainRequest

Return type

DomainResponse

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Success-
400Bad Request-
403Forbidden-
429Too Many Requests-

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

DeleteCustomDomain

void DeleteCustomDomain (string domainId)

Delete a custom domain

Deletes a custom domain by domainId

Example

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

namespace Example
{
    public class DeleteCustomDomainExample
    {
        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 CustomDomainApi(config);
            var domainId = OmWNeywfTzElSLOBMZsL;  // string | `id` of the Domain

            try
            {
                // Delete a custom domain
                apiInstance.DeleteCustomDomain(domainId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomDomainApi.DeleteCustomDomain: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
domainIdstring`id` of the Domain

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]

GetCustomDomain

DomainResponse GetCustomDomain (string domainId)

Retrieve a custom domain

Retrieves a custom domain by domainId

Example

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

namespace Example
{
    public class GetCustomDomainExample
    {
        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 CustomDomainApi(config);
            var domainId = OmWNeywfTzElSLOBMZsL;  // string | `id` of the Domain

            try
            {
                // Retrieve a custom domain
                DomainResponse result = apiInstance.GetCustomDomain(domainId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomDomainApi.GetCustomDomain: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
domainIdstring`id` of the Domain

Return type

DomainResponse

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]

ListCustomDomains

DomainListResponse ListCustomDomains ()

List all Custom Domains

Lists all verified custom domains for the 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 ListCustomDomainsExample
    {
        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 CustomDomainApi(config);

            try
            {
                // List all Custom Domains
                DomainListResponse result = apiInstance.ListCustomDomains();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomDomainApi.ListCustomDomains: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

DomainListResponse

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

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

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

ReplaceCustomDomain

DomainResponse ReplaceCustomDomain (string domainId, UpdateDomain updateDomain)

Replace a custom domain's brand

Replaces a custom domain's brand

Example

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

namespace Example
{
    public class ReplaceCustomDomainExample
    {
        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 CustomDomainApi(config);
            var domainId = OmWNeywfTzElSLOBMZsL;  // string | `id` of the Domain
            var updateDomain = new UpdateDomain(); // UpdateDomain | 

            try
            {
                // Replace a custom domain's brand
                DomainResponse result = apiInstance.ReplaceCustomDomain(domainId, updateDomain);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomDomainApi.ReplaceCustomDomain: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
domainIdstring`id` of the Domain
updateDomainUpdateDomain

Return type

DomainResponse

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-
429Too Many Requests-

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

UpsertCertificate

void UpsertCertificate (string domainId, DomainCertificate certificate)

Upsert the custom domain's certificate

Upserts (creates or renews) the MANUAL certificate for the custom domain > Notes: > * If the existing certificateSourceType is OKTA_MANAGED, this operation changes the source type to MANUAL. Okta no longer manages and renews certificates for this domain after you provide a user-managed certificate. > * Okta supports TLS certificates and private keys that are PEM-encoded and 2048, 3072, or 4096 bits. See the Custom domain guide for more details.

Example

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

namespace Example
{
    public class UpsertCertificateExample
    {
        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 CustomDomainApi(config);
            var domainId = OmWNeywfTzElSLOBMZsL;  // string | `id` of the Domain
            var certificate = new DomainCertificate(); // DomainCertificate | 

            try
            {
                // Upsert the custom domain's certificate
                apiInstance.UpsertCertificate(domainId, certificate);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomDomainApi.UpsertCertificate: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
domainIdstring`id` of the Domain
certificateDomainCertificate

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]

VerifyDomain

DomainResponse VerifyDomain (string domainId)

Verify a custom domain

Verifies the custom domain and validity of DNS records by domainId. Furthermore, if the certificateSourceType in the domain is OKTA_MANAGED, then an attempt is made to obtain and install a certificate. After a certificate is obtained and installed by Okta, Okta manages the certificate including certificate renewal.

Example

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

namespace Example
{
    public class VerifyDomainExample
    {
        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 CustomDomainApi(config);
            var domainId = OmWNeywfTzElSLOBMZsL;  // string | `id` of the Domain

            try
            {
                // Verify a custom domain
                DomainResponse result = apiInstance.VerifyDomain(domainId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CustomDomainApi.VerifyDomain: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
domainIdstring`id` of the Domain

Return type

DomainResponse

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]