Change a member's role in a group
curl --request PUT \
--url https://web-api.dev.soxai.site/api/groups/{group_id}/members/{uid}/role \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"role": "member"
}
'import requests
url = "https://web-api.dev.soxai.site/api/groups/{group_id}/members/{uid}/role"
payload = { "role": "member" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({role: 'member'})
};
fetch('https://web-api.dev.soxai.site/api/groups/{group_id}/members/{uid}/role', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"uid": "user456",
"groupId": "b7d1f0c9a2e4d6f8b0c1",
"role": "admin",
"status": "active",
"displayName": "Dad",
"joinedAt": "2026-08-03T09:30:00+00:00",
"masterHidden": false,
"sharedFields": {
"sleep_score": true,
"health_score": true,
"activity_score": false,
"sleep_total_time_exclude_awake": false,
"activity_steps": true,
"heat_stroke_severity": true,
"last_sync_time": true
},
"sharingScope": "group_only"
}{
"error": "bad-request",
"error_msg": "role must be 'admin' or 'member'"
}{
"error": "http-error",
"error_msg": "Invalid authentication credentials. <reason>"
}{
"error": "forbidden",
"error_msg": "Not enough permission"
}{
"error": "not-found",
"error_msg": "member not found"
}{
"error": "unprocessable-entity",
"error_msg": "body.<field>: <validation message>"
}{
"error": "rate-limited",
"error_msg": "Rate limit exceeded. Retry after <n> seconds."
}{
"error": "internal-server-error",
"error_msg": "Failed to fetch data: <error_message>"
}Family Groups
Change a member's role in a group
Not callable with a Sandbox key
A request authenticated with a Sandbox soxai-api-key is answered 403 This endpoint is not available in the sandbox., because it changes state that every Sandbox caller shares. It is published here because the Sandbox runs the same build; use it in Production. See Sandbox.
Promote a member to admin or demote them to member.
Demoting is also the way to make an admin removable: DELETE .../members/{uid} refuses an
admin outright.
Parameters
group_id(path, required) - the group.uid(path, required) - the member whose role changes.- Body (
GroupRoleUpdate):role, eitheradminormember.
Response
200returns the membership with its newrole.
Errors
| Status | Condition |
|---|---|
| 400 | role is neither admin nor member |
| 404 | uid is not on this group’s roster |
Authorization
- Scheme:
Authorization: Bearer <idToken>orsoxai-api-key: <api key>. - Authority inside a group comes from the caller’s own membership record, never from a SOXAI
role: an
Admin,PartnerAdminorOrgAdminclaim grants nothing here. - Required: the
adminrole of this group. A non-member receives403 not a member of this group, and a plain member403 group admin required.
PUT
/
api
/
groups
/
{group_id}
/
members
/
{uid}
/
role
Change a member's role in a group
curl --request PUT \
--url https://web-api.dev.soxai.site/api/groups/{group_id}/members/{uid}/role \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"role": "member"
}
'import requests
url = "https://web-api.dev.soxai.site/api/groups/{group_id}/members/{uid}/role"
payload = { "role": "member" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({role: 'member'})
};
fetch('https://web-api.dev.soxai.site/api/groups/{group_id}/members/{uid}/role', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"uid": "user456",
"groupId": "b7d1f0c9a2e4d6f8b0c1",
"role": "admin",
"status": "active",
"displayName": "Dad",
"joinedAt": "2026-08-03T09:30:00+00:00",
"masterHidden": false,
"sharedFields": {
"sleep_score": true,
"health_score": true,
"activity_score": false,
"sleep_total_time_exclude_awake": false,
"activity_steps": true,
"heat_stroke_severity": true,
"last_sync_time": true
},
"sharingScope": "group_only"
}{
"error": "bad-request",
"error_msg": "role must be 'admin' or 'member'"
}{
"error": "http-error",
"error_msg": "Invalid authentication credentials. <reason>"
}{
"error": "forbidden",
"error_msg": "Not enough permission"
}{
"error": "not-found",
"error_msg": "member not found"
}{
"error": "unprocessable-entity",
"error_msg": "body.<field>: <validation message>"
}{
"error": "rate-limited",
"error_msg": "Rate limit exceeded. Retry after <n> seconds."
}{
"error": "internal-server-error",
"error_msg": "Failed to fetch data: <error_message>"
}Authorizations
HTTPBearerSoxaiApiKey
Path Parameters
Response
The membership with its new role.