curl --request PATCH \
--url https://api-prod.heliyos.ai/v1/auth/team-memberships/{id}/role \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"roleId": "66a0f1e2d3c4b5a697880a02"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({roleId: '66a0f1e2d3c4b5a697880a02'})
};
fetch('https://api-prod.heliyos.ai/v1/auth/team-memberships/{id}/role', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-prod.heliyos.ai/v1/auth/team-memberships/{id}/role"
payload = { "roleId": "66a0f1e2d3c4b5a697880a02" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"meta": {
"message": "Role updated successfully."
},
"data": {}
}{
"message": "<string>",
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"details": "<unknown>"
}
}{
"message": "<string>",
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"details": "<unknown>"
}
}{
"message": "<string>",
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"details": "<unknown>"
}
}{
"message": "<string>",
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"details": "<unknown>"
}
}{
"message": "<string>",
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"details": "<unknown>"
}
}Change a team member role
Gives a member or a pending invitation a new role, by membership id. The change applies to the person’s next request.
A person moved to a role below admin (MEMBER) loses the API keys they created in the
workspace: they are revoked.
Only owners and admins can change roles. Nobody can change their own role. Only an owner can grant the owner role or change an owner’s role, and the workspace’s last owner cannot be moved to another role.
curl --request PATCH \
--url https://api-prod.heliyos.ai/v1/auth/team-memberships/{id}/role \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"roleId": "66a0f1e2d3c4b5a697880a02"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({roleId: '66a0f1e2d3c4b5a697880a02'})
};
fetch('https://api-prod.heliyos.ai/v1/auth/team-memberships/{id}/role', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-prod.heliyos.ai/v1/auth/team-memberships/{id}/role"
payload = { "roleId": "66a0f1e2d3c4b5a697880a02" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"meta": {
"message": "Role updated successfully."
},
"data": {}
}{
"message": "<string>",
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"details": "<unknown>"
}
}{
"message": "<string>",
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"details": "<unknown>"
}
}{
"message": "<string>",
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"details": "<unknown>"
}
}{
"message": "<string>",
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"details": "<unknown>"
}
}{
"message": "<string>",
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"details": "<unknown>"
}
}403 FORBIDDEN_ACTION (“API keys cannot
access this endpoint.”). Change roles in Heliyos under Settings, Team.heliyos_team_members_change_role.Authorizations
A workspace API key, sent as Authorization: Bearer heliyos_.... Create one in Heliyos under Settings → API keys. A key acts as a workspace admin in the one workspace it was created in.
Path Parameters
The membership id, from List team members.
^[0-9a-fA-F]{24}$Body
The new role's id, from List roles: OWNER, ADMIN or MEMBER, or AGENCY in an agency workspace.
^[0-9a-fA-F]{24}$"66f1a8c3e4b0a1b2c3d4e5f6"
Was this page helpful?

