Public API
User management
Updating user
Official SCIM documentation
https://datatracker.ietf.org/group/scim/documents/
Updating users
Mutable attributes are marked as readWrite
in response of /Schemas
endpoint.
User update can be done by two ways:
-
Updating all user attributes at once.
Use following url with valid payload and valid access token in
Authorization
header:PUT https://masterplan.com/public_api/scim/v2/Users/<user_id:UUID>
Missing attributes will be set to
null
.Example curl command for updating (overriding) user:
curl -X PUT https://masterplan.com/public_api/scim/v2/Users/3580e3fd-a80b-4fd4-9dd4-1203a036f6b6 -H 'Authorization: Bearer ACCESS_TOKEN' -H "Content-type: application/json" -d '{ "schemas": [ "urn:masterplan:scim:UserAttributes" ], "emails": [{"value": "marknew@example.com"}], "name": {"givenName": "Mark", "familyName": "New"}, "roles": ["student"], }'
Server responds with
User
resource.{ "active": true, "emails": [ { "primary": true, "type": "work", "value": "marknew@example.com" } ], "external_id": "kxzpnRDKNtFgRVa_eygO9LWIJeGKOXqXSrYIfowsxS8", "id": "d3a1177f-a9f0-4027-83a4-80d06368fcf3", "meta": { "created": "2023-05-14T22:18:16.572467+00:00", "location": "https://masterplan.com/public_api/scim/v2/Users/d3a1177f-a9f0-4027-83a4-80d06368fcf3", "resourceType": "User" }, "name": { "familyName": "Mark", "givenName": "New" }, "schemas": [ "urn:masterplan:scim:UserAttributes", "urn:ietf:params:scim:schemas:core:2.0:User", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User" ], "userName": "marknew@example.com", "phoneNumbers": [ { "primary": true, "type": "work", "value": "123-8800-12" } ], "roles": [ "student" ], "title": null, "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { "department": null }, "urn:masterplan:scim:UserAttributes": { "licenses": 10 }, "userType": null }
-
Sending list of actions that should be performed on user.
Use following url with valid payload and valid access token in
Authorization
header:PATCH https://masterplan.com/public_api/scim/v2/Users/<user_id:UUID>
Example curl command for updating user:
curl -X PUT https://masterplan.com/public_api/scim/v2/Users/3580e3fd-a80b-4fd4-9dd4-1203a036f6b6 -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": "userType", "value": "Lead frontend developer" }, { "op": "Replace", "path": "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department", "value": "Frontend" }, { "op": "remove", "path": "name.familyName" } ] }'
Server responds with
User
resource.{ "active": true, "emails": [ { "primary": true, "type": "work", "value": "johndoe@example.com" } ], "external_id": "kxzpnRDKNtFgRVa_eygO9LWIJeGKOXqXSrYIfowsxS8", "id": "d3a1177f-a9f0-4027-83a4-80d06368fcf3", "meta": { "created": "2023-05-14T22:18:16.572467+00:00", "location": "https://masterplan.com/public_api/scim/v2/Users/d3a1177f-a9f0-4027-83a4-80d06368fcf3", "resourceType": "User" }, "name": { "familyName": null, "givenName": "Doe" }, "schemas": [ "urn:masterplan:scim:UserAttributes", "urn:ietf:params:scim:schemas:core:2.0:User", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User" ], "userName": "johndoe@example.com", "phoneNumbers": [ { "primary": true, "type": "work", "value": "123-8800-12" } ], "roles": [ "manager" ], "title": "Mr", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { "department": "Frontend" }, "urn:masterplan:scim:UserAttributes": { "licenses": 10 }, "userType": "Lead frontend developer" }