Skip to content

Update a user schema

Request

OAuth 2.0 scope:
  • okta.schemas.manage
Admin roles:
  • 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 null to remove them from the schema; otherwise, POST is interpreted as a partial update.

Path
schemaIdstringrequired

Schema ID. You can also use default to refer to the default user type schema.

Bodyapplication/jsonrequired
definitionsobject(UserSchemaDefinitions)

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.

propertiesobject(UserSchemaProperties)

User Object Properties

titlestring

User-defined display name for the schema

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": []
      }
    }
  }'

Responses

Success

Bodyapplication/json
$schemastringread-only

JSON schema version identifier

createdstringread-only

Timestamp when the schema was created

definitionsobject(UserSchemaDefinitions)

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.

idstringread-only

URI of user schema

lastUpdatedstringread-only

Timestamp when the schema was last updated

namestringread-only

Name of the schema

propertiesobject(UserSchemaProperties)

User Object Properties

titlestring

User-defined display name for the schema

typestringread-only

Type of root schema

Response
{ "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": { … } } }