UpdateMember - Update member

Updated at:

Partially updates the attributes of an organization member. Only the fields you provide are updated; omitted fields retain their current values. For text fields, passing an empty string clears nickName, email, and staffId, but preserves name. For deptIds and roleIds, pass a non-empty set for full replacement, or null/[] to keep the existing value; to clear or reset departments or roles, use MoveMemberDepartments or UpdateMemberRoles instead. The organization owner, deactivated members, and deleted members cannot be updated.

Applicable editions

Region edition

Service endpoint and authorization

  • Get the service endpoint: Replace {domain} in the API request syntax.

  • Get a personal access token.

  • Get the organization ID: Required for Central edition only. Go to the Basic Information page in the organization management console to get the organization ID.

Product

Resource

Required permissions

Organization Management

Organization Members

Read/Write

Request syntax

Region edition

PUT https://{domain}/oapi/v1/platform/members/{id}

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

The personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example

id

string

path

Yes

The organization member ID.

-

object

body

No

deptIds

array[string]

body

No

A full set of department IDs. If you pass null or [], the existing value is preserved. Using an empty array [] to clear the value is not supported.

["99d1****6124"]

email

string

body

No

The member's email address, which must be unique within the organization. The maximum length is 200 characters. Pass an empty string to clear this field.

zhangsan@example.com

name

string

body

No

The member's name, with a maximum length of 50 characters. Passing an empty string preserves the existing value.

Example Name

nickName

string

body

No

The member's nickname, with a maximum length of 50 characters. Pass an empty string to clear this field.

Zhang San

roleIds

array[string]

body

No

A full set of role IDs. If you pass null or [], the existing value is preserved. Using an empty array [] to clear the value is not supported.

["99d1****6124"]

staffId

string

body

No

The member's staff ID, which must be unique within the organization. The maximum length is 50 characters. Pass an empty string to clear this field.

E001

Request example

Region edition

curl -X 'PUT' \
  'https://{domain}/oapi/v1/platform/members/{id}' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "deptIds": ["99d1****6124"],
        "email": "zhangsan@example.com",
        "name": "Example Name",
        "nickName": "Zhang San",
        "roleIds": ["99d1****6124"],
        "staffId": "E001"
    }'

Response parameters

Parameter

Type

Description

Example

-

object

deptIds

array[string]

The member's department IDs.

["99d1****6124"]

email

string

The member's email address.

example@example.com

id

string

The organization member ID.

99d1****6124

joined

string

The timestamp when the member joined the organization.

2023-08-31T03:59:16.201Z

lastUpdated

string

The timestamp of the last update.

2023-08-31T03:59:16.201Z

name

string

The member's name.

Example Name

nickName

string

The member's nickname.

Zhang San

organizationId

string

The organization ID.

99d1****6124

roleIds

array[string]

The member's role IDs.

["99d1****6124"]

staffId

string

The member's staff ID.

E001

status

string

The status of the member. Valid values: ENABLED, DISABLED, UNDELETED, DELETED, NORMAL_USING, and UNVISITED.

ENABLED

userId

string

The user ID.

99d1****6124

username

string

The username. The format is xxx_{organization_identifier}.

zhangsan_org1

visited

string

The timestamp of the member's last visit.

2023-08-31T03:59:16.201Z

Response example

{
    "deptIds": ["99d1****6124"],
    "email": "example@example.com",
    "id": "99d1****6124",
    "joined": "2023-08-31T03:59:16.201Z",
    "lastUpdated": "2023-08-31T03:59:16.201Z",
    "name": "Example Name",
    "nickName": "Zhang San",
    "organizationId": "99d1****6124",
    "roleIds": ["99d1****6124"],
    "staffId": "E001",
    "status": "ENABLED",
    "userId": "99d1****6124",
    "username": "zhangsan_org1",
    "visited": "2023-08-31T03:59:16.201Z"
}

Error codes

For API error codes, see the Error Code Center.