AETech Unified API

Centralized backend for all AETech portals

Version 1.0.0

Base URL:https://api.aetechlabs.com

System Status

API Online

All services operational

🗄️

Database Connected

MongoDB ready

Authentication

All API endpoints require authentication via NextAuth.js session tokens.

Endpoints

POST/v1/api/auth/signup

Create new account with email/password

POST/v1/api/auth/signin

Sign in with credentials or OAuth

POST/v1/api/auth/signout

End user session

GET/v1/api/auth/session

Get current session

Providers

  • Credentials (email/password with bcrypt)
  • Google OAuth 2.0

API Endpoints

👤 User Management

GET/v1/api/users/profile🔒 Auth Required

Get authenticated user profile

PUT/v1/api/users/profile🔒 Auth Required

Update user profile

Request Body:

{
  "name": "string",
  "image": "string"
}

📚 Courses

GET/v1/api/courses🔒 Auth Required

List all courses with pagination

Query Parameters:

{
  "page": "number",
  "limit": "number"
}

✅ Certificate Verification

GET/v1/api/verify/{code}

Verify certificate by code

🆔 Staff Identity & Verification

GET/v1/api/staff🔒 Auth Required

List all staff identities (admin only)

Query Parameters:

{
  "page": "number",
  "limit": "number",
  "status": "string",
  "department": "string",
  "search": "string"
}
POST/v1/api/staff🔒 Auth Required

Create new staff identity (admin only)

Request Body:

{
  "employeeId": "string",
  "firstName": "string",
  "lastName": "string",
  "email": "string",
  "department": "string",
  "role": "string"
}
GET/v1/api/staff/{employeeId}

Get staff identity details (role-based access)

PUT/v1/api/staff/{employeeId}🔒 Auth Required

Update staff identity (admin only)

POST/v1/api/staff/{employeeId}/verify

Verify staff identity via QR scan or token

Request Body:

{
  "token": "string",
  "scanType": "string",
  "scannedBy": "string",
  "purpose": "string",
  "location": "string"
}
GET/v1/api/staff/{employeeId}/qrcode🔒 Auth Required

Generate QR code data for staff ID

POST/v1/api/staff/{employeeId}/access

Log building/room access attempt

Request Body:

{
  "accessType": "string",
  "location": "string",
  "action": "string",
  "deviceId": "string"
}
GET/v1/api/staff/{employeeId}/access🔒 Auth Required

Get access logs for staff member

Query Parameters:

{
  "page": "number",
  "limit": "number",
  "accessType": "string"
}

🛒 Store

GET/v1/api/store/products

List store products with pagination

Query Parameters:

{
  "page": "number",
  "limit": "number"
}

Response Format

Success Response

{
  "success": true,
  "data": { ... },
  "meta": {
    "page": 1,
    "limit": 10,
    "total": 100
  }
}

Error Response

{
  "success": false,
  "error": "Error message"
}