📖 API Reference
This section documents all available endpoints in JANUX Authentication Gateway, covering authentication, user management, admin operations, and system status.
🌍 Base Endpoints
Endpoints for general service interaction and health checks.
🏠 Welcome Message
Returns a welcome message from the authentication service.
- Endpoint:
GET /
- Response (Success 200):
💚 Health Check
Verify if the service is running and responsive.
- Endpoint:
GET /health
- Response (Success 200):
🔄 Readiness Probe
Indicates if the application is ready to receive traffic.
- Endpoint:
GET /readiness
- Response (Success 200):
🚀 Liveness Probe
Checks if the application is alive.
- Endpoint:
GET /liveness
- Response (Success 200):
🔑 Authentication Endpoints
Handles user and admin authentication, JWT token issuance, and logout.
🔐 Login
Authenticate a user or admin and receive an access token.
- Endpoint:
POST /auth/login
- Request Body (Form Data):
- Response (Success 200):
- Response (Failure 401 - Unauthorized):
- Response (Failure 429 - Too Many Requests):
👤 User Endpoints
Endpoints for user registration, profile management, and logout.
📝 Register User
Creates a new user account.
- Endpoint:
POST /users/register
- Request Body (JSON):
- Response (Success 201):
-
Response (Failure 409 - Conflict):
-
Response (Failure 429 - Too Many Requests):
👀 Get Current User Profile
Retrieve details of the authenticated user.
- Endpoint:
GET /users/profile
-
Headers:
-
Response (Success 200):
- Response (Failure 401 - Unauthorized):
🚪 User Logout
Logs out the currently authenticated user.
- Endpoint:
POST /users/logout
- Headers:
-
Response (Success 200):
-
Response (Failure 401 - Unauthorized):
🛡️ Admin Endpoints
Endpoints for admin actions like user management and profile retrieval.
📋 List All Users
Fetches all registered users (Admin Only).
- Endpoint:
GET /admins/users
- Headers:
- Response (Success 200):
- Response (Failure 401 - Unauthorized):
❌ Delete User (Admin Only)
Deletes a user by ID.
- Endpoint:
DELETE /admins/users/{user_id}
- Headers:
- Response (Success 200):
- Response (Failure 404 - Not Found):
- Response (Failure 401 - Unauthorized):
👤 Get Admin Profile
Retrieve the currently authenticated admin profile.
- Endpoint:
GET /admins/profile
-
Headers:
-
Response (Success 200):
🚪 Admin Logout
Logs out the currently authenticated admin.
- Endpoint:
POST /admins/logout
-
Headers:
-
Response (Success 200):
-
Response (Failure 401 - Unauthorized):
📂 API Documentation
Access interactive API docs: