Skip to main content

user_types

Creates, updates, deletes, gets or lists a user_types resource.

Overview

Nameuser_types
TypeResource
Idokta.meta.user_types

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique key for the user type
namestringThe name of the user type. The name must start with A-Z or a-z and contain only A-Z, a-z, 0-9, or underscore (_) characters. This value becomes read-only after creation and can't be updated.
_linksobjectSpecifies link relations (see Web Linking) available using the JSON Hypertext Application Language specification. This object is used for dynamic discovery of related resources and lifecycle operations.
createdstring (date-time)A timestamp from when the user type was created
createdBystringThe user ID of the account that created the user type
defaultbooleanA boolean value to indicate if this is the default user type
descriptionstringThe human-readable description of the user type
displayNamestringThe human-readable name of the user type
lastUpdatedstring (date-time)A timestamp from when the user type was most recently updated
lastUpdatedBystringThe user ID of the most recent account to edit the user type

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_user_typesselectsubdomainLists all user types in your org
get_user_typeselectsubdomainRetrieves a user type by ID. Use default to fetch the default user type.
create_user_typeinsertsubdomain, data__name, data__displayNameCreates 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.
update_user_typeupdatesubdomainUpdates 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.
replace_user_typereplacesubdomain, data__name, data__displayName, data__descriptionReplaces 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.
delete_user_typedeletesubdomainDeletes a user type permanently.
> Note: You can't delete the default user type or a user type that is currently assigned to users.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
subdomainstringThe domain of your organization. This can be a provided subdomain of an official okta domain (okta.com, oktapreview.com, etc) or one of your configured custom domains. (default: my-org)

SELECT examples

Lists all user types in your org

SELECT
id,
name,
_links,
created,
createdBy,
default,
description,
displayName,
lastUpdated,
lastUpdatedBy
FROM okta.meta.user_types
WHERE subdomain = '{{ subdomain }}' -- required
;

INSERT examples

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.

INSERT INTO okta.meta.user_types (
data__description,
data__displayName,
data__name,
subdomain
)
SELECT
'{{ description }}',
'{{ displayName }}' /* required */,
'{{ name }}' /* required */,
'{{ subdomain }}'
RETURNING
id,
name,
_links,
created,
createdBy,
default,
description,
displayName,
lastUpdated,
lastUpdatedBy
;

UPDATE examples

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.

UPDATE okta.meta.user_types
SET
data__description = '{{ description }}',
data__displayName = '{{ displayName }}'
WHERE
subdomain = '{{ subdomain }}' --required
RETURNING
id,
name,
_links,
created,
createdBy,
default,
description,
displayName,
lastUpdated,
lastUpdatedBy
;

REPLACE examples

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.

REPLACE okta.meta.user_types
SET
data__description = '{{ description }}',
data__displayName = '{{ displayName }}',
data__name = '{{ name }}'
WHERE
subdomain = '{{ subdomain }}' --required
AND data__name = '{{ name }}' --required
AND data__displayName = '{{ displayName }}' --required
AND data__description = '{{ description }}' --required
RETURNING
id,
name,
_links,
created,
createdBy,
default,
description,
displayName,
lastUpdated,
lastUpdatedBy
;

DELETE examples

Deletes a user type permanently.
> Note: You can't delete the default user type or a user type that is currently assigned to users.

DELETE FROM okta.meta.user_types
WHERE subdomain = '{{ subdomain }}' --required
;