Skip to main content

User — Python SDK

User profile reference.

Overview​

The User resource exposes a single endpoint returning the currently logged-in user's full profile, including tenant context, BUC IDs, and permission metadata.

Accessed via client.user.

Available Operations​

MethodDescription
info()Get the current logged-in user's information

info​

Get the current logged-in user's full profile.

Example Usage​

from wlt import WltClient

with WltClient(api_key="your-api-key", base_url="https://console.example.com") as client:
user = client.user.info()
print(f"User ID: {user.data.userId}")
print(f"Username: {user.data.userName}")
print(f"Tenant: {user.data.partnerName} (id={user.data.partnerId})")

Parameters​

None.

Response​

Returns BaseResponse[LoginUser]. Key fields on data:

FieldTypeDescription
userIdintUser ID
userNamestrUsername
userTypestrUser type (e.g. PartnerUser, PartnerUserSub)
accountStructureintAccount type: 1=Partner, 2=Customer main account, 3=SubUser, 4=TokenLogin
tenantCodestrTenant code
partnerIdintTenant ID
partnerNamestrTenant name
partnerLogoUrlstrTenant logo URL
bucIdintBUC ID
bidstrBID
parentUserIdintParent account database ID
parentPkstrParent account PK info
aliyunPkstrAliyun PK info
cmUserIdstrCM user ID
accessKeyIdstrAccessKey ID
securityTokenstrSecurity token
timezonestrTimezone info
regionstrRegion info
needAuthboolWhether SLR authorization is needed
userPermissionUserPermissionResponseUser permission info
sourceExternalTicketstrSSO external ticket
thirdChannelstrThird-party channel source

Errors​

CodeExceptionWhen
2000 / 2002AuthenticationErrorAPI Key invalid
2007PermissionErrorPermission denied
3001AuthenticationErrorToken expired and refresh failed