Skip to main content

user_schemas

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

Overview​

Nameuser_schemas
TypeResource
Idokta.meta.user_schemas

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringURI of user schema
namestringName of the schema
$schemastringJSON schema version identifier
_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.
createdstringTimestamp when the schema was created
definitionsobjectUser profile subschemas The profile object for a user is defined by a composite schema of base and custom properties using a JSON path to reference subschemas. The #base properties are defined and versioned by Okta, while #custom properties are extensible. Custom property names for the profile object must be unique and can't conflict with a property name defined in the #base subschema.
lastUpdatedstringTimestamp when the schema was last updated
propertiesobjectUser Object Properties
titlestringUser-defined display name for the schema
typestringType of root schema

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_user_schemaselectschemaId, subdomainRetrieves the schema for a user type
update_user_profileupdateschemaId, subdomainUpdates a user schema. Use this request to update, add, or remove one or more profile properties in a user schema. If you specify default for the schemaId, updates will apply to the default user type.

Unlike custom user profile properties, limited changes are allowed to base user profile properties (permissions, nullability of the firstName and lastName properties, or pattern for login).
You can't remove a property from the default schema if it's being referenced as a matchAttribute in SAML2 IdPs.
Currently, all validation of SAML assertions are only performed against the default user type.

> Note: You must set properties explicitly to null to remove them from the schema; otherwise, POST is interpreted as a partial update.

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
schemaIdstringSchema ID. You can also use default to refer to the default user type schema.
subdomainstring(default: my-org)

SELECT examples​

Retrieves the schema for a user type

SELECT
id,
name,
$schema,
_links,
created,
definitions,
lastUpdated,
properties,
title,
type
FROM okta.meta.user_schemas
WHERE schemaId = '{{ schemaId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;

UPDATE examples​

Updates a user schema. Use this request to update, add, or remove one or more profile properties in a user schema. If you specify default for the schemaId, updates will apply to the default user type.

Unlike custom user profile properties, limited changes are allowed to base user profile properties (permissions, nullability of the firstName and lastName properties, or pattern for login).
You can't remove a property from the default schema if it's being referenced as a matchAttribute in SAML2 IdPs.
Currently, all validation of SAML assertions are only performed against the default user type.

> Note: You must set properties explicitly to null to remove them from the schema; otherwise, POST is interpreted as a partial update.

UPDATE okta.meta.user_schemas
SET
definitions = '{{ definitions }}',
properties = '{{ properties }}',
title = '{{ title }}'
WHERE
schemaId = '{{ schemaId }}' --required
AND subdomain = '{{ subdomain }}' --required
RETURNING
id,
name,
$schema,
_links,
created,
definitions,
lastUpdated,
properties,
title,
type;