Retrieve one or more user profiles
- async AsyncCogniteClient.iam.user_profiles.retrieve(
- user_identifier: str | SequenceNotStr[str],
Retrieve user profiles by user identifier.
Retrieves one or more user profiles indexed by the user identifier in the same CDF project.
- Parameters:
user_identifier (str | SequenceNotStr[str]) – The single user identifier (or sequence of) to retrieve profile(s) for.
- Returns:
UserProfileList if a sequence of user identifier were requested, else UserProfile. If a single user identifier is requested and it is not found, None is returned.
- Return type:
UserProfile | UserProfileList | None
- Raises:
CogniteNotFoundError – A sequences of user identifiers were requested, but one or more does not exist.
Examples
Get a single user profile:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.iam.user_profiles.retrieve("foo")
Get multiple user profiles:
>>> res = client.iam.user_profiles.retrieve(["bar", "baz"])