SCIM API for User Modification
a month ago

SCIM API for User Modification

Use the SCIM API to modify a user.

Authentication

Authorization: Bearer <Client Secret>

Use the copied Client Secret key as the Authorization key value.

Request Requirements

Method Request URLResponse Content TypeResponse BodyResponse Codes
PATCH

<Base URI>/Users/id

application/scim+json

User details200, 400, 404, 405, 409, 500

Example Request Data

PATCH <Base URI>/"<id>"

Authorization: Bearer 29da0602f6db1ed033aa91d644ce4d70bdf3ab58

Content-Type: application/scim+json

Add - Single-valued Attribute

Example Request Body

The following examples display a user modification request.

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [{
            "op": "add",
            "path": "nickname",
            "value": "User One"
        }
    ]
}

Example Response

{
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
    ],
    "id": "5f4f0884-3f54-e183-994e-719a59e05244",
    "meta": {
        "resourceType": "User",
        "created": "2022-12-21T13:59:27.464Z",
        "lastModified": "2022-12-21T14:01:08.961Z",
        "location": "<Base URI>/Users/5f4f0884-3f54-e183-994e-719a59e05244"
    },
    "userName": "User One",
    "active": true,
    "emails": [{
            "value": user.one @ example.com ",
            " type ": " work "
            }
            ],
            " nickName ": " User One ",
            }

Remove - Single-valued Attribute

Example Request Body

The following examples display a user modification request.

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [{
            "op": "remove",
            "path": "nickname"
        }
    ]
}

Example Response

{
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
    ],
    "id": "5f4f0884-3f54-e183-994e-719a59e05244",
    "meta": {
        "resourceType": "User",
        "created": "2022-12-21T13:59:27.464Z",
        "lastModified": "2022-12-21T14:02:12.228Z",
        "location": "<Base URI>/Users/5f4f0884-3f54-e183-994e-719a59e05244"
    },
    "userName": "User One",
    "active": true,
    "emails": [{
            "value": "user.one@example.com",
            "type": "work"
        }
    ]
}

Replace - Single-valued Attribute

Example Request Body

The following examples display a user modification request.

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [{
            "op": "replace",
            "path": "userName",
            "value": "user_one"
        }
    ]
}

Example Response

{
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
    ],
    "id": "5f4f0884-3f54-e183-994e-719a59e05244",
    "meta": {
        "resourceType": "User",
        "created": "2022-12-21T13:59:27.464Z",
        "lastModified": "2022-12-21T14:03:37.041Z",
        "location": "<Base URI>/Users/5f4f0884-3f54-e183-994e-719a59e05244"
    },
    "userName": "user_one",
    "active": true,
    "emails": [{
            "value": "user.one@example.com",
            "type": "work"
        }
    ]
}

Add - Multi-valued Attribute

Example Request Body

The following examples display a user modification request.

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [{
            "op": "add",
            "path": "phoneNumbers",
            "value": [{
                    "type": "work",
                    "value": "+31 65 7777777"
                }, {
                    "type": "mobile",
                    "value": "+31 65 8888888",
                    "primary": true
                }
            ]
        }
    ]
}

Example Response

{
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
    ],
    "id": "5f4f0884-3f54-e183-994e-719a59e05244",
    "meta": {
        "resourceType": "User",
        "created": "2022-12-21T13:59:27.464Z",
        "lastModified": "2022-12-21T14:20:00.100Z",
        "location": "<Base URI>/Users/5f4f0884-3f54-e183-994e-719a59e05244"
    },
    "userName": "user_one",
    "active": true,
    "emails": [{
            "value": "user_one_123@example.com",
            "type": "work"
        }
    ],
    "phoneNumbers": [{
            "value": "+31 65 8888888",
            "type": "mobile"
        }, {
            "value": "+31 65 7777777",
            "type": "work"
        }
    ]
}

Remove - Multi-valued Attribute

Example Request Body

The following examples display a user modification request.

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [{
            "op": "remove",
            "path": "phoneNumbers[type eq \"work\"]"
        }
    ]
}

Example Response

{
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
    ],
    "id": "377d8abf-7f97-5619-3af2-54e1d2f48bbf",
    "meta": {
        "resourceType": "User",
        "created": "2022-12-21T13:25:23.824Z",
        "lastModified": "2022-12-21T14:17:40.933Z",
        "location": "<Base URI>/Users/377d8abf-7f97-5619-3af2-54e1d2f48bbf"
    },
    "userName": "user_two123",
    "name": {
        "familyName": "family_cloud",
        "givenName": "User"
    },
    "displayName": "User Two",
    "active": true,
    "emails": [{
            "value": "usertwo123@example.com",
            "type": "work"
        }
    ]
}

Replace - Multi valued attribute

Example Request Body

The following examples display a user modification request.

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [{
            "op": "replace",
            "value": {
                "emails": [{
                        "value": "user_one123@example.com",
                        "type": "work"
                    }
                ]
            }
        }
    ]
}

Example Response

{
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
    ],
    "id": "5f4f0884-3f54-e183-994e-719a59e05244",
    "meta": {
        "resourceType": "User",
        "created": "2022-12-21T13:59:27.464Z",
        "lastModified": "2022-12-21T14:14:16.257Z",
        "location": "<Base URI>/Users/5f4f0884-3f54-e183-994e-719a59e05244"
    },
    "userName": "user_one",
    "active": true,
    "emails": [{
            "value": "user_one_123@example.com",
            "type": "work"
        }
    ]
}

All Operations - Single-valued Attribute

Example Request Body

The following examples display a user modification request.

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [{
            "op": "remove",
            "path": "nickName"
        }, {
            "op": "replace",
            "path": "userName",
            "value": "user_one_123"
        }, {
            "op": "add",
            "path": "userType",
            "value": "Employee"
        }
    ]
}

Example Response

{
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
    ],
    "id": "5f4f0884-3f54-e183-994e-719a59e05244",
    "meta": {
        "resourceType": "User",
        "created": "2022-12-21T13:59:27.464Z",
        "lastModified": "2022-12-21T14:27:53.799Z",
        "location": "<Base URI>/Users/5f4f0884-3f54-e183-994e-719a59e05244"
    },
    "userName": "user_one_123",
    "active": true,
    "emails": [{
            "value": "user_one_123@example.com",
            "type": "work"
        }
    ],
    "userType": "Employee"
}

All Operations - Multi-valued Attribute

Example Request Body

The following examples display a user modification request.

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [{
            "op": "remove",
            "path": "phoneNumbers[type eq \"work\"]"
        }, {
            "op": "replace",
            "value": {
                "emails": [{
                        "value": "user_one_629@example.com",
                        "type": "work"
                    }
                ]
            }
        }, {
            "op": "add",
            "path": "addresses",
            "value": [{
                    "primary": true,
                    "type": "work",
                    "streetAddress": "Banklaan 1",
                    "locality": "Amsterdam",
                    "region": "Noord Hooland",
                    "postalCode": "1000 AA",
                    "country": "Netherlands"
                }
            ]
        }
    ]
}

Example Response

{
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
    ],
    "id": "5f4f0884-3f54-e183-994e-719a59e05244",
    "meta": {
        "resourceType": "User",
        "created": "2022-12-21T13:59:27.464Z",
        "lastModified": "2022-12-21T14:32:56.250Z",
        "location": "<Base URI>/Users/5f4f0884-3f54-e183-994e-719a59e05244"
    },
    "userName": "user_one_123",
    "active": true,
    "emails": [{
            "value": "user_one_629@example.com",
            "type": "work"
        }
    ],
    "addresses": [{
            "primary": true,
            "type": "work",
            "streetAddress": "Address 1",
            "locality": "Address 2",
            "region": "Address 3",
            "postalCode": "1000 AA",
            "country": "Country 1"
        }
    ]
}

Request Body Parameters

See the SCIM Attributes section for the request parameters.

Response Property Descriptions

See SCIM Attributes.

Response Codes

The following table shows response codes for this API.

CodeDescription
200OK
400

Bad Data

Error message examples:

  • Could not update user. Attribute userName is required and must have a value.

  • Could not update user. Password policy violated.

  • Could not update user. password already exists.

  • Could not update user. email is invalid.

  • Could not update user. Attribute email is required and must have a value.

  • User update failed.

{

Value test is not valid for attribute emails[0].type because it is not one of the canonical types: other, work, home.

}

  • User update failed.

{

Value help is not valid for attribute phoneNumbers[0].type because it is not one of the canonical types: other, pager, work, mobile, fax, home.

}

  • User update failed.

{

Value test is not valid for attribute emails[0].type because it is not one of the canonical types: other, work, home, Attribute userName is required and must have a value.

}

404

Not Found

Error message example:

  • User with id: {{User ID}} not found in identity source {{Identity Source ID}}

405

Method Not Allowed (for Local identity source types).

409

Conflict

Error message examples:

  • Could not update user. userName is already in use.

  • Could not update user. email is already in use.

500

Internal Server Error

Error message example:

  • Unable to set password for user.