Adding Custom User Schema Attributes Using PATCH

This example shows you how to use PATCH "op": "add" to add custom attributes.

The validations performed while making these operations are similar to the PUT method. See the Validations section for more information.

Update the custom schema to add new attributes using PATCH. In this example, the PATCH "add" operation is used, and the attribute name is picked from the request payload for patching. If the name specified already exists, it is replaced automatically. If it doesn't exist, the attribute is automatically added. If the name property is missing, an error message appears.

Example PATCH Request

PATCH /Schemas/urn:itef:params:scim:schemas:idcs:extension:custom:User
{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [
        {
            "op": "add",
            "path": "attributes",
            "value": [
                {
                    "idcsValuePersisted": true,
                    "uniqueness": "none",
                    "name": "nickName",
                    "idcsDisplayName": "NICKNAME100",
                    "description": "NICKNAME100",
                    "required": false,
                    "type": "string",
                    "idcsMinLength": 10,
                    "idcsMaxLength": 100,
                    "idcsAuditable": true,
                    "caseExact": true,
                    "returned": "default",
                    "idcsSearchable": true,
                    "multiValued": false
                }
            ]
        }
    ]
}

Example JSON Response

{
    "name": "CustomUser",
    "description": "Custom User",
    "id": "urn:ietf:params:scim:schemas:idcs:extension:custom:User",
    "idcsResourceTypes": [
        "User"
    ],
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:Schema"
    ],
    "attributes": [
        {
            "idcsTargetAttributeName": "I_VC_4K_IFLEX_2",
            "idcsDisplayName": "NICKNAME100",
            "description": "NICKNAME100",
            "type": "string",
            "idcsAuditable": true,
            "required": false,
            "returned": "default",
            "idcsValuePersisted": true,
            "idcsMaxLength": 100,
            "idcsSearchable": true,
            "idcsMinLength": 10,
            "multiValued": false,
            "caseExact": true,
            "uniqueness": "none",
            "name": "nickName"
        }
    ],
    "meta": {
        "lastModified": "2018-08-15T19:31:37.247Z",
        "resourceType": "TenantSchema",
        "created": "2018-08-15T05:02:13.788Z",
        "location": "https://<tenant-base-url>/admin/v1/TenantSchemas/urn:ietf:params:scim:schemas:idcs:extension:custom:User"
    },
    "idcsLastModifiedBy": {
        "type": "App",
        "display": "admin",
        "$ref": "https://<tenant-base-url>/admin/v1/Apps"
    },
    "idcsCreatedBy": {
        "value": "158d625222f442ef8fcc817593701dd9",
        "type": "App",
        "display": "idcssm",
        "$ref": "https://<tenant-base-url>/admin/v1/Apps/158d625222f442ef8fcc817593701dd9"
}