Home / Developers

UTT API reference

Everything your backend needs to verify a UTT licence, enforce permissions, launch students into exams and react to licence changes. Version 1.

Base URL https://api.upskool.in/v1 Sandbox https://sandbox.api.upskool.in/v1 Format JSON over HTTPS
On this page

On this page

Introduction

The UTT API has two parts. The licence API tells your platform whether its UTT licence is valid and which features it may use. The exam engine API lets your backend create exams, launch students into them and read results.

  • All requests use HTTPS. Plain HTTP is refused.
  • Request and response bodies are JSON, encoded as UTF-8.
  • Times are ISO 8601 with an offset, for example 2026-12-07T10:42:18+05:30. Request signing timestamps are Unix seconds.
  • IDs are strings. Treat them as opaque and don't parse them.
  • The API version is part of the path: /v1.

This page documents UTT API v1 in general terms. The integration documentation issued with your licence is the binding reference for your deployment, including any endpoints added for your platform.

Quick start

  1. Sign the licence agreement. Upskool registers your organisation and creates a licence in pending status.
  2. Receive your sandbox credentials and a one-time activation code by email.
  3. Call POST /installations/activate from your server to get an installation ID, an installation token and a signing secret. Store them as server-side secrets.
  4. Add a licence verification call and the permission middleware to your backend.
  5. Test every licence status with the sandbox test keys.
  6. Switch to live credentials. Upskool activates the licence, and your platform starts getting active responses.

Authentication

Each installation of UTT has four credentials. All of them belong on your server. None of them may ever be sent to a browser or shipped inside a mobile app.

CredentialLooks likeUsed for
Licence keyutt_live_... or utt_test_...Identifies the licence. Sent in the verification body.
Installation IDinst_01HZX4...Identifies this deployment of UTT.
Installation token64 random charactersSent as Authorization: Bearer on every request.
Signing secret64 random charactersSigns request bodies with HMAC-SHA256. Never sent over the network.

If a credential leaks, email contact@upskool.in. We rotate it and revoke the old value, and the licence itself is not affected.

Request signing

Every request that has a body must be signed. Signing proves the request came from your server and wasn't changed on the way.

  1. Take the current Unix time in seconds, for example 1796601600.
  2. Build the string {timestamp}.{raw request body}.
  3. Compute an HMAC-SHA256 of that string with your signing secret and hex-encode it.
  4. Send the time in X-UTT-Timestamp and the result in X-UTT-Signature.

Requests with a timestamp more than 300 seconds away from server time are rejected with clock_skew. Each nonce can be used once within 10 minutes, which stops a captured request being replayed. Keep your server clock synced with NTP.

Verify a licence

POST/v1/licence/verify

Returns the licence status, expiry, grace period and permissions for this installation, plus a signed copy of the same data.

Request body

FieldTypeDescription
licence_keystringRequired. Your licence key.
installation_idstringRequired. Your installation ID.
domainstringRequired. The domain UTT is running on. Must match an authorised domain on the licence.
actionstringOptional. The permission you are about to use, such as attempt.start. Logged for your verification history.
noncestringRequired. 8 to 64 random characters, unique per request.

Example request

BODY='{"licence_key":"utt_live_8f3kq2...","installation_id":"inst_01HZX4","domain":"exams.your-institute.in","action":"attempt.start","nonce":"c1d9a8e2"}'
TS=$(date +%s)
SIG=$(printf '%s.%s' "$TS" "$BODY" | openssl dgst -sha256 -hmac "$UTT_SIGNING_SECRET" | sed 's/^.* //')

curl -X POST https://api.upskool.in/v1/licence/verify \
  -H "Authorization: Bearer $UTT_INSTALLATION_TOKEN" \
  -H "Content-Type: application/json" \
  -H "X-UTT-Timestamp: $TS" \
  -H "X-UTT-Signature: $SIG" \
  -d "$BODY"

Example response

200 OK
{
  "licence_id": "UTT-LIC-000001",
  "client_id": "UTT-CL-000001",
  "status": "active",
  "licence_type": "annual",
  "domain": "exams.your-institute.in",
  "activated_at": "2026-12-07T00:00:00+05:30",
  "expires_at": "2027-12-07T00:00:00+05:30",
  "server_time": "2026-12-07T10:42:18+05:30",
  "grace_until": "2026-12-10T10:42:18+05:30",
  "check_after": "2026-12-07T16:42:18+05:30",
  "permissions": {
    "exam.create": true,
    "exam.publish": true,
    "exam.edit": true,
    "exam.manage": true,
    "attempt.start": true,
    "attempt.continue": true,
    "reports.advanced": true,
    "analytics.generate": true,
    "history.read": true,
    "data.export": true
  },
  "signature": "eyJhbGciOiJFZERTQSIsImtpZCI6InV0dC0yMDI2In0..."
}

Response fields

FieldDescription
statusOne of the licence statuses.
expires_atWhen the licence term ends.
server_timeUpskool's server time. Use it, not your own clock, for expiry decisions.
grace_untilHow long you may keep relying on this response if later checks can't reach the server. 72 hours after server_time.
check_afterWhen to verify again. Usually 6 hours after server_time.
permissionsMap of permission names to true or false.
signatureAn EdDSA-signed JWT containing all of the fields above. Your code must check it.

Check the response signature

The plain fields in the response are there for logging. Your enforcement decisions must use the claims inside signature, after you have checked it. A copied or edited response then can't unlock features.

  • Algorithm: EdDSA with an Ed25519 key.
  • Public keys: GET https://api.upskool.in/v1/.well-known/jwks.json. Select the key by the kid in the token header.
  • Issuer (iss): https://api.upskool.in. Audience (aud): your installation ID.
  • Keys rotate once a year. The new key appears in the JWKS before it is used, so cache the JWKS for up to 24 hours and refetch when you see an unknown kid.
// npm install jose
import { createRemoteJWKSet, jwtVerify } from 'jose';

const JWKS = createRemoteJWKSet(
  new URL('https://api.upskool.in/v1/.well-known/jwks.json')
);

export async function readSignedLicence(response) {
  const { payload } = await jwtVerify(response.signature, JWKS, {
    issuer: 'https://api.upskool.in',
    audience: process.env.UTT_INSTALLATION_ID,
    algorithms: ['EdDSA']
  });
  return payload; // trust these claims, not the unsigned fields
}

Licence statuses

ValueMeaningWhat your platform should do
pendingCreated, not yet activatedKeep UTT features hidden. Show admins that activation is pending.
activeLicensed features authorisedAllow the features marked true in permissions.
suspendedTemporarily restricted by UpskoolBlock new exams and attempts. Let running attempts finish. Keep history and exports.
expiredLicence term has endedSame as suspended, and show admins a renewal notice.
revokedLicence terminatedSame as expired. Keep data available for export under your agreement.
verification_unavailableYour platform could not reach the serverNot returned by the API. Your code uses this state when a check fails: rely on the last signed response until grace_until.

Permissions

PermissionControlsWhen suspended or expired
exam.createCreating new examsfalse
exam.publishPublishing and unpublishing examsfalse
exam.editChanging exam settingsfalse
exam.manageScheduling, eligibility and question banksfalse
attempt.startStudents starting a new attemptfalse
attempt.continueSaving answers and submitting an attempt already in progresstrue
reports.advancedThe advanced reporting dashboardfalse
analytics.generateGenerating new analytics reportsfalse
history.readReading past exams, attempts and resultstrue
data.exportAuthorised export of historical datatrue

Enforce in your backend

Put the check in front of every route that uses a licensed feature. Hiding a button in the browser is not enforcement.

// Express middleware. getLicence() returns verified, cached claims (see Caching).
import { getLicence } from './utt.js';

export function requireLicence(permission) {
  return async (req, res, next) => {
    const licence = await getLicence(permission);
    if (licence.permissions[permission] === true) return next();
    return res.status(403).json({
      error: 'licence_restricted',
      status: licence.status,
      message: 'This UTT feature is not available on the current licence.'
    });
  };
}

app.post('/exams', requireLicence('exam.create'), createExam);
app.post('/exams/:id/publish', requireLicence('exam.publish'), publishExam);
app.post('/attempts', requireLicence('attempt.start'), startAttempt);
app.post('/attempts/:id/answers', requireLicence('attempt.continue'), saveAnswer);
app.get('/results/export', requireLicence('data.export'), exportResults);

Caching and grace period

You don't need to call the API on every page load. Cache the verified claims on your server, in memory or in Redis, and follow these rules.

EventCall verify?
Your application startsYes
The time in check_after has passedYes
Creating, editing or publishing an examYes, if the cached response is more than 15 minutes old
A student starts an attemptYes, if the cached response is more than 15 minutes old
A student saves an answer or submitsNo. Use the cached attempt.continue
A licence.* webhook arrivesYes, straight away

If a call fails because of a timeout, a 5xx response or a network error:

  1. Retry up to three times with backoff: 1 second, 3 seconds, 9 seconds.
  2. If it still fails, treat the state as verification_unavailable and keep using the last verified claims until grace_until.
  3. After grace_until, deny restricted permissions until a check succeeds. Keep attempt.continue, history.read and data.export working so no student loses an attempt.

Never extend grace_until yourself and never cache licence data in the browser. A 4xx response such as invalid_credentials is not an outage and doesn't start a grace period.

Licence status endpoint

GET/v1/licence/status

A light read for admin dashboards: status, expiry date and days remaining. It is not signed, so don't use it for enforcement.

200 OK
{
  "licence_id": "UTT-LIC-000001",
  "status": "active",
  "expires_at": "2027-12-07T00:00:00+05:30",
  "days_remaining": 365,
  "renewal_url": "mailto:contact@upskool.in?subject=Renew%20UTT-LIC-000001"
}

Activate an installation

POST/v1/installations/activate

Run this once, from your server, when you first install UTT. It exchanges the one-time activation code Upskool sends you for permanent installation credentials. This request uses the activation code instead of a bearer token and is not HMAC-signed.

Request
{
  "activation_code": "ACT-7Q2M-9KXD",
  "licence_key": "utt_live_8f3kq2...",
  "domain": "exams.your-institute.in",
  "platform": "nodejs-20"
}
201 Created
{
  "installation_id": "inst_01HZX4",
  "installation_token": "shown once, store it as a secret",
  "signing_secret": "shown once, store it as a secret",
  "webhook_secret": "shown once, store it as a secret",
  "licence_status": "pending"
}

The token and secrets appear only in this response. If you lose them, ask Upskool to rotate them. Activation codes expire 72 hours after they are issued and work once.

Exam engine endpoints

These endpoints use the same bearer token and request signing. Each one checks the listed permission on Upskool's side as well, so a stale cache on your side can't bypass a suspension.

Method and pathPurposePermission
POST /v1/sessions/launchCreate a one-time launch link for a studentattempt.start
GET /v1/examsList examshistory.read
POST /v1/examsCreate an examexam.create
PATCH /v1/exams/{exam_id}Change exam settingsexam.edit
POST /v1/exams/{exam_id}/publishPublish an examexam.publish
POST /v1/exams/{exam_id}/unpublishTake an exam offlineexam.publish
GET /v1/questionsSearch the question bank by subject, topic and difficultyexam.manage
POST /v1/questionsAdd a questionexam.manage
PATCH /v1/questions/{question_id}Update a questionexam.manage
GET /v1/attempts/{attempt_id}Read an attempt and its answershistory.read
POST /v1/attempts/{attempt_id}/submitSubmit an attempt from your serverattempt.continue
GET /v1/resultsResults for an exam, filterable by studenthistory.read
GET /v1/reports/{exam_id}Score distribution, accuracy and section analysisreports.advanced
POST /v1/exportsStart a CSV or Excel exportdata.export
GET /v1/exports/{export_id}Check an export and get its download linkdata.export

List endpoints return up to 50 items and a next_cursor. Pass it as ?cursor= to get the next page.

POST /v1/exams
{
  "title": "Physics mock test 04",
  "instructions": "Read each question carefully. Each wrong answer costs one mark.",
  "duration_minutes": 60,
  "available_from": "2026-12-14T09:00:00+05:30",
  "available_until": "2026-12-14T18:00:00+05:30",
  "marking": { "correct": 4, "incorrect": -1, "unattempted": 0 },
  "sections": [
    { "name": "Mechanics", "question_ids": ["q_8812", "q_8813", "q_8820"] },
    { "name": "Optics", "question_ids": ["q_9001", "q_9004"] }
  ],
  "auto_submit": true,
  "eligibility": { "batch_ids": ["jee-2027-morning"] }
}

Student single sign-on

Students log in to your platform, not to UTT. When a student opens an exam, your server asks UTT for a launch link and redirects the student to it.

POST/v1/sessions/launch
Request
{
  "student": { "id": "stu_20931", "name": "Aditi Sharma", "email": "aditi.s@your-institute.in" },
  "exam_id": "exm_5521",
  "return_url": "https://exams.your-institute.in/dashboard"
}
201 Created
{
  "launch_url": "https://exams.your-institute.in/utt/launch?t=lt_3kq9...",
  "expires_in": 120,
  "attempt_id": "att_77102"
}
  • student.id is your own ID for the student. UTT stores it so results map back to your records.
  • The launch link works once and expires after 120 seconds.
  • When the student finishes, UTT sends them to return_url, which must be on an authorised domain.
  • Send only the student details the exam needs. Name and email are optional.

Webhooks

Register an HTTPS endpoint with Upskool and UTT will POST events to it, so your platform reacts to licence changes in seconds instead of waiting for the next check.

EventSent when
licence.activatedUpskool activates the licence
licence.suspendedUpskool suspends the licence
licence.reactivatedA suspended licence is restored
licence.renewedThe expiry date is extended
licence.expiring30, 7 and 1 days before expiry
licence.expiredThe expiry date passes
licence.revokedThe licence is terminated
attempt.submittedA student submits, or time runs out
result.publishedResults for an exam are ready
export.readyA data export can be downloaded
Example payload
{
  "id": "evt_01J0B7Q2",
  "type": "licence.suspended",
  "created_at": "2026-12-07T14:02:51+05:30",
  "licence_id": "UTT-LIC-000001",
  "data": {
    "status": "suspended",
    "previous_status": "active",
    "running_attempts_allowed_to_finish": true
  }
}

Check the webhook signature

Each delivery has a header X-UTT-Webhook-Signature: t=1796632371,v1=5f2b.... Compute an HMAC-SHA256 of {t}.{raw body} with your webhook secret, compare it with v1 in constant time, and reject deliveries more than 5 minutes old.

Node.js
import crypto from 'node:crypto';

export function isGenuineWebhook(rawBody, header) {
  const parts = Object.fromEntries(header.split(',').map(p => p.split('=')));
  const age = Math.abs(Date.now() / 1000 - Number(parts.t));
  if (age > 300) return false;
  const expected = crypto
    .createHmac('sha256', process.env.UTT_WEBHOOK_SECRET)
    .update(`${parts.t}.${rawBody}`)
    .digest('hex');
  const a = Buffer.from(expected);
  const b = Buffer.from(parts.v1 || '');
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}
  • Reply with any 2xx status within 10 seconds. Do slow work after replying.
  • Failed deliveries are retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 12 hours.
  • The same event can arrive more than once. Use id to ignore duplicates.
  • For licence.* events, call verify straight away instead of trusting the webhook body.

Errors

Errors use standard HTTP status codes and a JSON body. Quote request_id when you contact support.

403 Forbidden
{
  "error": {
    "code": "domain_not_authorised",
    "message": "exams.other-site.in is not an authorised domain for UTT-LIC-000001.",
    "request_id": "req_9f81c2d4"
  }
}
HTTPCodeMeaning and fix
400invalid_requestA field is missing or has the wrong type. The message names the field.
401invalid_credentialsThe bearer token is wrong or was rotated. Check your server secrets.
401invalid_signatureThe HMAC doesn't match. Sign the exact raw body you send, with no reformatting.
401clock_skewYour timestamp is more than 300 seconds off. Sync your server clock.
403domain_not_authorisedThe domain isn't on the licence. Ask Upskool to register it.
403licence_restrictedThe licence doesn't allow this action in its current status.
404licence_not_foundThe licence key doesn't exist. Check for a test key used against production.
404not_foundThe exam, question, attempt or export ID doesn't exist for your installation.
409installation_mismatchThe licence key belongs to a different installation.
409nonce_reusedThis nonce was already used. Generate a new one per request.
409idempotency_conflictThe same idempotency key was sent with a different body.
422validation_failedThe request is well formed but breaks a rule, such as an exam ending before it starts.
429rate_limitedToo many requests. Wait for the number of seconds in Retry-After.
500internal_errorSomething failed on Upskool's side. Retry with backoff.
503service_unavailableTemporary outage or maintenance. Retry, then fall back to your grace period.

Rate limits

Endpoint groupLimit per installation
/licence/verify60 requests a minute
/licence/status120 requests a minute
/sessions/launch1,200 requests a minute
Other exam engine endpoints600 requests a minute

Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. If you expect a large exam, for example thousands of students starting at 10:00, tell us a week ahead and we will raise the launch limit for that window.

Idempotency

Send an Idempotency-Key header (any unique string, such as a UUID) with POST requests. If the network drops and you retry with the same key and body, UTT returns the original result instead of creating a second exam or a second attempt. Keys are kept for 24 hours.

Sandbox and test keys

The sandbox at https://sandbox.api.upskool.in/v1 behaves like production with test data. Use your utt_test_ credentials there. These licence keys return a fixed status so you can test every branch of your code:

Test licence keyResult
utt_test_activeactive with all permissions
utt_test_pendingpending
utt_test_suspendedsuspended
utt_test_expiredexpired
utt_test_revokedrevoked
utt_test_outage503 service_unavailable, for testing your grace period
utt_test_slowResponds after 8 seconds, for testing your timeouts

Versioning

Changes that don't break existing code, such as new fields, new endpoints and new event types, are added to v1 without notice. Write your parser to ignore fields it doesn't know. Breaking changes ship under a new path, /v2, and v1 keeps working through an overlap period that we announce by email to your technical contact.

Go-live checklist

  • All UTT credentials are stored as server-side secrets, outside the code repository
  • Every licensed route sits behind the permission middleware
  • Enforcement reads the verified claims from signature, never the plain fields
  • The JWKS is cached and refetched on an unknown kid
  • The grace period logic has been tested with utt_test_outage
  • A suspended licence lets running attempts finish (tested with utt_test_suspended)
  • The webhook endpoint checks signatures and ignores duplicate event IDs
  • Server time is synced with NTP
  • Timeouts are set on every call to UTT (5 seconds is a good default)
  • Admins see a clear message when a feature is restricted, with the reason

Glossary

Terms used on this page and in your integration documents.

TermMeaning
APIApplication programming interface. The set of URLs your server calls to talk to UTT.
RESTA style of API where each URL is a resource and HTTP methods (GET, POST, PATCH) act on it.
EndpointOne URL and method in the API, such as POST /v1/licence/verify.
JSONThe text format used for request and response bodies.
HTTPS / TLSEncrypted HTTP. Nobody between your server and ours can read or change the traffic.
Bearer tokenA secret sent in the Authorization header to identify your installation.
HMAC-SHA256A way of signing a message with a shared secret, so the receiver can tell it wasn't altered.
Ed25519 / EdDSAThe public-key signature algorithm Upskool uses to sign licence responses.
JWTJSON Web Token. A signed, compact package of claims. The signature field is one.
JWKSJSON Web Key Set. The published list of public keys used to check JWT signatures.
ClaimsThe data inside a JWT, such as status, expiry and permissions.
NonceA random value used once, so a recorded request can't be replayed.
Clock skewThe difference between your server's clock and ours.
Idempotency keyA unique value that makes retrying a request safe.
WebhookAn HTTP request UTT sends to your server when something happens.
MiddlewareCode that runs before your route handler, used here to check permissions.
Rate limitThe maximum number of requests allowed in a time window.
Grace periodThe time your platform keeps working on its last verified licence if the licence server can't be reached.
InstallationOne deployment of UTT on one client platform, with its own credentials.
SandboxA test copy of the API with test data and test keys.
SSOSingle sign-on. Students use their existing login on your platform to enter UTT exams.
RBACRole-based access control. What a user can do depends on their role, such as admin, teacher or student.
MFAMulti-factor authentication. A login that needs a second proof, such as a one-time code.
CBTComputer-based test. An exam taken on a computer or phone instead of on paper.
LMSLearning management system. Software for courses, lessons and assignments.
ERPEnterprise resource planning. For schools, the system that runs admissions, fees, attendance and the office.
White-labelRunning software under your own brand, with no visible Upskool branding.
Data Fiduciary / Data ProcessorTerms from India's DPDP Act, 2023. The fiduciary decides why and how personal data is processed. The processor handles it on the fiduciary's behalf.
ISO 8601The date and time format used in the API, for example 2026-12-07T10:42:18+05:30.
Unix timeSeconds since 1 January 1970 UTC. Used in signing timestamps.

Getting help

Email contact@upskool.in with your licence ID, the endpoint, the request_id from the error and the time it happened. Never include your installation token, signing secret or webhook secret in an email.