Launch Week 02 wrapped — explore all five launches

Update Role

PUThttps://api.confident-ai.com/v2/organization/members/{userId}

Replaces a member's organization role, which changes what they may do across the organization from their next request onwards. Assigning the Owner role transfers ownership: the member becomes Owner and the previous Owner is demoted to Admin in the same transaction. That is the only way the Owner's role changes — moving the Owner onto any other role directly is refused. A role id belonging to another organization is rejected, and the member's project roles are left untouched.

PUT/v2/organization/members/{userId}
curl -X PUT "https://api.confident-ai.com/v2/organization/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,
    "organizationRole": {
      "id": "<ROLE-ID>",
      "name": "Admin"
    }
  },
  "deprecated": false
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The organization API key for your Confident AI organization.

Path parameters

  • userIdstringRequired

    The id of the user whose organization membership 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 your organization, with the role that decides what they can do in it. Organization membership alone grants no access to any project's data.

    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.

    • organizationRoleobject | 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