user_schemas
Creates, updates, deletes, gets or lists a user_schemas resource.
Overview​
| Name | user_schemas |
| Type | Resource |
| Id | okta.meta.user_schemas |
Fields​
The following fields are returned by SELECT queries:
- get_user_schema
| Name | Datatype | Description |
|---|---|---|
id | string | URI of user schema |
name | string | Name of the schema |
$schema | string | JSON schema version identifier |
_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 | Timestamp when the schema was created |
definitions | object | User 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. |
lastUpdated | string | Timestamp when the schema was last updated |
properties | object | User Object Properties |
title | string | User-defined display name for the schema |
type | string | Type of root schema |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_user_schema | select | schemaId, subdomain | Retrieves the schema for a user type | |
update_user_profile | update | schemaId, subdomain | 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. |
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 |
|---|---|---|
schemaId | string | Schema ID. You can also use default to refer to the default user type schema. |
subdomain | string | (default: my-org) |
SELECT examples​
- get_user_schema
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​
- update_user_profile
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;