Okta.Sdk.Api.CustomDomainApi
October 22, 2025 ยท View on GitHub
All URIs are relative to https://subdomain.okta.com
| Method | HTTP request | Description |
|---|---|---|
| CreateCustomDomain | POST /api/v1/domains | Create a Custom Domain |
| DeleteCustomDomain | DELETE /api/v1/domains/{domainId} | Delete a custom domain |
| GetCustomDomain | GET /api/v1/domains/{domainId} | Retrieve a custom domain |
| ListCustomDomains | GET /api/v1/domains | List all Custom Domains |
| ReplaceCustomDomain | PUT /api/v1/domains/{domainId} | Replace a custom domain's brand |
| UpsertCertificate | PUT /api/v1/domains/{domainId}/certificate | Upsert the custom domain's certificate |
| VerifyDomain | POST /api/v1/domains/{domainId}/verify | Verify 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
| Name | Type | Description | Notes |
|---|---|---|---|
| domain | DomainRequest |
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 | - |
| 429 | Too 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
| Name | Type | Description | Notes |
|---|---|---|---|
| domainId | string | `id` of the Domain |
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 | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 429 | Too 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
| Name | Type | Description | Notes |
|---|---|---|---|
| domainId | string | `id` of the Domain |
Return type
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]
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
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 403 | Forbidden | - |
| 429 | Too 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
| Name | Type | Description | Notes |
|---|---|---|---|
| domainId | string | `id` of the Domain | |
| updateDomain | UpdateDomain |
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 | - |
| 429 | Too 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
| Name | Type | Description | Notes |
|---|---|---|---|
| domainId | string | `id` of the Domain | |
| certificate | DomainCertificate |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | No Content | - |
| 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]
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
| Name | Type | Description | Notes |
|---|---|---|---|
| domainId | string | `id` of the Domain |
Return type
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]