All Nirvahak API requests must be authenticated using a Bearer Token. This ensures that only authorized users or systems can access protected endpoints.
How Authentication Works:-
| Step | Action | Endpoint | Description |
| 1 | Login with credentials | POST /user/login | Sends username and password to receive a token |
| 2 | Include Authorization: Bearer YOUR_TOKEN In every protected request | All endpoints | Include Authorization: Bearer YOUR_TOKEN in every protected request |
Success Response:-
{
"status": "success",
"token": "eyJhbGciOiJIUzI1NiIsInR5..."
}
Body:-
curl -X POST https://api.nirvahak.com/v1/user/login \
-H "Content-Type: application/json" \
-d '{
"username": "vasanthi",
"password": "example123"
}'