Updated on 2024-04-10 GMT+08:00

Partially Updating a User

Function

This API is used to update some attributes of a user.

URI

PATCH /{tenant_id}/scim/v2/Users/{user_id}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

tenant_id

Yes

String

Globally unique ID of a tenant

user_id

Yes

String

Globally unique ID of a user

Request Parameters

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

Authorization

Yes

String

Bearer token

Table 3 Parameters in the request body

Parameter

Mandatory

Type

Description

schemas

No

Array of strings

Summary

Operations

No

Array of objects

List of the updates to be performed

Table 4 Operations

Parameter

Mandatory

Type

Description

op

No

String

Update type. add: add an attribute; replace: replace an attribute; remove: remove an attribute.

path

No

String

Attribute path to be updated. Only the following attributes of a user can be updated: userName, active, externalId, displayName, nickName, title, userType, preferredLanguage, locale, timezone, name, enterprise, emails, addresses, and phoneNumbers.

value

No

String

Attribute value. You do not need to set this parameter if you intend to remove an attribute.

Response Parameters

Status code: 200

Table 5 Parameters in the response body

Parameter

Type

Description

id

String

Globally unique ID of a user

externalId

String

External ID

meta

Object

Metadata

schemas

Array of strings

Summary

userName

String

Username, which uniquely identifies a user

name

Object

Name of a user

displayName

String

Display name of a user

nickName

String

Nickname of a user

title

String

User title

userType

String

User type

preferredLanguage

String

User's preferred language

locale

String

Geographical area or location of a user

timezone

String

Time zone of a user

active

Boolean

Whether a user is enabled

emails

Array of objects

Email addresses of a user

addresses

Array of objects

Addresses of a user

phoneNumbers

Array of objects

Phone numbers of a user

urn:ietf:params:scim:schemas:extension:enterprise:2.0:User

Object

User's work-related information

Table 6 meta

Parameter

Type

Description

resourceType

String

Resource type

created

String

Resource creation time

lastModified

String

Last resource update time

Table 7 name

Parameter

Type

Description

formatted

String

Formatted name to be displayed

familyName

String

Family name of a user

givenName

String

Given name of a user

middleName

String

Middle name of a user

honorificPrefix

String

Prefix of a user name

honorificSuffix

String

Suffix of a user name

Table 8 emails

Parameter

Type

Description

value

String

Email address

type

String

Email address type

primary

Boolean

Whether the value is the user's primary email address

Table 9 addresses

Parameter

Type

Description

formatted

String

Formatted address to be displayed

streetAddress

String

Street

locality

String

Location

region

String

Region

postalCode

String

Postal code

country

String

Country or region

type

String

Address type

primary

Boolean

Whether the address is the user's primary address

Table 10 phoneNumbers

Parameter

Type

Description

value

String

Phone number

type

String

Phone number type

primary

Boolean

Whether the value is the user's primary phone number

Table 11 urn:ietf:params:scim:schemas:extension:enterprise:2.0:User

Parameter

Type

Description

costCenter

String

Cost center

Minimum length: 1

Maximum length: 1024

department

String

Department

Minimum length: 1

Maximum length: 1024

division

String

Division

Minimum length: 1

Maximum length: 1024

employeeNumber

String

Employee ID

Minimum length: 1

Maximum length: 1024

manager

Object

Manager

organization

String

Organization

Minimum length: 1

Maximum length: 1024

Table 12 manager

Parameter

Type

Description

value

String

Manager

Minimum length: 1

Maximum length: 1024

Status code: 400

Table 13 Parameters in the response body

Parameter

Type

Description

schema

String

Summary

schemas

Array of strings

Summary list

detail

String

Exception details

status

Integer

Status code

timeStamp

String

Timestamp

Status code: 403

Table 14 Parameters in the response body

Parameter

Type

Description

schema

String

Summary

schemas

Array of strings

Summary list

detail

String

Exception details

status

Integer

Status code

timeStamp

String

Timestamp

Status code: 404

Table 15 Parameters in the response body

Parameter

Type

Description

schema

String

Summary

schemas

Array of strings

Summary list

detail

String

Exception details

status

Integer

Status code

timeStamp

String

Timestamp

Status code: 409

Table 16 Parameters in the response body

Parameter

Type

Description

schema

String

Summary

schemas

Array of strings

Summary list

detail

String

Exception details

status

Integer

Status code

timeStamp

String

Timestamp

Status code: 500

Table 17 Parameters in the response body

Parameter

Type

Description

schema

String

Summary

schemas

Array of strings

Summary list

detail

String

Exception details

status

Integer

Status code

timeStamp

String

Timestamp

Example Request

Updating some attributes of an existing user

PATCH https://{hostname}/{tenant_id}/scim/v2/Users/{user_id}

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

Example Response

Status code: 200

Successful

{
  "id" : "ac6aa714-daa7-1aaa-aaa2-6715aaaa4dd9",
  "externalId" : "123456",
  "meta" : {
    "resourceType" : "User",
    "created" : "2023-04-08T14:53:43Z",
    "lastModified" : "2023-04-16T21:32:55Z"
  },
  "schemas" : [ "urn:ietf:params:scim:schemas:core:2.0:User" ],
  "userName" : "xxx",
  "name" : {
    "formatted" : "xxx",
    "familyName" : "xxx",
    "givenName" : "xxx",
    "middleName" : "xxx",
    "honorificPrefix" : "xxx",
    "honorificSuffix" : "xxx"
  },
  "displayName" : "xxx",
  "nickName" : "xxx",
  "title" : "xxx",
  "userType" : "xxx",
  "preferredLanguage" : "zh-CN",
  "locale" : "zh-CN",
  "timezone" : "xxx",
  "active" : false,
  "emails" : [ {
    "value" : "xxx",
    "type" : "work",
    "primary" : true
  } ],
  "addresses" : [ {
    "formatted" : "xxx",
    "streetAddress" : "xxx",
    "locality" : "xxx",
    "region" : "xxx",
    "postalCode" : "123456",
    "country" : "xxx",
    "type" : "xxx",
    "primary" : true
  } ],
  "phoneNumbers" : [ {
    "value" : "xxx",
    "type" : "work",
    "primary" : true
  } ]
}

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.