User API¶
The User API manages user accounts and configurations in Unique AI.
Overview¶
Manage users within a company including user lookup and configuration management.
Methods¶
unique_sdk.User.get_users - Get users with filtering
Compatibility
Compatible with release >.48
Get users in a company with optional filtering and pagination.
Parameters:
skip(int, optional) - Number of records to skip (default: 0)take(int, optional) - Number of records to return (default: 50, max: 1000)email(str, optional) - Filter by email addressdisplayName(str, optional) - Filter by display nameuserName(str, optional) - Filter by user name
Returns:
Returns a Users object.
Example - List All Users:
Example - Search by Email:
Example - Search by Name:
Example - Search by Username:
unique_sdk.User.get_user_groups - Get groups a user belongs to
Compatibility
Compatible with release >.61
Get all groups that a specific user belongs to.
Parameters:
target_user_id(str, required) - The ID of the user to get groups for
Returns:
Returns a UserGroupsResponse object.
Example:
Example - Async:
unique_sdk.User.update_user_configuration - Update user configuration
Compatibility
Compatible with release >.48
Update the current user's configuration (JSON object).
Parameters:
userConfiguration(Dict[str, Any], required) - JSON configuration object
Returns:
Returns a UserWithConfiguration object.
Example:
Use Cases¶
User Directory
User Lookup
User Preferences Management
Best Practices¶
Paginate Large User Lists
Cache User Lookups
Return Types¶
User¶
The User object represents a user in the company
Fields:
id(str) - Unique user identifierexternalId(str | None) - External system identifierfirstName(str) - User's first namelastName(str) - User's last namedisplayName(str) - User's display nameuserName(str) - Usernameemail(str) - Email addressupdatedAt(str) - Last update timestamp (ISO 8601)createdAt(str) - Creation timestamp (ISO 8601)active(bool) - Whether user is active
Returned by: User.get_users()
UserWithConfiguration¶
The UserWithConfiguration object represents a user with configuration
Fields:
- All fields from
User userConfiguration(Dict[str, Any]) - User configuration dictionary
Returned by: User.update_user_configuration()
Users¶
The Users object contains a list of users
Fields:
users(List[User]) - List of user objects. SeeUserfor properties.
Returned by: User.get_users()
UserGroup¶
The UserGroup object represents a group that a user belongs to
Fields:
id(str) - Unique group identifiername(str) - Group nameexternalId(str | None) - External system identifierparentId(str | None) - Parent group IDcreatedAt(str) - Creation timestamp (ISO 8601)updatedAt(str) - Last update timestamp (ISO 8601)
Used in: UserGroupsResponse.groups
UserGroupsResponse¶
The UserGroupsResponse object contains groups a user belongs to
Fields:
groups(List[UserGroup]) - List of group objects. SeeUserGroupfor properties.
Returned by: User.get_user_groups()
Related Resources¶
- Group API - Manage user groups
- Folder API - Manage user access to folders