https://api.novacash.bi/v1Authentication API
Secure NovaCash user authentication management - Sign Up, Login, and Verification
Authentication Overview
The NovaCash Authentication API provides secure user management through a comprehensive authentication system. This API handles user registration, login, and account verification with industry-standard security practices.
Base URL
https://api.novacash.bi/v1/authUser Object
The User object represents a NovaCash user account. It contains all the essential information about a user including personal details, account status, and timestamps.
| Attribute | Type | Description |
|---|---|---|
| id | string | Unique identifier for the user |
| phone | string | User phone number in E.164 format |
| first_name | string | User first name |
| last_name | string | User last name |
| string | User email address | |
| role | string | User role (user, agent, admin) |
| status | string | User status (pending, active, blocked, suspended) |
| verification_required | boolean | Whether the user needs verification |
| created_at | string | Timestamp when the user was created |
| verified_at | string | Timestamp when the user was verified |
Token Object
The Token object contains authentication tokens returned after successful login. Use the access_token in the Authorization header for authenticated API requests.
| Attribute | Type | Description |
|---|---|---|
| access_token | string | JWT access token for API authentication |
| token_type | string | Type of token (always 'bearer') |
| expires_in | number | Token expiration time in seconds |
| refresh_token | string | Token used to refresh the access token |
/v1/auth/signup
Create a new user account
Endpoint
POST /v1/auth/signupRequired Parameters
User phone number in E.164 format
User password (min 8 characters)
User first name
User last name
User email address
User role (default: user)
Request Example
1curl -X POST https://api.novacash.bi/v1/auth/signup \2 -H "Content-Type: application/json" \3 -d '{4 "phone": "+25761234567",5 "password": "your_secure_password",6 "first_name": "John",7 "last_name": "Doe",8 "email": "john.doe@example.com",9 "role": "user"10 }'
Response Example
{
"id": "user_2fR3gH5jK8lM",
"object": "user",
"phone": "+25761234567",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"role": "user",
"status": "pending",
"created_at": "2024-01-15T10:30:00Z",
"verification_required": true
}/v1/auth/login
Authenticate user and get access token
Endpoint
POST /v1/auth/loginRequired Parameters
User phone number
User password
Request Example
1curl -X POST https://api.novacash.bi/v1/auth/login \2 -H "Content-Type: application/json" \3 -d '{4 "phone": "+25761234567",5 "password": "your_secure_password"6 }'
Response Example
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "bearer",
"expires_in": 3600,
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "user_2fR3gH5jK8lM",
"phone": "+25761234567",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"role": "user",
"status": "active"
}
}/v1/auth/verify
Verify user account with SMS code
Endpoint
POST /v1/auth/verifyRequired Parameters
User phone number
6-digit verification code from SMS
Request Example
1curl -X POST https://api.novacash.bi/v1/auth/verify \2 -H "Content-Type: application/json" \3 -d '{4 "phone": "+25761234567",5 "verification_code": "123456"6 }'
Response Example
{
"message": "Account verified successfully",
"user": {
"id": "user_2fR3gH5jK8lM",
"status": "active",
"verified_at": "2024-01-15T10:35:00Z"
}
}