Overview
Authenticate users and receive JWT tokens for both parent and child accounts. Supports enhanced organization-based authentication and widget access.
Credit System : Each signin costs 1 credit from the parent account. Child accounts are blocked if parent has insufficient credits, but parent accounts always have access.
API Details
Email address for authentication
Required for child accounts
Parent Account
Child Account
Try It Out
Test the API by filling in the values and clicking Send:
Parent public Key (required for child accounts)
Code Examples
curl -X POST https://api.authiqa.com/auth/signin \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected] ",
"password": "Password123!"
}'
Account Types & Authentication
Parent Accounts
Standard Parent : No parentPublicKey required
Parent accounts can have organization settings
Child Accounts
Always require parentPublicKey in request
Parent account must have sufficient balance
Inherit email verification requirements from parent
Organization-Based Authentication
For organization accounts accessing widgets:
User’s organization must match the key owner’s organization
Organization must be in the authorized list
Parent account must be active with sufficient balance
Response Examples
200: Success - Parent Account
{
"success" : true ,
"data" : {
"token" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ,
"user" : {
"userID" : "user_123" ,
"email" : "[email protected] " ,
"username" : "user123" ,
"accountType" : "parent" ,
"parentAccount" : "ROOT" ,
"publicKey" : "APK_xxx" ,
"organizationName" : "Example Corp" ,
"organizationUrl" : "https://example.com" ,
"organizationUpdateCount" : 2
},
"passwordStatus" : {
"expired" : false ,
"daysUntilExpiry" : 75
},
"jwtSecret" : "secret_key_for_parent"
}
}
200: Success - Child Account
{
"success" : true ,
"data" : {
"token" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ,
"user" : {
"userID" : "child_456" ,
"email" : "[email protected] " ,
"username" : "child123" ,
"accountType" : "child" ,
"parentAccount" : "APK_parent_key_123" ,
"publicKey" : "APK_child_xxx" ,
"organizationName" : "Example Corp" ,
"organizationUrl" : null ,
"organizationUpdateCount" : 0
},
"passwordStatus" : {
"expired" : false ,
"daysUntilExpiry" : 90
}
}
}
200: Success - Password Expired
{
"success" : true ,
"data" : {
"token" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ,
"user" : {
"userID" : "user_123" ,
"email" : "[email protected] " ,
"username" : "user123" ,
"accountType" : "parent" ,
"parentAccount" : "ROOT" ,
"publicKey" : "APK_xxx"
},
"passwordStatus" : {
"expired" : true ,
"daysUntilExpiry" : 0
}
}
}
{
"success" : false ,
"error" : {
"code" : "MISSING_REQUIRED_FIELDS" ,
"message" : "Email and password are required"
}
}
{
"success" : false ,
"error" : {
"code" : "INVALID_CREDENTIALS" ,
"message" : "Invalid email or password"
}
}
Error Codes
MISSING_REQUEST_BODY - Request body required
INVALID_REQUEST_BODY - Invalid JSON format
MISSING_REQUIRED_FIELDS - Missing email/password
MISSING_PARENT_PUBLIC_KEY - Parent public key required for child accounts
INVALID_REQUEST - Parent public key should not be provided for standard parent accounts
PARENT_NO_ORGANIZATION - Parent account has no organization
INVALID_CREDENTIALS - Invalid email or password
INVALID_PARENT_PUBLIC_KEY - Invalid parent public key
ORGANIZATION_MISMATCH - Account organization does not match key owner
EMAIL_NOT_VERIFIED - Email verification required
ACCOUNT_INACTIVE - Account is not active
ACCOUNT_LOCKED - Too many failed attempts
PARENT_ACCOUNT_INACTIVE - Parent account has insufficient balance
PARENT_INACTIVE - Parent account is not active
ORGANIZATION_NOT_AUTHORIZED - Organization not authorized for widget authentication
USER_NOT_FOUND - User account not found
PARENT_NOT_FOUND - Parent account not found
Key Features
Password Management
90-day password expiry tracking
passwordStatus object includes:
expired: Boolean indicating if password has expired
daysUntilExpiry: Number of days remaining (0 if expired)
Password age calculated from lastPasswordChanged or account creation
Enhanced Security
Login attempt management with account locking
Email verification enforcement when required by organization
Account status validation (active/inactive)
Parent account balance verification for child operations
Organization Support
Organization-based access control with authorized organization lists
Cross-organization validation for enhanced security
JWT secrets provided for parent accounts
Account Hierarchy
Child accounts require parent public key and inherit parent settings
Parent accounts can authenticate with or without organization context
Balance verification ensures parent accounts can support child operations
Organization inheritance from parent to child accounts
Authentication Flow
Standard Parent Account
Provide email and password (no parentPublicKey)
Validate credentials and account status
Return JWT token with user data and JWT secret
Child Account
Provide email, password, and parentPublicKey
Validate parent-child relationship
Check parent account balance and status
Return JWT token (uses parent’s JWT secret)
Provide email, password, and organization’s parentPublicKey
Verify organization membership and authorization
Check parent account status
Return JWT token with organization context