Skip to main content

Add/Update Group Members

Important Note

This feature is available in the Business plan. If you haven't upgraded yet, please upgrade before using this feature.

Before using this API, teams need to obtain the user_id first. There are two methods:
Method 1: After inviting members to join the team from the contacts page, obtain user_id through Get Member List
Method 2: Use Register User to create a third-party account and obtain user_id

API Overview

  • Function: Add Member
  • Request Method: POST
  • Request URL: /api/contacts/teams/{team_id}/groups/{group_id}/users/{user_id}?appid={appid}&access_token={access_token}

Request Parameters

Parameter NameTypeRequiredLocationDescriptionExample
team_idintegerYesuriTeam ID43
group_idintegerYesuriGroup ID1923 (defaults to "root directory" when parameter is 0)
user_idintegerYesuriUser ID60000208205
openidstringNobodyUser's unique identifier in third-party platform
Only for partner platforms
This field is identical to open_id, if both are specified, only openid takes effect
abcdefg
open_idstringNobodyUser's unique identifier in third-party platform
Only for partner platforms
This field is deprecated, please use openid
abcdefg
roleintegerNobodyRole, subject to team member limit2:Team Admin;3:Survey Admin;4:Regular Member

Response Parameters

None

Response Examples

  • Successful Request
{
"code": "OK",
"error": {
"type": ""
},
"data": {},
"request_id": "10595b0f-9333-4ad7-8bda-ce2c00119758"
}
  • Failed Request
{
"code": "InvalidArgument",
"error": {
"type": "invalid_param"
},
"data": {},
"request_id": "793fb149-4f12-4439-aa83-01d0e211b15c"
}

Error Codes

error.type CodeDescription
contacts_user_existedUser Already Exists in Contacts
contacts_team_not_foundTeam Not Found
contacts_group_not_foundGroup Not Found
contacts_user_not_foundUser Not Found
contacts_add_user_errorFailed to Add User
invalid_argumentInvalid Parameter
claim_errorNo Permission