aip_sdk.Workspace
aip_sdk.Workspace(data: dict[str, Any], client: APIClient)
A workspace groups projects and defines access control.
Create and manage workspaces through the API. Workspace-level permissions (admin, editor, viewer) determine what a user can do with all projects in the workspace.
aip_sdk.Workspace.add_member
aip_sdk.Workspace.add_member(user_id: str, role: str = 'workspace_viewer') -> WorkspaceMember
Add a user to this workspace with the given role.
Parameters
user_idstr: User ID to add.rolestr: One ofworkspace_admin,workspace_editor,workspace_viewer.
Requires workspace_admin or platform_admin.
aip_sdk.Workspace.create
aip_sdk.Workspace.create(name: str, client: APIClient | None = None) -> Workspace
Create a new workspace.
Requires platform admin privileges (JWT token from /auth/token with is_platform_admin=True, or an admin x-api-key).
aip_sdk.Workspace.created_at
aip_sdk.Workspace.created_at: datetime = parse_dt(data['created_at']) or datetime.now(tz=UTC)
No docstring is defined in the source.
aip_sdk.Workspace.default
aip_sdk.Workspace.default(client: APIClient | None = None) -> Workspace
Resolve the deployment's default workspace.
Resolution is deterministic rather than list-order dependent, and scans every page of workspaces (not just the first):
- If exactly one workspace named
"Default"is visible (case-insensitive, ignoring surrounding whitespace), return it. - Otherwise, if exactly one workspace is visible, return it — the common single-workspace / demo case.
- Otherwise, if no workspaces are visible, create and return a
"Default"workspace. - Otherwise — multiple workspaces with none (or several) named
"Default"— raise rather than silently picking an arbitrary entry. Pin the workspace explicitly withget_by_name()orget().
Raises
ValueError: If no single workspace can be chosen safely — either multiple workspaces are visible and none is named"Default", or more than one is named"Default".
aip_sdk.Workspace.delete
aip_sdk.Workspace.delete() -> None
Delete this workspace.
Requires platform_admin.
aip_sdk.Workspace.embedding_config_id
aip_sdk.Workspace.embedding_config_id: str | None = data.get('embedding_config_id')
No docstring is defined in the source.
aip_sdk.Workspace.embedding_config_name
aip_sdk.Workspace.embedding_config_name: str | None = data.get('embedding_config_name')
No docstring is defined in the source.
aip_sdk.Workspace.get
aip_sdk.Workspace.get(workspace_id: str, client: APIClient | None = None) -> Workspace
Fetch a workspace by ID.
aip_sdk.Workspace.get_by_name
aip_sdk.Workspace.get_by_name(name: str, client: APIClient | None = None) -> Workspace
Fetch a workspace by name.
Scans every page of workspaces, so it resolves names regardless of how many workspaces exist or which page a match falls on.
Parameters
namestr: Workspace name (case-sensitive).clientAPIClient | None: Optional API client.
Returns
Raises
NotFoundError: If no workspace with that name exists.
aip_sdk.Workspace.id
aip_sdk.Workspace.id: str = data['id']
No docstring is defined in the source.
aip_sdk.Workspace.is_personal
aip_sdk.Workspace.is_personal: bool = data.get('is_personal', False)
No docstring is defined in the source.
aip_sdk.Workspace.list
aip_sdk.Workspace.list(page: int = 1, per_page: int = 20, client: APIClient | None = None) -> list[Workspace]
List workspaces (a single page).
Platform admins see all workspaces. Regular users see only workspaces they are members of.
Parameters
pageint: Page number (1-based).per_pageint: Items per page (max 100).clientAPIClient | None: Optional API client.
This returns one page. To resolve a workspace across the whole
account regardless of paging, use get_by_name() or
default(), which scan every page.
aip_sdk.Workspace.members
aip_sdk.Workspace.members() -> list[WorkspaceMember]
List all members of this workspace.
aip_sdk.Workspace.name
aip_sdk.Workspace.name: str = data['name']
No docstring is defined in the source.
aip_sdk.Workspace.owner_user_id
aip_sdk.Workspace.owner_user_id: str | None = data.get('owner_user_id')
No docstring is defined in the source.
aip_sdk.Workspace.remove_member
aip_sdk.Workspace.remove_member(user_id: str) -> None
Remove a user from this workspace.
Requires workspace_admin or platform_admin.
aip_sdk.Workspace.set_embedding_config
aip_sdk.Workspace.set_embedding_config(name: str | None) -> Workspace
Set, opt out of, or unset this workspace's default embedding config.
The last tier of the run → project → workspace chain: projects in this workspace
that set no config of their own inherit whatever is set here. The full resolution
order is documented on Project.set_embedding_config.
A new workspace starts opted out, so the platform default stays "no embeddings unless configured".
Parameters
namestr | None: A registered config name in this workspace,aip.embeddings.NO_EMBEDDINGSto opt the workspace out, orNoneto unset the tier.
Returns
Workspace: This workspace instance, updated in place.
Raises
UnprocessableEntityError: If name is not a live config in this workspace.ForbiddenError: If the caller is not aworkspace_adminof this workspace.
aip_sdk.Workspace.update
aip_sdk.Workspace.update(name: str) -> Workspace
Rename this workspace.
Parameters
namestr: New workspace name.
Requires workspace_admin or platform_admin.
Returns
UpdatedWorkspace: class:Workspaceinstance.
aip_sdk.Workspace.update_member_role
aip_sdk.Workspace.update_member_role(user_id: str, role: str) -> WorkspaceMember
Change a member's role in this workspace.
Parameters
user_idstr: User ID to update.rolestr: New role (workspace_admin, workspace_editor, workspace_viewer).
Requires workspace_admin or platform_admin.
aip_sdk.Workspace.updated_at
aip_sdk.Workspace.updated_at: datetime = parse_dt(data.get('updated_at', data['created_at'])) or datetime.now(tz=UTC)
No docstring is defined in the source.