Skip to main content

Methods

List all users of tenant filtered by query and showInvalidUsers. Pagination is available based on query parameters.

Parameters

limit
typing.Optional[int]
Number of items per page
offset
typing.Optional[int]
Number of items to skip
query
typing.Optional[str]
show_invalid_users
typing.Optional[bool]
Show Deactivated users

Returns

SyncPager[User]
SyncPager[User]
🔗 UserReturns all users of tenant and also the response includes paginated data.

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.users.list(
    limit=10,
    offset=10,
    query="value",
    show_invalid_users="value",
)

# Iterate through results
for item in response:
    print(item.name)

# Or paginate page by page
for page in response.iter_pages():
    for item in page:
        print(item.name)
This endpoint allows tenant administrators to register users within their tenant.

Parameters

email
str
required
Email of the user
send_invite_email
typing.Optional[bool]
Send invite email if user does not exist
skip_if_user_exists
typing.Optional[bool]
Fail if user exists
dry_run
typing.Optional[bool]
Dry run
accept_invite_client_url
typing.Optional[str]
Url to redirect when invite is accepted

Returns

RegisterUsersResponse
RegisterUsersResponse
🔗 RegisterUsersResponseThe users have been successfully registered.

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.users.pre_register_users(
    email="value",
    send_invite_email="value",
    skip_if_user_exists="value",
    dry_run=False,
    accept_invite_client_url="value",
)
This endpoint allows tenant administrators to update the roles of a user within their tenant.

Parameters

email
str
required
Email of the user
roles
typing.Sequence[str]
required
Roles for the user

Returns

UpdateUserRolesResponse
UpdateUserRolesResponse
🔗 UpdateUserRolesResponseThe user roles have been successfully updated.

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.users.update_roles(
    email="value",
    roles="value",
)
Get User associated with provided User id

Parameters

id
str
required
User Id

Returns

GetUserResponse
GetUserResponse
🔗 GetUserResponseReturns the User associated with provided User id

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.users.get(
    id="id_value",
)
Invite a user to the tenant

Parameters

accept_invite_client_url
str
required
Url to redirect when invite is accepted
email
str
required
Email of user

Returns

InviteUserResponse
InviteUserResponse
🔗 InviteUserResponseUser has been successfully invited.

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.users.invite_user(
    accept_invite_client_url="value",
    email="value",
)
Deactivate user associated with the provided email within the tenant.

Parameters

email
str
required
Email of the user

Returns

DeactivateUserResponse
DeactivateUserResponse
🔗 DeactivateUserResponseUser has been successfully deactivated.

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.users.deactivate(
    email="value",
)
Activate user associated with the provided email within the tenant.

Parameters

email
str
required
Email of the user

Returns

ActivateUserResponse
ActivateUserResponse
🔗 ActivateUserResponseUser has been successfully activated.

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.users.activate(
    email="value",
)
Change password for the authenticated user. Requires clientId and loginId in the request body.

Parameters

login_id
str
required
login id of the user(email)
new_password
str
required
New password
old_password
str
required
Old password

Returns

ChangePasswordResponse
ChangePasswordResponse
🔗 ChangePasswordResponsePassword has been changed successfully.

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.users.change_password(
    login_id="value",
    new_password="value",
    old_password="value",
)
I