- Update a user schema
- okta.schemas.manage
- API_ACCESS_MANAGEMENT_ADMIN
- ORG_ADMIN
- APP_ADMIN
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
nullto remove them from the schema; otherwise,POSTis interpreted as a partial update.
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.
- https://subdomain.okta.comhttps://subdomain.okta.com/api/v1/meta/schemas/user/{schemaId}
curl -i -X POST \
'https://subdomain.okta.com/api/v1/meta/schemas/user/{schemaId}' \
-H 'Content-Type: application/json' \
-d '{
"definitions": {
"custom": {
"id": "#custom",
"type": "object",
"properties": {
"salesforceUserName": {
"title": "Salesforce username",
"description": "User'\''s username for Salesforce",
"type": "string",
"required": false,
"minLength": 1,
"maxLength": 20,
"permissions": [
{
"principal": "SELF",
"action": "READ_WRITE"
}
]
}
},
"required": []
}
}
}'Success
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.
Type of root schema
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.
{ "id": "https://{yourOktaDomain}/meta/schemas/user/oscmlha7lcRyMn82P1d7", "$schema": "http://json-schema.org/draft-04/schema#", "name": "user", "title": "An Okta user", "lastUpdated": "2015-09-05T10:40:45.000Z", "created": "2015-02-02T10:27:36.000Z", "definitions": { "base": { … }, "custom": { … } }, "type": "object", "properties": { "profile": { … } } }