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:
- get_user_type
- list_user_types
| 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 |
|---|---|---|---|---|
get_user_type | select | typeId, subdomain | Retrieves a user type by ID. Use default to fetch the default user type. | |
list_user_types | select | subdomain | Lists all user types in your org | |
create_user_type | insert | subdomain, name, 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 | typeId, 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 | typeId, subdomain, name, displayName, 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 | typeId, 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 | (default: my-org) |
typeId | string |
SELECT examples​
- get_user_type
- list_user_types
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 typeId = '{{ typeId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;
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​
- 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 (
description,
displayName,
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: "{{ subdomain }}"
description: Required parameter for the user_types resource.
- name: description
value: "{{ description }}"
description: |
The human-readable description of the user type
- name: displayName
value: "{{ displayName }}"
description: |
The human-readable name of the user type
- name: name
value: "{{ name }}"
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
description = '{{ description }}',
displayName = '{{ displayName }}'
WHERE
typeId = '{{ typeId }}' --required
AND 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
description = '{{ description }}',
displayName = '{{ displayName }}',
name = '{{ name }}'
WHERE
typeId = '{{ typeId }}' --required
AND subdomain = '{{ subdomain }}' --required
AND name = '{{ name }}' --required
AND displayName = '{{ displayName }}' --required
AND 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 typeId = '{{ typeId }}' --required
AND subdomain = '{{ subdomain }}' --required
;