Members
Overview
The Confident AI SDK exposes every Member method on the platform. This page documents how to call these methods in all supported languages. See the introduction to install the SDK and set your API key.
Methods
List Members
Lists your organization's members one page at a time. Membership here is what grants access to the organization itself, so every project's member list is drawn from this one.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.organization.list_members(page=1, page_size=25)For async mode, call a_list_members and await it as shown below:
result = await client.organization.a_list_members(...)Parameters
| Parameter | Type | Description |
|---|---|---|
page | Optional[int] | The page to return. Defaults to 1. |
page_size | Optional[int] | The number of members per page, at most 100. Defaults to 25. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.organization.listMembers(
{ page: 1, pageSize: 25 },
);Parameters
| Parameter | Type | Description |
|---|---|---|
page | number | The page to return. Defaults to 1. |
pageSize | number | The number of members per page, at most 100. Defaults to 25. |
Returns
This method returns an object of type OrganizationMemberList.
Update Member Role
Replaces a member's organization role, which changes what they may do 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 another role directly is refused. The member's project roles are left untouched.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.organization.update_member_role(
user_id="<USER-ID>",
role_id="<ROLE-ID>",
)For async mode, call a_update_member_role and await it as shown below:
result = await client.organization.a_update_member_role(...)Parameters
| Parameter | Type | Description |
|---|---|---|
user_id | str | Required. The id of the user whose organization membership to change. |
role_id | str | Required. 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. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.organization.updateMemberRole(
"<USER-ID>",
"<ROLE-ID>",
);Parameters
| Parameter | Type | Description |
|---|---|---|
userId | string | Required. The id of the user whose organization membership to change. |
roleId | string | Required. 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. |
Returns
This method returns an object of type OrganizationMember.
Remove Member
Revokes a member's access to the organization and everything inside it: they are detached from every project, their organization and project roles are deleted, and any outstanding invitation for their email is cleared. The Owner cannot be removed, so transfer ownership first. The only way back is a fresh invitation, which returns them with no project access. Their account and the records they created are kept.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.organization.remove_member(user_id="<USER-ID>")For async mode, call a_remove_member and await it as shown below:
result = await client.organization.a_remove_member(...)Parameters
| Parameter | Type | Description |
|---|---|---|
user_id | str | Required. The id of the user whose organization membership to change. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.organization.removeMember("<USER-ID>");Parameters
| Parameter | Type | Description |
|---|---|---|
userId | string | Required. The id of the user whose organization membership to change. |
Returns
This method returns an object of type MemberRef.
Types
MemberRef
Confirmation that the user is no longer a member. Removing an organization member also removes them from every project in it; removing a project member leaves their organization membership untouched.
class MemberRef:
id: stridstrRequired
The id of the user who was removed.
Example: "<USER-ID>"
interface MemberRef {
id: string;
}idstringRequired
The id of the user who was removed.
Example: "<USER-ID>"
MemberRole
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.
class MemberRole:
id: str
name: stridstrRequired
The id of the role.
Example: "<ROLE-ID>"
namestrRequired
The name of the role.
Example: "Admin"
interface MemberRole {
id: string;
name: string;
}idstringRequired
The id of the role.
Example: "<ROLE-ID>"
namestringRequired
The name of the role.
Example: "Admin"
OrganizationMember
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.
class OrganizationMember:
id: str
email: str
name: Optional[str]
image: Optional[str]
organization_role: Optional[MemberRole] = Field(alias="organizationRole")idstrRequired
This is the id of the user.
Example: "<USER-ID>"
emailstrRequired
This is the email address of the user.
Example: "jane@acme.com"
nameOptional[str]Required
This is the display name of the user, or null when they have not set one.
Example: "Jane Doe"
imageOptional[str]Required
This is the URL of the user's avatar, or null when they have none.
organization_roleOptional[MemberRole]Required
The organization role this member holds, or null when they are attached to the organization without one.
See MemberRole.
interface OrganizationMember {
id: string;
email: string;
name: string | null;
image: string | null;
organizationRole: MemberRole | null;
}idstringRequired
This is the id of the user.
Example: "<USER-ID>"
emailstringRequired
This is the email address of the user.
Example: "jane@acme.com"
namestring | nullRequired
This is the display name of the user, or null when they have not set one.
Example: "Jane Doe"
imagestring | nullRequired
This is the URL of the user's avatar, or null when they have none.
organizationRoleMemberRole | nullRequired
The organization role this member holds, or null when they are attached to the organization without one.
See MemberRole.
OrganizationMemberList
One page of organization members, with the total across all pages.
class OrganizationMemberList:
members: List[OrganizationMember]
total_organization_members: int = Field(alias="totalOrganizationMembers")
page: int
page_size: int = Field(alias="pageSize")membersList[OrganizationMember]Required
The organization's members for the current page.
See OrganizationMember.
total_organization_membersintRequired
The total number of members in the organization, across every page.
Example: 3
pageintRequired
The page this response covers.
Example: 1
page_sizeintRequired
The number of members per page.
Example: 25
interface OrganizationMemberList {
members: OrganizationMember[];
totalOrganizationMembers: number;
page: number;
pageSize: number;
}membersOrganizationMember[]Required
The organization's members for the current page.
See OrganizationMember.
totalOrganizationMembersnumberRequired
The total number of members in the organization, across every page.
Example: 3
pagenumberRequired
The page this response covers.
Example: 1
pageSizenumberRequired
The number of members per page.
Example: 25
Last updated on