Update Role
PUThttps://api.confident-ai.com/v2/projects/{projectId}/members/{userId}
Replaces a member's role in this project, which changes what they may do inside it from their next request onwards. Their organization role and their roles in other projects are untouched. Assigning the Owner role transfers ownership of the project: the member becomes Owner and the previous Owner is demoted to Manager in the same transaction, which is the only way the project Owner's role changes. A role id belonging to another project is rejected.
curl -X PUT "https://api.confident-ai.com/v2/projects/{projectId}/members/{userId}" \
-H "CONFIDENT_API_KEY: <ORGANIZATION-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"roleId": "<ROLE-ID>"
}'{
"success": true,
"data": {
"id": "<USER-ID>",
"email": "jane@acme.com",
"name": "Jane Doe",
"image": null,
"projectRole": {
"id": "<ROLE-ID>",
"name": "Admin"
}
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe organization API key for your Confident AI organization.
Path parameters
projectIdstringRequiredThe id of the project, which must belong to your organization.
userIdstringRequiredThe id of the user whose membership of this project to change.
Request body
roleIdstringRequiredThe id of the role to assign. It must be a Confident AI built-in role or one of the roles the organization or project owns.
Response
Update Role succeeded.
successbooleanIndicates if the request was successful.
dataobjectA user who belongs to this project, with the role that decides what they can do inside it. Every project member is also a member of the project's organization, but the reverse does not hold.
Show 5 propertiesHide 5 properties
idstringThis is the id of the user.
emailstringThis is the email address of the user.
namestring | nullThis is the display name of the user, or null when they have not set one.
imagestring | nullThis is the URL of the user's avatar, or null when they have none.
projectRoleobject | nullThe role a member holds, as referenced from the member. Retrieve the role by id from the roles endpoint of the same scope to see the policies behind it.
Show 2 propertiesHide 2 properties
idstringThe id of the role.
namestringThe name of the role.
deprecatedbooleanIndicates if this endpoint is deprecated.