API Keys#
- class ApiKeysClient(*, sdk_config: SDKConfiguration, generated_client: ApiClient)[source]#
Bases:
objectClient for managing Arize API keys.
This class is primarily intended for internal use within the SDK. Users are highly encouraged to access resource-specific functionality via
arize.ArizeClient.The API keys 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(*, key_type: ApiKeyType | None = None, status: ApiKeyStatus | None = None, space: str | None = None, user_id: str | None = None, limit: int = DEFAULT_LIST_LIMIT, cursor: str | None = None) ListApiKeysResponse[source]#
List API keys.
This endpoint supports cursor-based pagination. Optionally filter by
key_type,status,space, anduser_id.Service keys (
key_type=ApiKeyType.SERVICE): providespaceto return all service keys for that space. Whenkey_typeis omitted alongsidespace, service keys are returned implicitly. Optionally combine withuser_idto filter by creator — available to any caller with space access.User keys (
key_type=ApiKeyType.USER): returned by default (nospace). Provideuser_idto view keys for a specific user — account admins only; non-admins receive a403.- Parameters:
key_type (ApiKeyType | None) – Optional key type filter (
ApiKeyType.USERorApiKeyType.SERVICE).status (ApiKeyStatus | None) – Optional status filter (
ApiKeyStatus.ACTIVEorApiKeyStatus.REVOKED). Defaults toApiKeyStatus.ACTIVEon the server side when omitted.space (str | None) – Space name or ID. When provided, filters to service keys for that space. Accepts a human-readable name or a base64 identifier.
user_id (str | None) – Base64 identifier of the user whose keys to return. For service keys (with
space), filters by creator and is available to any caller with space access. For user keys (withoutspace), requires account admin role.limit (int) – Maximum number of keys to return (1 to 100). Defaults to 50.
cursor (str | None) – Opaque pagination cursor from a previous response.
- Returns:
A paginated API key list response from the Arize REST API.
- Raises:
ApiException – If the API request fails.
- Return type:
- create(*, name: str, description: str | None = None, expires_at: datetime | None = None) UserApiKeyCreated[source]#
Create a new user API key.
Creates a user-type key that authenticates as the creating user with their full permissions. To create a space-scoped service key, use
create_service_keyinstead.The returned
UserApiKeyCreatedobject contains the full raw key value in itskeyfield. This is the only time the raw key is returned. Store it securely.- Parameters:
- Returns:
The created API key, including the one-time raw key value.
- Raises:
ApiException – If the API request fails (e.g. invalid parameters or insufficient permissions).
- Return type:
- create_service_key(*, name: str, orgs: builtins.list[OrgBinding], account_role: UserRoleAssignment | None = None, description: str | None = None, expires_at: datetime | None = None) ServiceApiKeyCreated[source]#
Create a service-type API key with org and space bindings.
Service keys are tied to a dedicated service account scoped to one or more organizations, each containing one or more spaces. All spaces must belong to the same account. When no role is specified for a space or org, the server applies the default predefined role (
MEMBERfor spaces,READ_ONLYfor orgs,MEMBERfor accounts).The returned
ServiceApiKeyCreatedobject contains the full raw key value in itskeyfield. This is the only time the raw key is returned. Store it securely.- Parameters:
name (str) – User-defined name for the API key (max 256 characters).
orgs (builtins.list[OrgBinding]) – List of
OrgBindingobjects, each specifying an optional org-level role and a list ofSpaceBindingobjects within that org. At least one org with at least one space is required.account_role (UserRoleAssignment | None) – Optional account-level role for the bot user. When
None, the server applies the default predefinedMEMBERrole.description (str | None) – Optional description (max 1000 characters).
expires_at (datetime | None) – Optional expiration timestamp. If omitted the key never expires. Must be a future timestamp.
- Returns:
The created API key, including the one-time raw key value.
- Raises:
ValueError – If
orgsis empty or any org has no space bindings.ApiException – If the API request fails (e.g. invalid role assignment or insufficient permissions).
- Return type:
- revoke(*, api_key_id: str) None[source]#
Revoke an API key.
The key’s status is set to
ApiKeyStatus.REVOKEDand it is deactivated immediately and permanently. This operation is irreversible — the key will stop working right away. Revoking an already-revoked key is a no-op and still succeeds.- Parameters:
api_key_id (str) – ID of the API key to revoke.
- Returns:
None
- Raises:
ApiException – If the API request fails (e.g. key not found or insufficient permissions).
- Return type:
None
- refresh(*, api_key_id: str, expires_at: datetime | None = None, grace_period_seconds: int | None = None) RefreshApiKeyResponse[source]#
Refresh an existing API key.
Atomically revokes the old key and issues a replacement with the same name, description, type, and scope.
Use
grace_period_secondsto keep the old key valid briefly while your services rotate to the new key.- Parameters:
api_key_id (str) – ID of the API key to refresh.
expires_at (datetime | None) – New expiration for the replacement key. If omitted the replacement key will not expire.
grace_period_seconds (int | None) – Optional grace window, in seconds, during which the old key remains valid after refresh. If omitted or
0, the old key is invalidated immediately.
- Returns:
The newly issued API key, including the one-time raw key value.
- Raises:
ApiException – If the API request fails (e.g. key not found, already deleted, or insufficient permissions).
- Return type:
Response Types#
Public type re-exports for the api_keys subdomain.
- class ApiKey(*, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)], description: Annotated[str, Strict(strict=True)] | None = None, key_type: ApiKeyType, status: ApiKeyStatus, redacted_key: Annotated[str, Strict(strict=True)], created_at: datetime, expires_at: datetime | None = None, created_by_user_id: Annotated[str, Strict(strict=True)], last_used_at: datetime | None = None)[source]#
Bases:
BaseModelCreate 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:
key_type (ApiKeyType)
status (ApiKeyStatus)
created_at (datetime)
expires_at (datetime | None)
last_used_at (datetime | None)
- id: StrictStr#
- name: StrictStr#
- key_type: ApiKeyType#
- status: ApiKeyStatus#
- redacted_key: StrictStr#
- created_at: datetime#
- created_by_user_id: StrictStr#
- 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].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of ApiKey from a JSON string
- 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.
- class ApiKeyStatus(value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
Current status of the API key. - ACTIVE - The key is valid for use. - REVOKED - The key has been revoked and is no longer valid.
- ACTIVE = 'ACTIVE'#
- REVOKED = 'REVOKED'#
- class ApiKeyType(value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
Type of the API key. - USER - Personal key that authenticates as the creating user. - SERVICE - Key that authenticates as a service account with explicitly granted access.
- USER = 'USER'#
- SERVICE = 'SERVICE'#
- class CreateApiKeyResponse(*args, oneof_schema_1_validator: UserApiKeyCreated | None = None, oneof_schema_2_validator: ServiceApiKeyCreated | None = None, actual_instance: ServiceApiKeyCreated | UserApiKeyCreated | None = None, one_of_schemas: Set[str] = {'ServiceApiKeyCreated', 'UserApiKeyCreated'}, discriminator_value_class_map: Dict[str, str] = {})[source]#
Bases:
BaseModelResponse for a newly created or refreshed API key. The key_type field discriminates the variant: - USER — standard user key; no bot user. - SERVICE — service key tied to a service account; includes a bot_user with the service account’s resolved role assignments.
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:
oneof_schema_1_validator (UserApiKeyCreated | None)
oneof_schema_2_validator (ServiceApiKeyCreated | None)
actual_instance (ServiceApiKeyCreated | UserApiKeyCreated | None)
- oneof_schema_1_validator: UserApiKeyCreated | None#
- oneof_schema_2_validator: ServiceApiKeyCreated | None#
- actual_instance: ServiceApiKeyCreated | UserApiKeyCreated | None#
- model_config: ClassVar[ConfigDict] = {'protected_namespaces': (), 'validate_assignment': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_json(json_str: str) Self[source]#
Returns the object represented by the json string
- to_dict() Dict[str, Any] | ServiceApiKeyCreated | UserApiKeyCreated | None[source]#
Returns the dict representation of the actual instance
- Return type:
Dict[str, Any] | ServiceApiKeyCreated | UserApiKeyCreated | None
- class CustomRoleAssignment(*, type: SpaceRoleAssignmentType, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)] | None = None)[source]#
Bases:
BaseModelA custom RBAC role assignment.
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:
- type: SpaceRoleAssignmentType#
- id: StrictStr#
- 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].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of CustomRoleAssignment from a JSON string
- 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.
OpenAPI readOnly fields are excluded.
- class ListApiKeysResponse(*, api_keys: List[ApiKey], pagination: PaginationMetadata)[source]#
Bases:
BaseModelCreate 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:
pagination (PaginationMetadata)
- pagination: PaginationMetadata#
- 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].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of ListApiKeysResponse from a JSON string
- 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.
- classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#
Create an instance of ListApiKeysResponse from a dict
- to_df(by_alias: bool = False, exclude_none: str | bool = True, json_normalize: bool = False, convert_dtypes: bool = True, expand_field: str = 'additional_properties', expand_prefix: str = '') pd.DataFrame#
Convert a list of objects to a
pandas.DataFrame.- Behavior:
If an item is a Pydantic v2 model, use .model_dump(by_alias=…).
If an item is a mapping (dict-like), use it as-is.
Otherwise, raise a ValueError (unsupported row type).
- Parameters:
self (object) – The object instance containing the field to convert.
by_alias (bool) – Use field aliases when dumping Pydantic models.
exclude_none (str | bool) – Control None/NaN column dropping. - False: keep Nones as-is - “all”: drop columns where all values are None/NaN - “any”: drop columns where any value is None/NaN - True: alias for “all”
json_normalize (bool) – If True, flatten nested dicts via
pandas.json_normalize.convert_dtypes (bool) – If True, call
DataFrame.convert_dtypes()at the end.expand_field (str) – If set, look for this field in each row and expand its keys into top-level columns.
expand_prefix (str) – If set, prefix expanded column names with this string.
- Returns:
The converted DataFrame.
- Return type:
- class OrgBinding(org_id: str, spaces: list[~arize.api_keys.types.SpaceBinding] = <factory>, role: ~organization_role_assignment.OrganizationRoleAssignment | None = None)[source]#
Bases:
objectDeclares one organization that the service key’s bot user should access.
The binding answers “which org?”. Each org binding contains one or more
SpaceBindingobjects that specify which spaces within that org the bot user can access and with what role.- Parameters:
org_id (str)
spaces (list[SpaceBinding])
role (OrganizationRoleAssignment | None)
- spaces#
Space bindings within this organization. At least one is required. All spaces must belong to this organization.
- role#
Role to assign the bot user at the organization level. When
None, the server defaults to the predefinedREAD_ONLYrole. UseOrganizationPredefinedRoleAssignmentfor built-in roles orOrganizationCustomRoleAssignmentfor custom RBAC roles.
- spaces: list[SpaceBinding]#
- role: OrganizationRoleAssignment | None = None#
- class OrganizationCustomRoleAssignment(*, type: OrganizationRoleAssignmentType, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)] | None = None)[source]#
Bases:
BaseModelA custom RBAC role assignment.
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:
- type: OrganizationRoleAssignmentType#
- id: StrictStr#
- 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].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of OrganizationCustomRoleAssignment from a JSON string
- 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.
OpenAPI readOnly fields are excluded.
- class OrganizationPredefinedRoleAssignment(*, type: OrganizationRoleAssignmentType, name: OrganizationRole)[source]#
Bases:
BaseModelA predefined organization role assignment.
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:
type (OrganizationRoleAssignmentType)
name (OrganizationRole)
- type: OrganizationRoleAssignmentType#
- name: OrganizationRole#
- 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].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of OrganizationPredefinedRoleAssignment from a JSON string
- 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.
- class OrganizationRoleAssignment(*args, oneof_schema_1_validator: OrganizationPredefinedRoleAssignment | None = None, oneof_schema_2_validator: OrganizationCustomRoleAssignment | None = None, actual_instance: OrganizationCustomRoleAssignment | OrganizationPredefinedRoleAssignment | None = None, one_of_schemas: Set[str] = {'OrganizationCustomRoleAssignment', 'OrganizationPredefinedRoleAssignment'}, discriminator_value_class_map: Dict[str, str] = {})[source]#
Bases:
BaseModelA role assignment for an organization membership. Discriminated by type: - PREDEFINED: one of the predefined roles (ADMIN, MEMBER, READ_ONLY, ANNOTATOR) - CUSTOM: a custom RBAC role identified by its ID
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:
oneof_schema_1_validator (OrganizationPredefinedRoleAssignment | None)
oneof_schema_2_validator (OrganizationCustomRoleAssignment | None)
actual_instance (OrganizationCustomRoleAssignment | OrganizationPredefinedRoleAssignment | None)
- oneof_schema_1_validator: OrganizationPredefinedRoleAssignment | None#
- oneof_schema_2_validator: OrganizationCustomRoleAssignment | None#
- actual_instance: OrganizationCustomRoleAssignment | OrganizationPredefinedRoleAssignment | None#
- model_config: ClassVar[ConfigDict] = {'protected_namespaces': (), 'validate_assignment': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_json(json_str: str) Self[source]#
Returns the object represented by the json string
- to_dict() Dict[str, Any] | OrganizationCustomRoleAssignment | OrganizationPredefinedRoleAssignment | None[source]#
Returns the dict representation of the actual instance
- Return type:
Dict[str, Any] | OrganizationCustomRoleAssignment | OrganizationPredefinedRoleAssignment | None
- class PredefinedRoleAssignment(*, type: SpaceRoleAssignmentType, name: UserSpaceRole)[source]#
Bases:
BaseModelA predefined space role assignment.
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:
type (SpaceRoleAssignmentType)
name (UserSpaceRole)
- type: SpaceRoleAssignmentType#
- name: UserSpaceRole#
- 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].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of PredefinedRoleAssignment from a JSON string
- 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.
- class RefreshApiKeyResponse(*, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)], description: Annotated[str, Strict(strict=True)] | None = None, key_type: ApiKeyType, status: ApiKeyStatus, redacted_key: Annotated[str, Strict(strict=True)], created_at: datetime, expires_at: datetime | None = None, created_by_user_id: Annotated[str, Strict(strict=True)], last_used_at: datetime | None = None, key: Annotated[str, Strict(strict=True)])[source]#
Bases:
BaseModelThe refreshed API key credential and its metadata. Refresh replaces the key secret but preserves the key’s identity (ID, name, type, bindings). Unlike key creation, refresh does not return bot_user details — refresh never creates a new service account and the existing bot user’s bindings are unchanged.
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:
key_type (ApiKeyType)
status (ApiKeyStatus)
created_at (datetime)
expires_at (datetime | None)
last_used_at (datetime | None)
- id: StrictStr#
- name: StrictStr#
- key_type: ApiKeyType#
- status: ApiKeyStatus#
- redacted_key: StrictStr#
- created_at: datetime#
- created_by_user_id: StrictStr#
- key: StrictStr#
- 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].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of RefreshApiKeyResponse from a JSON string
- 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.
- class ServiceApiKeyCreated(*, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)], description: Annotated[str, Strict(strict=True)] | None = None, key_type: Annotated[str, Strict(strict=True)], status: ApiKeyStatus, redacted_key: Annotated[str, Strict(strict=True)], created_at: datetime, expires_at: datetime | None = None, created_by_user_id: Annotated[str, Strict(strict=True)], last_used_at: datetime | None = None, key: Annotated[str, Strict(strict=True)], bot_user: ServiceKeyBotUser)[source]#
Bases:
BaseModelCreate 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:
status (ApiKeyStatus)
created_at (datetime)
expires_at (datetime | None)
last_used_at (datetime | None)
bot_user (ServiceKeyBotUser)
- id: StrictStr#
- name: StrictStr#
- key_type: StrictStr#
- status: ApiKeyStatus#
- redacted_key: StrictStr#
- created_at: datetime#
- created_by_user_id: StrictStr#
- key: StrictStr#
- bot_user: ServiceKeyBotUser#
- 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].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of ServiceApiKeyCreated from a JSON string
- 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.
- class ServiceKeyBotUser(*, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)], account_role: UserRoleAssignment, organizations: Annotated[List[ServiceKeyBotUserOrgAssignment], MinLen(min_length=1)])[source]#
Bases:
BaseModelCreate 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:
account_role (UserRoleAssignment)
organizations (Annotated[List[ServiceKeyBotUserOrgAssignment], FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=1)])])
- id: StrictStr#
- name: StrictStr#
- account_role: UserRoleAssignment#
- organizations: Annotated[List[ServiceKeyBotUserOrgAssignment], Field(min_length=1)]#
- 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].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of ServiceKeyBotUser from a JSON string
- 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.
- class ServiceKeyBotUserOrgAssignment(*, org_id: Annotated[str, Strict(strict=True)], role: OrganizationRoleAssignment, spaces: List[ServiceKeyBotUserSpaceAssignment])[source]#
Bases:
BaseModelCreate 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:
role (OrganizationRoleAssignment)
spaces (List[ServiceKeyBotUserSpaceAssignment])
- org_id: StrictStr#
- spaces: List[ServiceKeyBotUserSpaceAssignment]#
- 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].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of ServiceKeyBotUserOrgAssignment from a JSON string
- 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.
- class ServiceKeyBotUserSpaceAssignment(*, space_id: Annotated[str, Strict(strict=True)], role: SpaceRoleAssignment)[source]#
Bases:
BaseModelCreate 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:
role (SpaceRoleAssignment)
- space_id: StrictStr#
- role: SpaceRoleAssignment#
- 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].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of ServiceKeyBotUserSpaceAssignment from a JSON string
- 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.
- class ServiceKeySpaceAssignment(*, space_id: Annotated[str, Strict(strict=True)], role: SpaceRoleAssignment | None = None)[source]#
Bases:
BaseModelDeclares one space that the service key’s service account should have access to. The space assignment (space_id) identifies the target space. The role assignment (role) specifies the level of access within that space — either a named predefined role or a custom RBAC role identified by its ID.
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:
role (SpaceRoleAssignment | None)
- space_id: StrictStr#
- role: SpaceRoleAssignment | None#
- 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].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of ServiceKeySpaceAssignment from a JSON string
- 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.
- class SpaceBinding(space: str, role: SpaceRoleAssignment | None = None)[source]#
Bases:
objectDeclares one space that the service key’s bot user should access.
The binding answers “which space?” The role assignment answers “with what role?”. A role assignment is either a named predefined role (e.g.
PredefinedRoleAssignment(name="MEMBER")) or a custom RBAC role referenced by ID (CustomRoleAssignment(id="<encoded-role-id>")).- Parameters:
space (str)
role (SpaceRoleAssignment | None)
- role#
Role to assign the bot user within this space. When
None, the server defaults to the predefinedMEMBERrole. UsePredefinedRoleAssignmentfor built-in roles (ADMIN,MEMBER,READ_ONLY) orCustomRoleAssignmentfor custom RBAC roles.
- role: SpaceRoleAssignment | None = None#
- class SpaceRoleAssignment(*args, oneof_schema_1_validator: PredefinedRoleAssignment | None = None, oneof_schema_2_validator: CustomRoleAssignment | None = None, actual_instance: CustomRoleAssignment | PredefinedRoleAssignment | None = None, one_of_schemas: Set[str] = {'CustomRoleAssignment', 'PredefinedRoleAssignment'}, discriminator_value_class_map: Dict[str, str] = {})[source]#
Bases:
BaseModelSpecifies which role to assign within a space. Discriminated by type: - PREDEFINED: a built-in platform role — { “type”: “PREDEFINED”, “name”: “ADMIN” | “MEMBER” | “READ_ONLY” | “ANNOTATOR” } - CUSTOM: a custom RBAC role identified by its ID — { “type”: “CUSTOM”, “id”: “<encoded-role-id>” } Used wherever a space-level role assignment is required (memberships, service key bindings, etc.).
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:
oneof_schema_1_validator (PredefinedRoleAssignment | None)
oneof_schema_2_validator (CustomRoleAssignment | None)
actual_instance (CustomRoleAssignment | PredefinedRoleAssignment | None)
- oneof_schema_1_validator: PredefinedRoleAssignment | None#
- oneof_schema_2_validator: CustomRoleAssignment | None#
- actual_instance: CustomRoleAssignment | PredefinedRoleAssignment | None#
- model_config: ClassVar[ConfigDict] = {'protected_namespaces': (), 'validate_assignment': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_json(json_str: str) Self[source]#
Returns the object represented by the json string
- to_dict() Dict[str, Any] | CustomRoleAssignment | PredefinedRoleAssignment | None[source]#
Returns the dict representation of the actual instance
- Return type:
Dict[str, Any] | CustomRoleAssignment | PredefinedRoleAssignment | None
- class UserApiKeyCreated(*, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)], description: Annotated[str, Strict(strict=True)] | None = None, key_type: Annotated[str, Strict(strict=True)], status: ApiKeyStatus, redacted_key: Annotated[str, Strict(strict=True)], created_at: datetime, expires_at: datetime | None = None, created_by_user_id: Annotated[str, Strict(strict=True)], last_used_at: datetime | None = None, key: Annotated[str, Strict(strict=True)])[source]#
Bases:
BaseModelCreate 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:
status (ApiKeyStatus)
created_at (datetime)
expires_at (datetime | None)
last_used_at (datetime | None)
- id: StrictStr#
- name: StrictStr#
- key_type: StrictStr#
- status: ApiKeyStatus#
- redacted_key: StrictStr#
- created_at: datetime#
- created_by_user_id: StrictStr#
- key: StrictStr#
- 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].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of UserApiKeyCreated from a JSON string
- 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.
- class UserRoleAssignment(*args, oneof_schema_1_validator: PredefinedUserRoleAssignment | None = None, oneof_schema_2_validator: CustomUserRoleAssignment | None = None, actual_instance: CustomUserRoleAssignment | PredefinedUserRoleAssignment | None = None, one_of_schemas: Set[str] = {'CustomUserRoleAssignment', 'PredefinedUserRoleAssignment'}, discriminator_value_class_map: Dict[str, str] = {})[source]#
Bases:
BaseModelAn account-level role assignment. Discriminated by type: - PREDEFINED: one of the predefined roles (admin, member, annotator) - CUSTOM: a custom RBAC role identified by its ID Note: CUSTOM role assignments are not yet supported and are reserved for future use.
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:
- model_config: ClassVar[ConfigDict] = {'protected_namespaces': (), 'validate_assignment': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_json(json_str: str) Self[source]#
Returns the object represented by the json string