The identifier of the organization.
PATCH
/admin/v1/organizations/{organizationId}/members/{userId}Update a member
Updates specified organization member.
query parameters
Returns
curl https://api.userhub.com/admin/v1/organizations/org_28seyVGVL1got6/members/usr_MKFxzgJaAH8JQ4 \
-H "Authorization: Bearer $ADMIN_API_KEY" \
-X PATCH \
--json '{
"roleId": "admin"
}'
const res = await adminApi.organizations.updateMember(
"org_28seyVGVL1got6",
"usr_MKFxzgJaAH8JQ4",
{
roleId: "admin",
},
);
res, err := adminApi.Organizations().UpdateMember(
context.Background(),
"org_28seyVGVL1got6",
"usr_MKFxzgJaAH8JQ4",
&adminapi.OrganizationUpdateMemberInput{
RoleId: "admin",
},
)
$res = $adminApi->organizations->updateMember(
organizationId: 'org_28seyVGVL1got6',
userId: 'usr_MKFxzgJaAH8JQ4',
roleId: 'admin',
);
res = admin_api.organizations.update_member(
organization_id="org_28seyVGVL1got6",
user_id="usr_MKFxzgJaAH8JQ4",
role_id="admin",
)
Response bodyJSON
{
"state": "ACTIVE",
"user": {
"id": "usr_MKFxzgJaAH8JQ4",
"state": "ACTIVE",
"displayName": "Jane Doe",
"email": "[email protected]",
"emailVerified": true,
"phoneNumber": "+12125550123",
"phoneNumberVerified": false,
"imageUrl": "https://example.com/jane.jpg",
"currencyCode": "USD",
"languageCode": "en",
"regionCode": "US",
"timeZone": "America/New_York",
"address": {
"lines": [
"42 West St"
],
"city": "Brooklyn",
"state": "New York",
"postalCode": "11222",
"country": "US"
},
"accountConnections": [],
"subscription": null,
"memberships": [],
"signupTime": "2024-06-15T13:00:00Z",
"createTime": "2024-06-15T13:00:00Z",
"updateTime": "2024-06-15T13:00:00Z"
},
"role": {
"id": "role_51jav4KK",
"uniqueId": "admin",
"displayName": "Admin",
"type": "MEMBER",
"description": "Can manage members of the organization",
"permissionSets": [
"billing.readonly",
"members.readwrite"
],
"default": false,
"archived": false,
"createTime": "2024-06-15T13:00:00Z",
"updateTime": "2024-06-15T13:00:00Z"
},
"seat": null,
"createTime": "2024-06-15T13:00:00Z",
"updateTime": "2024-06-15T13:00:00Z"
}