PUT /api/groups/:group_id/memberships/:membership_id

change a member's roles in a group (group admin privileges required)

Success Response Code: 200

Params

Param name Description
membership_id
optional

group membership is determined by membership_id or user_id inside the group_membership hash.


Value: Must be a Integer
group_id
required

id / name of group


Value: Must be a String
group_membership
optional

Value: Must be a Hash
group_membership[user_id]
optional

user id


Value: Must be a Integer
group_membership[role]
optional

user's role in the group


Value: Must be one of: <code>admin</code>, <code>member</code>.

Response Fields

id group membership object id Integer
user_id user id for the member Integer
role user's role ["Admin", "Member", "External Contributor"]
role_key key value of user's role ["admin", "member"]

Example Curl Commands

curl -X PUT -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/groups/hrteam/memberships/30.json -H"Content-Type: application/json" -d'{"group_membership":{"role":"Admin"}}'
curl -X PUT -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/groups/hrteam/memberships -H"Content-Type: application/json" -d'{"group_membership":{"id":30,"role":"Admin"}}'
curl -X PUT -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/groups/hrteam/memberships -H"Content-Type: application/json" -d'{"group_membership":{"user_id":26,"role":"Admin"}}'

Examples

PUT 
{
  "group_membership": {
    "role": "Member",
    "user_id": "30"
  }
}
200
{
  "group_membership": {
    "id": 38,
    "user_id": 30,
    "role": "Member",
    "role_key": "member"
  }
}