user_types
Creates, updates, deletes, gets or lists a user_types resource.
Overview
| Name | user_types |
| Type | Resource |
| Id | okta.meta.user_types |
Fields
The following fields are returned by SELECT queries:
- list_user_types
- get_user_type
| Name | Datatype | Description |
|---|---|---|
id | string | The unique key for the user type |
name | string | The 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. |
_links | object | Specifies 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. |
created | string (date-time) | A timestamp from when the user type was created |
createdBy | string | The user ID of the account that created the user type |
default | boolean | A boolean value to indicate if this is the default user type |
description | string | The human-readable description of the user type |
displayName | string | The human-readable name of the user type |
lastUpdated | string (date-time) | A timestamp from when the user type was most recently updated |
lastUpdatedBy | string | The user ID of the most recent account to edit the user type |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique key for the user type |
name | string | The 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. |
_links | object | Specifies 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. |
created | string (date-time) | A timestamp from when the user type was created |
createdBy | string | The user ID of the account that created the user type |
default | boolean | A boolean value to indicate if this is the default user type |
description | string | The human-readable description of the user type |
displayName | string | The human-readable name of the user type |
lastUpdated | string (date-time) | A timestamp from when the user type was most recently updated |
lastUpdatedBy | string | The user ID of the most recent account to edit the user type |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_user_types | select | subdomain | Lists all user types in your org | |
get_user_type | select | subdomain | Retrieves a user type by ID. Use default to fetch the default user type. | |
create_user_type | insert | subdomain, data__name, data__displayName | 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. | |
update_user_type | update | subdomain | 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. | |
replace_user_type | replace | subdomain, data__name, data__displayName, data__description | 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. | |
delete_user_type | delete | subdomain | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
subdomain | string | The 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
- list_user_types
- get_user_type
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
;
Retrieves a user type by ID. Use default to fetch the default user type.
SELECT
id,
name,
_links,
created,
createdBy,
default,
description,
displayName,
lastUpdated,
lastUpdatedBy
FROM okta.meta.user_types
WHERE subdomain = '{{ subdomain }}' -- required
;
INSERT examples
- create_user_type
- Manifest
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
;
# Description fields are for documentation purposes
- name: user_types
props:
- name: subdomain
value: string
description: Required parameter for the user_types resource.
- name: description
value: string
description: >
The human-readable description of the user type
- name: displayName
value: string
description: >
The human-readable name of the user type
- name: name
value: string
description: >
The 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.
UPDATE examples
- update_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.
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
- replace_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.
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
- delete_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.
DELETE FROM okta.meta.user_types
WHERE subdomain = '{{ subdomain }}' --required
;