Launch Week 02 wrapped — explore all five launches

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.

PUT/v2/projects/{projectId}/members/{userId}
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>"
}'
200
{
  "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_KEYstringRequired

    The organization API key for your Confident AI organization.

Path parameters

  • projectIdstringRequired

    The id of the project, which must belong to your organization.

  • userIdstringRequired

    The id of the user whose membership of this project to change.

Request body

  • roleIdstringRequired

    The 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.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    A 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
    • idstring

      This is the id of the user.

    • emailstring

      This is the email address of the user.

    • namestring | null

      This is the display name of the user, or null when they have not set one.

    • imagestring | null

      This is the URL of the user's avatar, or null when they have none.

    • projectRoleobject | null

      The 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
      • idstring

        The id of the role.

      • namestring

        The name of the role.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI