Skip to content

AccountOperations

Access via client.account. Self-service operations — no admin required.

crucible.resources.account.AccountOperations

Self-service account operations.

Access via: client.account.profile(), client.account.api_key(), etc. All methods require a valid API key but do not require admin permissions.

whoami()

Return full auth context for the current API key.

Returns ORCID, access group list, and user profile in one response. For just the user profile use account.profile().

Returns:

Name Type Description
Dict Dict

user_unique_id, access_group_ids, user_info (UserRead)

profile()

Return the authenticated caller's own user profile.

Returns:

Name Type Description
Dict Dict

UserRead — includes username, first_name, last_name, email, orcid

update_profile(**kwargs)

Partially update the authenticated caller's own profile.

Accepted fields: first_name, last_name, email, username. Pass username=None to clear the username. Note: is_service_account is admin-only — use client.users.update() instead.

Returns:

Name Type Description
Dict Dict

Updated UserRead profile

api_key()

Return the caller's own API key.

Raises:

Type Description
HTTPError 404

No API key exists for this account yet.

Returns:

Name Type Description
str str

The caller's API key

verify()

Return the validity and expiry info for the caller's API key.

Returns:

Name Type Description
Dict Dict

{valid: bool, created_at: str, expires_at: str}