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 the members of one project a page at a time. Project members are drawn from the organization's members: someone can belong to the organization and not appear here, and being here is what gives them access to this project's data.
from confident_ai import ConfidentAI
client = ConfidentAI()
project = client.project(project_id="<PROJECT-ID>")
result = project.list_members(page=1, page_size=25)For async mode, call a_list_members and await it as shown below:
result = await project.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 project = client.project("<PROJECT-ID>");
const result = await project.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 ProjectMemberList.
Update Member Role
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.
from confident_ai import ConfidentAI
client = ConfidentAI()
project = client.project(project_id="<PROJECT-ID>")
result = project.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 project.a_update_member_role(...)Parameters
| Parameter | Type | Description |
|---|---|---|
user_id | str | Required. The id of the user whose membership of this project 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 project = client.project("<PROJECT-ID>");
const result = await project.updateMemberRole("<USER-ID>", "<ROLE-ID>");Parameters
| Parameter | Type | Description |
|---|---|---|
userId | string | Required. The id of the user whose membership of this project 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 ProjectMember.
Remove Member
Revokes a member's access to this project only: they are disconnected from it, their project role is deleted, and any outstanding invitation for their email on this project is cleared. They keep their organization membership and access to every other project, so this does not free up a seat. The project Owner cannot be removed, so transfer ownership first. Inviting the same address again brings them back with the default role rather than the one they had.
from confident_ai import ConfidentAI
client = ConfidentAI()
project = client.project(project_id="<PROJECT-ID>")
result = project.remove_member(user_id="<USER-ID>")For async mode, call a_remove_member and await it as shown below:
result = await project.a_remove_member(...)Parameters
| Parameter | Type | Description |
|---|---|---|
user_id | str | Required. The id of the user whose membership of this project to change. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const project = client.project("<PROJECT-ID>");
const result = await project.removeMember("<USER-ID>");Parameters
| Parameter | Type | Description |
|---|---|---|
userId | string | Required. The id of the user whose membership of this project to change. |
Returns
This method returns an object of type MemberRef.
Methods (Stateless)
These methods take every argument themselves, so a caller reaches them through client.projects without opening a Project first.
List Members
Lists the members of one project a page at a time. Project members are drawn from the organization's members: someone can belong to the organization and not appear here, and being here is what gives them access to this project's data.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.projects.list_members(
project_id="<PROJECT-ID>",
page=1,
page_size=25,
)For async mode, call a_list_members and await it as shown below:
result = await client.projects.a_list_members(...)Parameters
| Parameter | Type | Description |
|---|---|---|
project_id | str | Required. The id of the project, which must belong to your organization. |
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.projects.listMembers(
"<PROJECT-ID>",
{ page: 1, pageSize: 25 },
);Parameters
| Parameter | Type | Description |
|---|---|---|
projectId | string | Required. The id of the project, which must belong to your organization. |
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 ProjectMemberList.
Update Member Role
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.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.projects.update_member_role(
project_id="<PROJECT-ID>",
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.projects.a_update_member_role(...)Parameters
| Parameter | Type | Description |
|---|---|---|
project_id | str | Required. The id of the project, which must belong to your organization. |
user_id | str | Required. The id of the user whose membership of this project 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.projects.updateMemberRole(
"<PROJECT-ID>",
"<USER-ID>",
"<ROLE-ID>",
);Parameters
| Parameter | Type | Description |
|---|---|---|
projectId | string | Required. The id of the project, which must belong to your organization. |
userId | string | Required. The id of the user whose membership of this project 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 ProjectMember.
Remove Member
Revokes a member's access to this project only: they are disconnected from it, their project role is deleted, and any outstanding invitation for their email on this project is cleared. They keep their organization membership and access to every other project, so this does not free up a seat. The project Owner cannot be removed, so transfer ownership first. Inviting the same address again brings them back with the default role rather than the one they had.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.projects.remove_member(
project_id="<PROJECT-ID>",
user_id="<USER-ID>",
)For async mode, call a_remove_member and await it as shown below:
result = await client.projects.a_remove_member(...)Parameters
| Parameter | Type | Description |
|---|---|---|
project_id | str | Required. The id of the project, which must belong to your organization. |
user_id | str | Required. The id of the user whose membership of this project to change. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.projects.removeMember(
"<PROJECT-ID>",
"<USER-ID>",
);Parameters
| Parameter | Type | Description |
|---|---|---|
projectId | string | Required. The id of the project, which must belong to your organization. |
userId | string | Required. The id of the user whose membership of this project 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"
ProjectMember
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.
class ProjectMember:
id: str
email: str
name: Optional[str]
image: Optional[str]
project_role: Optional[MemberRole] = Field(alias="projectRole")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.
project_roleOptional[MemberRole]Required
The role this member holds in the project, or null when they are attached to the project without one.
See MemberRole.
interface ProjectMember {
id: string;
email: string;
name: string | null;
image: string | null;
projectRole: 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.
projectRoleMemberRole | nullRequired
The role this member holds in the project, or null when they are attached to the project without one.
See MemberRole.
ProjectMemberList
One page of project members, with the total across all pages.
class ProjectMemberList:
members: List[ProjectMember]
total_project_members: int = Field(alias="totalProjectMembers")
page: int
page_size: int = Field(alias="pageSize")membersList[ProjectMember]Required
The project's members for the current page.
See ProjectMember.
total_project_membersintRequired
The total number of members in the project, across every page.
Example: 3
pageintRequired
The page this response covers.
Example: 1
page_sizeintRequired
The number of members per page.
Example: 25
interface ProjectMemberList {
members: ProjectMember[];
totalProjectMembers: number;
page: number;
pageSize: number;
}membersProjectMember[]Required
The project's members for the current page.
See ProjectMember.
totalProjectMembersnumberRequired
The total number of members in the project, 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