SamaySetu API Docs LogoSamaySetu API Docs Logo
SamaySetu API Docsv1.0.0
  • Documentation
  • API Reference
Information
Authentication
    LoginpostGet Current UsergetChange First PasswordpostForgot PasswordpostVerify Reset Link (Browser)getReset Passwordpost
Accounts & Access
Academic Structure
Curriculum & Infrastructure
Faculty Management
Timetable Management
Analytics & System
Security Governance
SamaySetu API Documentation
SamaySetu API Documentation

Authentication

Login, session user lookup, password recovery, browser reset link handling, and first-login password change


Login

POST
https://api.samaysetu.example
/auth/login

Authenticates email and password, checks account lockout/verification/approval status and maintenance mode, and returns a 1-hour JWT Bearer token.

Access: Public (no JWT required).

Login › Request Body

AuthRequest
email
​string · email · minLength: 1 · required
password
​string · minLength: 1 · required

Login › Responses

OK

JWT authentication response issued by POST /auth/login.
AuthResponse
email
​string · email · required
token
​string · required

Signed HS256 JWT Bearer token valid for 1 hour.

role
​string · required

Assigned institutional role.

firstLogin
​boolean · required

True when the caller must change their initial password via POST /auth/change-first-password.

POST/auth/login
curl https://api.samaysetu.example/auth/login \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "email": "aarav.kulkarni@mitaoe.ac.in", "password": "YOUR_PASSWORD" }'
Example Request Body
{ "email": "aarav.kulkarni@mitaoe.ac.in", "password": "YOUR_PASSWORD" }
json
application/json
Example Responses
{ "email": "aarav.kulkarni@mitaoe.ac.in", "token": "YOUR_JWT_TOKEN", "role": "TIMETABLE_COORDINATOR", "firstLogin": false }
json
application/json

Get Current User

GET
https://api.samaysetu.example
/auth/me

Returns the server-authoritative email, name, role, approval/firstLogin flags, and optional department metadata from the database.

Access: Authenticated caller (Authorization: Bearer <token>).

Get Current User › Responses

OK

Server-authoritative authenticated user summary returned by GET /auth/me.
CurrentUserResponse
email
​string · email · required
name
​string · required
role
​string · required
isFirstLogin
​boolean · required
isApproved
​boolean · required
departmentId
​integer · int64

Present when the user is assigned to a department.

departmentName
​string

Present when the user is assigned to a department.

GET/auth/me
curl https://api.samaysetu.example/auth/me \ --header 'Authorization: Bearer <token>'
Example Responses
{ "email": "aarav.kulkarni@mitaoe.ac.in", "name": "Aarav Kulkarni", "role": "TIMETABLE_COORDINATOR", "isFirstLogin": false, "isApproved": true, "departmentId": 101, "departmentName": "Computer Engineering" }
json
application/json

Change First Password

POST
https://api.samaysetu.example
/auth/change-first-password

Updates the initial password for an authenticated user whose firstLogin flag is true. Identity is derived strictly from the JWT Principal.

Access: Authenticated caller (Authorization: Bearer <token>).

Change First Password › Request Body

ChangeFirstPasswordRequest
newPassword
​string · minLength: 8 · maxLength: 2147483647 · pattern: ^(?=.*[a-z])(?=.*[A-… · required

Change First Password › Responses

OK

string
POST/auth/change-first-password
curl https://api.samaysetu.example/auth/change-first-password \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "newPassword": "SampleNewPass@2026" }'
Example Request Body
{ "newPassword": "SampleNewPass@2026" }
json
application/json
Example Responses
Password updated successfully! You can continue with your session.
json
application/json

Forgot Password

POST
https://api.samaysetu.example
/auth/forgot-password

Initiates a 1-hour password reset token email. Always returns a generic success message to prevent email enumeration.

Access: Public (no JWT required).

Forgot Password › Request Body

ForgotPasswordRequest
email
​string · email · minLength: 1 · required

Forgot Password › Responses

OK

string
POST/auth/forgot-password
curl https://api.samaysetu.example/auth/forgot-password \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "email": "aarav.kulkarni@mitaoe.ac.in" }'
Example Request Body
{ "email": "aarav.kulkarni@mitaoe.ac.in" }
json
application/json
Example Responses
If this email is registered, you will receive a password reset link.
json
application/json

Verify Reset Link (Browser)

GET
https://api.samaysetu.example
/auth/reset-password

Validates a password-reset token clicked from an email link and issues a 302 Found redirect to the web reset-password UI with either ?token=... or ?error=.... Programmatic REST clients should submit reset tokens directly to POST /auth/reset-password.

Verify Reset Link (Browser) › query Parameters

token
​string · required

Password-reset token included in the verification email link

Verify Reset Link (Browser) › Responses

Redirects browser to the web frontend /reset-password screen

string
GET/auth/reset-password
curl 'https://api.samaysetu.example/auth/reset-password?token=<string>'
Example Responses
Redirecting to password reset page...
text
text/plain

Reset Password

POST
https://api.samaysetu.example
/auth/reset-password

Resets the user password using a valid password reset token.

Access: Public (no JWT required).

Reset Password › Request Body

ResetPasswordRequest
newPassword
​string · minLength: 8 · maxLength: 2147483647 · pattern: ^(?=.*[a-z])(?=.*[A-… · required
token
​string · minLength: 1 · required

Reset Password › Responses

OK

string
POST/auth/reset-password
curl https://api.samaysetu.example/auth/reset-password \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "token": "YOUR_RESET_TOKEN", "newPassword": "SampleNewPass@2026" }'
Example Request Body
{ "token": "YOUR_RESET_TOKEN", "newPassword": "SampleNewPass@2026" }
json
application/json
Example Responses
Password reset successfully! You can now login with your new password.
json
application/json

Accounts & Users