Organizations#

class OrganizationsClient(*, sdk_config: SDKConfiguration, generated_client: ApiClient)[source]#

Bases: object

Client for managing Arize organizations.

This class is primarily intended for internal use within the SDK. Users are highly encouraged to access resource-specific functionality via arize.ArizeClient.

The organizations client is a thin wrapper around the generated REST API client, using the shared generated API client owned by arize.config.SDKConfiguration.

Parameters:
  • sdk_config (SDKConfiguration) – Resolved SDK configuration.

  • generated_client (ApiClient) – Shared generated API client instance.

list(*, name: str | None = None, limit: int = 50, cursor: str | None = None) OrganizationListResponse[source]#

List organizations the user has access to.

This endpoint supports cursor-based pagination. When provided, name filters results to organizations whose name contains the given substring (case-insensitive).

Parameters:
  • name (str | None) – Optional case-insensitive substring filter on organization name.

  • limit (int) – Maximum number of organizations to return (1-100). The server enforces an upper bound of 100.

  • cursor (str | None) – Opaque pagination cursor from a previous response.

Returns:

A paginated organization list response from the Arize REST API.

Raises:

ApiException – If the API request fails.

Return type:

OrganizationListResponse

get(*, organization: str) Organization[source]#

Get an organization by ID or name.

Parameters:

organization (str) – Organization ID or name to retrieve.

Returns:

The organization object.

Raises:

ApiException – If the API request fails (for example, organization not found).

Return type:

Organization

create(*, name: str, description: str | None = None) Organization[source]#

Create a new organization.

Organization names must be unique within the account.

Parameters:
  • name (str) – Organization name (must be unique within the account).

  • description (str | None) – Optional description of the organization’s purpose.

Returns:

The created organization object.

Raises:

ApiException – If the API request fails.

Return type:

Organization

delete(*, organization: str) None[source]#

Delete an organization by ID or name.

This operation is irreversible. It permanently deletes the organization and all resources that belong to it, including all spaces and their contents (projects, experiments, evaluators, models, monitors, dashboards, datasets, annotation configs, annotation queues, custom metrics, etc.) as well as organization-level resources (integrations, cost configurations, SAML identity providers, and API keys).

Parameters:

organization (str) – Organization ID or name to delete.

Returns:

This method returns None on success (204 No Content response).

Raises:

ApiException – If the API request fails (for example, organization not found or insufficient permissions).

Return type:

None

update(*, organization: str, name: str | None = None, description: str | None = None) Organization[source]#

Update an organization’s metadata by ID or name.

Parameters:
  • organization (str) – Organization ID or name to update.

  • name (str | None) – Updated name for the organization.

  • description (str | None) – Updated description for the organization. Pass an empty string to clear the existing description.

Returns:

The updated organization object.

Raises:
  • ValueError – If neither name nor description is provided.

  • ApiException – If the API request fails (for example, organization not found or insufficient permissions).

Return type:

Organization

add_user(*, organization: str, user_id: str, role: PredefinedOrgRole) OrganizationMembership[source]#

Add a user to an organization (or update their role if already a member).

If the user is already a member of the organization, their role is updated to the specified value (upsert).

Role constraints

  • Users with an annotator account role can only be assigned the annotator organization role.

  • Users with a non-annotator account role cannot be assigned the annotator organization role.

Requires organization admin.

Parameters:
  • organization (str) – Organization ID or name.

  • user_id (str) – Global ID of the user to add.

  • role (PredefinedOrgRole) – Role assignment for the user. Use PredefinedOrgRole(name="<role>") for predefined roles (admin, member, read-only, annotator). Custom role assignments are not yet supported for organizations.

Returns:

The created or updated organization membership record.

Raises:

ApiException – If the API request fails (for example, organization or user not found, role constraint violation, or insufficient permissions).

Return type:

OrganizationMembership

remove_user(*, organization: str, user_id: str) None[source]#

Remove a user from an organization.

Removes the user from the organization and all its child spaces (membership cascade).

Requires organization admin.

Parameters:
  • organization (str) – Organization ID or name.

  • user_id (str) – Global ID of the user to remove.

Returns:

This method returns None on success (204 No Content response).

Raises:

ApiException – If the API request fails (for example, organization or user not found, or insufficient permissions).

Return type:

None

Response Types#

class Organization(*, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)], description: Annotated[str, Strict(strict=True)], created_at: datetime)[source]#

Bases: BaseModel

An organization is a top-level container within an account for grouping spaces and managing access control. Organizations enable team separation with role-based access control at the organization level.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
id: StrictStr#
name: StrictStr#
description: StrictStr#
created_at: datetime#
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of Organization from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

to_dict() Dict[str, Any][source]#

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of Organization from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None