Overview
This endpoint retrieves comprehensive user profile information including account details, organization settings, authentication history, credit system information, and usage statistics. Requires JWT authentication and returns different data based on account type. This endpoint is free and does not consume credits.
API Details
Authentication
Bearer JWT token for authentication
curl -X GET https://api.authiqa.com/auth/user-profile \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json"
Try It Out
Test the API by providing your JWT token:
JWT token for authentication
Response Examples
200: Success - Parent Account
{
"success" : true ,
"data" : {
"message" : "User profile retrieved successfully" ,
"user" : {
"userID" : "USR_parent_12345" ,
"username" : "parentuser" ,
"email" : "[email protected] " ,
"publicKey" : "APK_abc123def456_1234567890" ,
"accountType" : "parent" ,
"parentAccount" : "ROOT" ,
"accountStatus" : "active" ,
"emailVerified" : true ,
"createdAt" : 1729616234 ,
"updatedAt" : 1729616234 ,
"lastLogin" : 1729616234 ,
"organizationName" : "Example Corp" ,
"organizationUrl" : "https://example.com" ,
"authUrls" : {
"signin" : "https://example.com/signin" ,
"signup" : "https://example.com/signup"
},
"domainRestrictionEnabled" : true ,
"emailVerificationRequired" : false ,
"organizationId" : null ,
"authProvider" : "email" ,
"lastLoginProvider" : "email" ,
"googleId" : null ,
"creditBalance" : 58000 ,
"totalFreeUsers" : 6000 ,
"billableChildAccounts" : 0 ,
"totalChildAccounts" : 3500 ,
"packagesHistory" : [
{
"packageType" : "GROWTH" ,
"purchaseDate" : 1640995200000 ,
"creditsAdded" : 55000 ,
"freeUsersAdded" : 5000 ,
"price" : 50 ,
"transactionId" : "pi_xxx"
}
],
"accountBalance" : 25.50 ,
"availableBalance" : 23.75 ,
"childSignupCount" : 150 ,
"signInCount" : 2500 ,
"emailConfirmationCount" : 75 ,
"googleAuthCount" : 800 ,
"githubAuthCount" : 200 ,
"xAuthCount" : 100 ,
"facebookAuthCount" : 50 ,
"lastPasswordChanged" : 1729616234 ,
"loginAttempts" : 0 ,
"lastLoginAttempt" : null ,
"googleSsoConfig" : {
"enabled" : true ,
"clientId" : "123456789-abcdefghijklmnop.apps.googleusercontent.com"
},
"lastLowCreditNotificationAt" : null ,
"lastCriticalCreditNotificationAt" : null ,
"lastDepletedCreditNotificationAt" : null ,
"lockedUntil" : null ,
"lastResetPasswordRequestAt" : null
}
}
}
200: Success - Child Account
{
"success" : true ,
"data" : {
"message" : "User profile retrieved successfully" ,
"user" : {
"userID" : "USR_child_67890" ,
"username" : "childuser" ,
"email" : "[email protected] " ,
"publicKey" : "APK_def456ghi789_0987654321" ,
"accountType" : "child" ,
"parentAccount" : "APK_abc123def456_1234567890" ,
"accountStatus" : "active" ,
"emailVerified" : true ,
"createdAt" : 1729616234 ,
"updatedAt" : 1729616234 ,
"lastLogin" : 1729616234 ,
"organizationName" : "Example Corp" ,
"organizationUrl" : null ,
"authUrls" : null ,
"domainRestrictionEnabled" : true ,
"emailVerificationRequired" : false ,
"organizationId" : null ,
"authProvider" : "google" ,
"lastLoginProvider" : "google" ,
"googleId" : "google_user_id_12345" ,
"childSignupCount" : 0 ,
"signInCount" : 8 ,
"emailConfirmationCount" : 1 ,
"googleAuthCount" : 10 ,
"githubAuthCount" : 0 ,
"xAuthCount" : 0 ,
"facebookAuthCount" : 0 ,
"lastPasswordChanged" : null ,
"loginAttempts" : 0 ,
"lastLoginAttempt" : null ,
"lockedUntil" : null ,
"lastResetPasswordRequestAt" : null
}
}
}
{
"success" : false ,
"error" : {
"code" : "UNAUTHORIZED" ,
"message" : "Invalid or missing authentication token"
}
}
Response Fields
Core Identity
Account type: “parent” or “child”
Parent account reference (“ROOT” for parents, parent’s publicKey for children)
Account status: “active”, “inactive”, or “locked”
Whether email address is verified
Account creation timestamp
Last account update timestamp
Organization Details
Organization display name
Authentication URLs configuration
Whether widget is domain-restricted
emailVerificationRequired
Whether email verification is required
Authentication Details
Primary authentication provider: “email” or “google”
Last used authentication provider
Google account ID (if linked)
Current available credits
Cumulative free user quota from packages
Total number of child accounts
History of package purchases
Legacy dollar balance (for backward compatibility)
Legacy available balance (for backward compatibility)
Credit-Tracked Usage Statistics
Child account signups (5 credits each)
Total sign-in attempts (1 credit each)
Email confirmations performed (2 credits each)
Google OAuth authentications (3 credits each)
GitHub OAuth authentications (3 credits each)
X/Twitter OAuth authentications (3 credits each)
Facebook OAuth authentications (3 credits each)
Last password change timestamp
Failed login attempts counter
Last login attempt timestamp
Account lock expiry timestamp
lastResetPasswordRequestAt
Last password reset request timestamp
Google SSO Configuration (Parent Accounts Only)
Google SSO settings with enabled status and client ID
Error Codes
UNAUTHORIZED - Missing or invalid JWT token
ACCOUNT_INACTIVE - Account is not in active status
USER_NOT_FOUND - User account not found in database
500 Internal Server Error
INTERNAL_ERROR - Unexpected server error occurred
Security Features
Data Security Sensitive Data Excluded : The following sensitive fields are intentionally excluded from the response for security:
Hashed passwords
JWT signing secrets
Email verification tokens
Encryption keys and initialization vectors
Password reset tokens
Google OAuth client secrets
Access Control Authentication Required : This endpoint requires valid JWT authentication and will only return data for the authenticated user.
Account Type Differences
Parent Accounts
Include credit system information (balance, packages, free users)
Include legacy billing information (backward compatibility)
Include SSO configurations
Include credit-tracked operation counters
Include credit notification timestamps
Have organization settings and auth URLs
Child Accounts
No credit system information (uses parent’s credits)
No billing information
No SSO configuration
Limited credit-tracked operation counters (own activity only)
Inherit parent’s organization settings
Have OAuth authentication details
Usage Notes
This endpoint provides comprehensive user information for dashboard displays, account management interfaces, and user settings pages. This is a free operation that does not consume credits.
The response contains detailed usage statistics, credit information, and timestamps. Handle this data appropriately and avoid exposing sensitive information in client-side applications.
Credit System Features
Free Operation No Credit Cost : User profile retrieval is completely free and does not deduct credits from your account balance.
Real-time Data Current Information : Returns up-to-date credit balance, package history, and usage statistics for immediate dashboard display.