Okta.Sdk.Api.UserTypeApi
October 22, 2025 ยท View on GitHub
All URIs are relative to https://subdomain.okta.com
| Method | HTTP request | Description |
|---|---|---|
| CreateUserType | POST /api/v1/meta/types/user | Create a user type |
| DeleteUserType | DELETE /api/v1/meta/types/user/{typeId} | Delete a user type |
| GetUserType | GET /api/v1/meta/types/user/{typeId} | Retrieve a user type |
| ListUserTypes | GET /api/v1/meta/types/user | List all user types |
| ReplaceUserType | PUT /api/v1/meta/types/user/{typeId} | Replace a user type |
| UpdateUserType | POST /api/v1/meta/types/user/{typeId} | Update a user type |
CreateUserType
UserType CreateUserType (UserType userType)
Create a user type
Creates a new user type. Okta automatically creates a default user type for your org. You may add up to nine additional user types. > Note: New user types are based on the current default schema template. Modifications to this schema do not automatically propagate to previously created user types.
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class CreateUserTypeExample
{
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 UserTypeApi(config);
var userType = new UserType(); // UserType |
try
{
// Create a user type
UserType result = apiInstance.CreateUserType(userType);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserTypeApi.CreateUserType: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| userType | UserType |
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]
DeleteUserType
void DeleteUserType (string typeId)
Delete a user type
Deletes a user type permanently. > Note: You can't delete the default user type or a user type that is currently assigned to users.
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class DeleteUserTypeExample
{
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 UserTypeApi(config);
var typeId = "typeId_example"; // string |
try
{
// Delete a user type
apiInstance.DeleteUserType(typeId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserTypeApi.DeleteUserType: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| typeId | string |
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]
GetUserType
UserType GetUserType (string typeId)
Retrieve a user type
Retrieves a user type by ID. Use default to fetch the default user type.
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class GetUserTypeExample
{
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 UserTypeApi(config);
var typeId = "typeId_example"; // string |
try
{
// Retrieve a user type
UserType result = apiInstance.GetUserType(typeId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserTypeApi.GetUserType: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| typeId | string |
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]
ListUserTypes
List<UserType> ListUserTypes ()
List all user types
Lists all user types 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 ListUserTypesExample
{
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 UserTypeApi(config);
try
{
// List all user types
List<UserType> result = apiInstance.ListUserTypes().ToListAsync();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserTypeApi.ListUserTypes: " + 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]
ReplaceUserType
UserType ReplaceUserType (string typeId, UserTypePutRequest userType = null)
Replace a user type
Replaces an existing user type. This operation is a full update. > Note: The name of an existing user type can't be changed, but must be part of the request body. You can only replace the displayName and description elements.
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ReplaceUserTypeExample
{
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 UserTypeApi(config);
var typeId = "typeId_example"; // string |
var userType = new UserTypePutRequest(); // UserTypePutRequest | (optional)
try
{
// Replace a user type
UserType result = apiInstance.ReplaceUserType(typeId, userType);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserTypeApi.ReplaceUserType: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| typeId | string | ||
| userType | UserTypePutRequest | [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 | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateUserType
UserType UpdateUserType (string typeId, UserTypePostRequest userType)
Update a user type
Updates an existing user type. This operation is a partial update. > Note: You can only update the displayName and description elements. The name of an existing user type can't be changed.
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class UpdateUserTypeExample
{
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 UserTypeApi(config);
var typeId = "typeId_example"; // string |
var userType = new UserTypePostRequest(); // UserTypePostRequest |
try
{
// Update a user type
UserType result = apiInstance.UpdateUserType(typeId, userType);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserTypeApi.UpdateUserType: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| typeId | string | ||
| userType | UserTypePostRequest |
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]