Prasunex LogoPrasunex Logo
Home
SolutionsNew
Platform
Pricing
Resources
Company
Sign In
Get Started
Book Demo
Prasunex Api Reference

Build & Scale with REST APIsv2 GatewayTurnstilesOAuth PKCEREST APIs

Direct access to the Prasunex Server Backend API. Sync student records, ingest biometric attendance, automate fee receipts, and integrate campus hardware.

Gateway URL

https://api.prasunex.com/api

Security

Bearer JWT

Specification

OpenAPI 3.1

SLA & Latency

99.99% • <25ms

API Index

ARCHITECTURE & DESIGN

API Overview

The Prasunex Education OS backend exposes unified REST interfaces organized by domain services (SIS, Biometric Attendance, Marks & Exam, Fee Gateway, Hostel, Transport, and Prerana Predictive AI).

Authentication

Secure JWT Bearer tokens and HTTP-only session cookies with role capabilities.

Strict UTF-8 JSON

Strict application/json request payloads with Zod runtime validation.

Standard Envelopes

Predictable JSON responses containing status, payload, and pagination metadata.

Error Envelopes

Uniform HTTP status codes with machine error codes and correlation IDs.

Correlation Tracking

X-Request-Id header propagation across universal audit logs for forensic tracing.

Rate Limiting

1,000 req/min standard with burst allowances for morning turnstile rushes.

STEP-BY-STEP WORKFLOW

Developer Quick Start

Follow this 4-step sequence to authenticate and communicate with the live Prasunex backend server.

01

Obtain Credentials

Login via /api/v2/auth/login or generate an API key in Management Settings.

02

Pass Bearer Token

Include "Authorization: Bearer <token>" and optional X-Request-Id header on all requests.

03

Execute First Call

Call GET /api/v2/auth/me or GET /health/ready to verify your connection and permissions.

04

Sync Subsystems

Ingest attendance batches, query student profiles, or listen for webhook triggers.

Need pre-configured credentials? Management admins can manage keys under Settings > API & Webhooks.
CODE IMPLEMENTATIONS

API Request Code Samples

Select your preferred language or shell to inspect production-ready client code with authentication and correlation tracking.

// Prasunex Node.js / TypeScript SDK Client
import { randomUUID } from 'node:crypto';

const API_BASE = 'https://api.prasunex.com/api';
const BEARER_TOKEN = process.env.PRASUNEX_API_KEY;

// 1. Fetch active students with correlation tracking
async function fetchActiveStudents(classId = 'cls_10a') {
  const requestId = randomUUID();
  const response = await fetch(`${API_BASE}/v2/management/students?classId=${classId}`, {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${BEARER_TOKEN}`,
      'X-Request-Id': requestId,
      'Accept': 'application/json'
    }
  });

  if (!response.ok) {
    throw new Error(`HTTP error ${response.status}: ${await response.text()}`);
  }
  return response.json();
}

// 2. Submit daily attendance bulk ingest
async function submitTurnstileAttendance(records) {
  const response = await fetch(`${API_BASE}/v2/attendance/bulk`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${BEARER_TOKEN}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      date: new Date().toISOString().split('T')[0],
      source: 'BIOMETRIC_TURNSTILE',
      records
    })
  });
  return response.json();
}
SECURITY & TOKENS

Authentication & Session Control

All server routes (except public health checks and login) require valid cryptographic JWT Bearer authentication passed in standard HTTP headers.

Authorization & Correlation Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
X-Request-Id: 550e8400-e29b-41d4-a716-446655440000
Content-Type: application/json
Token Security & Secret Keys

Keep secret JWT keys and private credentials server-side. Never expose long-lived admin tokens in public client-side JavaScript bundles.

Instant Key Revocation

Compromised credentials can be invalidated immediately from the Admin Global Command Center (/api/v2/admin/security/revoke).

REAL BACKEND ENDPOINTS CATALOG

Server API Endpoints Directory

Real backend route interfaces directly matching server/src/app.ts. Filter by service category or search by path keyword.

POST/api/v2/auth/loginAuth
Public

Authenticate user credentials across Student, Parent, Staff, or Management portals; returns signed JWT and sets HTTP-only refresh cookie.

Request Payload JSON

{
  "email": "registrar@campus.prasunex.com",
  "password": "••••••••••••",
  "portalType": "management"
}

Response 200 OK

{
  "success": true,
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expiresIn": 86400,
    "user": {
      "id": "usr_9410ea82",
      "email": "registrar@campus.prasunex.com",
      "fullName": "Dr. Ananya Sharma",
      "role": "REGISTRAR",
      "organisationId": "org_delhi_campus"
    }
  }
}
GET/api/v2/auth/meAuth
Bearer JWT
POST/api/v2/auth/refreshAuth
Bearer JWT
GET/api/v2/management/studentsStudents
Bearer JWT
POST/api/v2/management/studentsStudents
Bearer JWT
GET/api/v2/management/students/{id}Students
Bearer JWT
PATCH/api/v2/management/students/{id}Students
Bearer JWT
GET/api/v2/attendanceAttendance
Bearer JWT
POST/api/v2/attendance/bulkAttendance
Bearer JWT
GET/api/v2/attendance/summary/{studentId}Attendance
Bearer JWT
GET/api/v2/classesAcademics
Bearer JWT
GET/api/v2/timetable/{classId}Academics
Bearer JWT
GET/api/v2/examsExams
Bearer JWT
POST/api/v4/marks/batchExams
Bearer JWT
GET/api/v2/fee-management/invoicesFinance
Bearer JWT
POST/api/v2/fee-receipts/createFinance
Bearer JWT
GET/api/v2/defaultersFinance
Admin Scope
GET/api/v2/predictive-ai/interventionsAI & Analytics
Admin Scope
GET/api/v2/hostel/roomsHostel & Transport
Bearer JWT
GET/api/v2/transport-smart/routesHostel & Transport
Bearer JWT
GET/api/v2/audit-logsAudit & System
Admin Scope
GET/health/readyAudit & System
Public
EVENT-DRIVEN ARCHITECTURE

Real-Time Webhook Subscriptions

Receive asynchronous notifications when state-changing institutional events occur without continuous polling.

student.enrolled

Triggered when a student is admitted and allocated to an SIS class vault.

attendance.recorded

Dispatched immediately when morning turnstiles or mobile scans log entry.

fee.paid

Sent when Razorpay or bank gateway reconciles digital fee collection.

exam.published

Fires when teachers publish term marksheets and generate report cards.

transport.sos

Urgent broadcast emitted when campus transport triggers GPS distress alerts.

ai.risk_flagged

Dispatched when Prerana AI identifies an academic or attendance intervention.

HMAC-SHA256 Webhook Signature Verification
import crypto from 'node:crypto';

function verifyPrasunexWebhook(rawPayload, signatureHeader, webhookSecret) {
  const computedSignature = crypto
    .createHmac('sha256', webhookSecret)
    .update(rawPayload)
    .digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(signatureHeader),
    Buffer.from(computedSignature)
  );
}
HTTP STATUS & ERROR PROTOCOLS

Error Handling & Codes

Prasunex returns standard HTTP response codes accompanied by structured, machine-readable JSON error payloads.

Scroll horizontally to view error resolutions
HTTP StatusMeaningDescriptionRecommended Resolution
200OKThe request completed successfully. Standard successful execution response.Process the enclosed JSON data payload.
400Bad RequestMalformed JSON syntax, invalid query parameters, or missing mandatory fields.Verify request payload against the endpoint schema specification.
401UnauthorizedMissing, malformed, or expired Bearer JWT token in the Authorization header.Pass Authorization: Bearer <valid_jwt> or exchange refresh token via /api/v2/auth/refresh.
403ForbiddenThe authenticated user lacks the required RBAC role permissions or tenancy scope.Contact campus IT administrator to grant required role capabilities in School RBAC.
404Not FoundThe target institutional resource (student, class, exam, invoice) does not exist.Check URI path identifiers and verify organization scope.
422Unprocessable EntitySemantic constraint violation (e.g. duplicate admission number or invalid academic year).Inspect the detailed validation errors array in the response body.
429Too Many RequestsRate limit threshold exceeded (1,000 requests/minute per institutional token).Honor the Retry-After HTTP response header and apply exponential backoff.
500Internal Server ErrorAn unhandled server exception occurred. The incident was automatically logged with correlation ID.Check X-Request-Id in headers and contact enterprise support with the correlation ID.
503Service UnavailableSubsystem readiness probe indicates maintenance or temporary database failover.Query /health/ready to monitor live cluster health.
PROTECTION & COMPLIANCE

API Security & Rate Limits

Prasunex protects sensitive educational records with strict transport security, tenant isolation, and cryptographic auditing.

TLS 1.3 Transport

All REST traffic mandates HTTPS encrypted via TLS 1.3. Plain HTTP requests are rejected automatically.

Granular RBAC Scopes

Tokens are restricted to specific operations (e.g. read-only student queries or turnstile write ingest).

1,000 req/min Burst

Per-token rate limiting protects institutional availability with burst capacity for morning bell rush.

FREQUENT DEVELOPER QUESTIONS

Developer FAQ

Direct answers regarding backend authentication, correlation tracing, rate limits, and integration practices.

Prasunex implements OAuth 2.0 / JWT session authentication over HTTPS. You can exchange credentials at /api/v2/auth/login to obtain a scoped Bearer token. All subsequent requests require the "Authorization: Bearer <token>" header.
SOLUTIONS ENGINEERING

Need help building custom integrations?

Our solutions engineering team assists institutional developers with biometric hardware integration, SIS roster synchronization, and custom webhooks.

Talk to an EngineerDeveloper Docs
Prasunex LogoPrasunex Logo

Prasunex empowers educational institutions to transform raw operations into clear, compelling, AI-driven experiences — making insights easier to share, understand, and act on.

Stay updated with AI innovations & platform releases

Product

  • Student Portal
  • Parent Portal
  • Staff Portal
  • Management ERP
  • Job Portal
  • College ERP Suite
  • All Solutions

Resources

  • Documentation
  • API Reference
  • Tutorials & Guides
  • Help Center
  • Release Notes
  • Blog & Articles
  • Case Studies

Company

  • About Us
  • Careers
  • Contact Us
  • Book a Demo
  • Pricing Plans
  • Get Started

Get in Touch

+91 8905483183prasunex@gmail.com
Chandigarh, India

© 2026 Prasunet Pvt Ltd. All rights reserved.

Privacy PolicyCookie PolicyTerms of Service
Prasunex