NovaCash API

Home
Base URL:https://api.novacash.bi/v1

Authentication 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/auth

User 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.

AttributeTypeDescription
idstringUnique identifier for the user
phonestringUser phone number in E.164 format
first_namestringUser first name
last_namestringUser last name
emailstringUser email address
rolestringUser role (user, agent, admin)
statusstringUser status (pending, active, blocked, suspended)
verification_requiredbooleanWhether the user needs verification
created_atstringTimestamp when the user was created
verified_atstringTimestamp 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.

AttributeTypeDescription
access_tokenstringJWT access token for API authentication
token_typestringType of token (always 'bearer')
expires_innumberToken expiration time in seconds
refresh_tokenstringToken used to refresh the access token
POST

/v1/auth/signup

Create a new user account

Endpoint

POST /v1/auth/signup

Required Parameters

phone*

User phone number in E.164 format

string
password*

User password (min 8 characters)

string
first_name*

User first name

string
last_name*

User last name

string
email

User email address

string
role

User role (default: user)

string

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
}
POST

/v1/auth/login

Authenticate user and get access token

Endpoint

POST /v1/auth/login

Required Parameters

phone*

User phone number

string
password*

User password

string

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"
  }
}
POST

/v1/auth/verify

Verify user account with SMS code

Endpoint

POST /v1/auth/verify

Required Parameters

phone*

User phone number

string
verification_code*

6-digit verification code from SMS

string

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"
  }
}

Introduction