Skip to main content

Admin Auth — Python SDK

Admin-scope authentication and the currently-logged-in admin's identity.

Overview​

AdminClient is a separate client for admin-scope operations (billing read + customer CRUD). It authenticates with an admin username and password (no captcha, no API key) and issues a session token scoped to admin-only endpoints. Use WltClient for tenant-user operations and AdminClient when the caller must act as an administrator.

The Auth resource exposes a single endpoint returning the currently logged-in admin's profile, including the admin's user type (e.g. partner_admin) and tenant context.

Accessed via admin.auth.

Available Operations​

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

Client construction​

Instantiate AdminClient with the admin's username and password. The SDK exchanges them for a short-lived session token on the first request and refreshes it transparently on expiry.

from wlt import AdminClient

admin = AdminClient(
username="admin",
password="your-admin-password",
base_url="https://console.example.com",
timeout=30.0,
max_retries=2,
)
ParameterTypeRequiredDefaultDescription
usernamestrYes--Admin username
passwordstrYes--Admin password (no captcha)
base_urlstrNoBuilt-in defaultConsole base URL. See resolution rules on the Overview page.
timeoutfloatNo30.0Request timeout in seconds
max_retriesintNo2Max retry attempts

info​

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

Example Usage​

from wlt import AdminClient

admin = AdminClient(username="admin", password="your-admin-password",
base_url="https://console.example.com")

info = admin.auth.info()
print(f"userId={info['userId']} userName={info['userName']} userType={info['userType']}")

Parameters​

None.

Response​

Returns a dict with the admin's profile. Key fields:

FieldTypeDescription
userIdintAdmin user ID
userNamestrAdmin username
userTypestrAdmin type (e.g. partner_admin, sys_admin)
accountStructureintAccount structure code
partnerIdintTenant ID this admin belongs to
partnerNamestrTenant name
parentUserIdintParent user ID
timezonestrTimezone (e.g. Europe/Paris)
regionstrRegion (e.g. ap-southeast-1)
userPermissiondictAdmin permission metadata

Admin resources return raw dict payloads directly (not the BaseResponse wrapper used by tenant-user resources). Read fields with info["field"].

Errors​

CodeExceptionWhen
500AuthenticationErrorUsername or password incorrect
2007PermissionErrorNot an admin account
3001AuthenticationErrorSession expired and refresh failed
3002AuthenticationErrorLogin attempts rate-limited (retry after 15-60 s)