Public API
User management

Updating user groups

Official SCIM documentation

https://datatracker.ietf.org/group/scim/documents/

Updating user groups

Mutable attributes are marked as readWrite in response of /Schemas endpoint.

User group update can be done by two ways:

  1. Updating all user group attributes at once.

    Use following url with valid payload and valid access token in Authorization header:

    PUT https://masterplan.com/public_api/scim/v2/Groups/<user_group_id:UUID>

    Missing attributes will be set to null.

    Example curl command for updating (overriding) user group:

    curl -X POST https://masterplan.com/public_api/scim/v2/Groups/88efb36a-7ff3-4170-b81f-691a8c86561e
    -H 'Authorization: Bearer ACCESS_TOKEN'
    -H "Content-type: application/json"
    -d '{
             "schemas": [
                 "urn:ietf:params:scim:schemas:core:2.0:Group", 
                 "urn:masterplan:scim:UserGroupAttributes", 
                 ],
             "displayName": "Frontend developers",
             "members": [],
             "urn:masterplan:scim:UserGroupAttributes": {
                 "is_private": true
             },
         }'
    

    Server responds with Group resource.

    {
        "displayName": "Frontend developers",
        "id": "88efb36a-7ff3-4170-b81f-691a8c86561e",
        "members": [],
        "schemas": [
            "urn:ietf:params:scim:schemas:core:2.0:Group",
            "urn:masterplan:scim:UserGroupAttributes"
        ],
        "urn:masterplan:scim:UserGroupAttributes": {
            "is_private": true,
            "owner": {
                "$ref": "https://masterplan.com/public_api/scim/v2/Users/3a0d0c3d-f3dd-482d-9721-b89132d03391",
                "type": "User",
                "value": "3a0d0c3d-f3dd-482d-9721-b89132d03391"
            }
        },
        "meta": {
            "created": "2023-05-14T22:18:16.572467+00:00",
            "location": "https://masterplan.com/public_api/scim/v2/Groups/88efb36a-7ff3-4170-b81f-691a8c86561e",
            "resourceType": "Group"
        }
    }
    
  2. Sending list of actions that should be performed on user group.

    Use following url with valid payload and valid access token in Authorization header:

    PATCH https://masterplan.com/public_api/scim/v2/Groups/<user_group_id:UUID>

    Example curl command for updating user group:

     curl -X PUT https://masterplan.com/public_api/scim/v2/Groups/88efb36a-7ff3-4170-b81f-691a8c86561e
     -H 'Authorization: Bearer ACCESS_TOKEN'
     -H "Content-type: application/json"
     -d '{
              "schemas": [
                 "urn:ietf:params:scim:api:messages:2.0:PatchOp"
               ],
              "Operations": [
                 {
                     "op": "replace",
                     "path": "displayName",
                     "value": "Backend developers"
                 },
                 {
                     "op": "add",
                     "path": "members",
                     "value": [
                       {
                         "value":"406a917c-8c8d-4579-8045-e7fafd2dda56",
                         "type": "User"
                       },
                       {
                         "value":"99be05d3-a828-458b-aa92-3256f7b029c0",
                         "type": "User"
                       },                    
                     ]
                 },
                 {
                     "op": "replace",
                     "path": "urn:masterplan:scim:UserGroupAttributes:is_private",
                     "value": true
                 }
              ]
          }'
        
    

    Server responds with Group resource.

    Example response

    {
        "displayName": "Backend developers",
        "id": "88efb36a-7ff3-4170-b81f-691a8c86561e",
        "members": [
            {
                "$ref": "https://masterplan.com/public_api/scim/v2/Users/406a917c-8c8d-4579-8045-e7fafd2dda56",
                "type": "User",
                "value": "406a917c-8c8d-4579-8045-e7fafd2dda56"
            },
            {
                "$ref": "https://masterplan.com/public_api/scim/v2/Users/99be05d3-a828-458b-aa92-3256f7b029c0",
                "type": "User",
                "value": "99be05d3-a828-458b-aa92-3256f7b029c0"
            }
        ],
        "schemas": [
            "urn:ietf:params:scim:schemas:core:2.0:Group",
            "urn:masterplan:scim:UserGroupAttributes"
        ],
        "urn:masterplan:scim:UserGroupAttributes": {
            "is_private": true,
            "owner": {
                "$ref": "https://masterplan.com/public_api/scim/v2/Users/3a0d0c3d-f3dd-482d-9721-b89132d03391",
                "type": "User",
                "value": "3a0d0c3d-f3dd-482d-9721-b89132d03391"
            }
        },
        "meta": {
            "created": "2023-05-14T22:18:16.572467+00:00",
            "location": "https://masterplan.com/public_api/scim/v2/Groups/88efb36a-7ff3-4170-b81f-691a8c86561e",
            "resourceType": "Group"
        }
    }
    
PAGE CONTENT