Qwiktest API reference
Base URL https://open.qwiktest.in. OpenAPI: https://open.qwiktest.in/v1/openapi.json. Plain text for AI assistants: /llms-api.txt.
Introduction
The Qwiktest API lets your website sell or assign tests and run them on Qwiktest. Your server makes a launch link, the student opens it and lands in the test already signed in (no second login), and when they finish we post the result to your server.
Base URL: https://open.qwiktest.in. Every request and reply is JSON over HTTPS. Version 2026-11-24; the full OpenAPI file is at https://open.qwiktest.in/v1/openapi.json.
- Show your tests: GET /v1/tests lists the tests your site can sell or assign.
- Sign the student in: When they click Start, POST /v1/launches and open launch_url in a new tab.
- Get the result: attempt.submitted arrives on your webhook, or GET /v1/attempts: score, sections, rank.
Quick start (5 minutes)
1. On app.qwiktest.in open Developers → API keys and create a sandbox key (qt_test_…). Sandbox keys only see two sample tests, so nothing real is touched. Put it in your server's environment as QWIKTEST_KEY.
2. Check the key: GET /v1/me answers with the key's workspace, permissions and limits.
3. List the sample tests with GET /v1/tests and pick a test_id.
4. Sign a student in: POST /v1/launches with your id for the student (external_user_id), their name and email, and the test_id. Open launch_url in a new tab: the student lands in the test, already signed in.
5. Get the result: add a webhook (Developers → Webhooks) and receive attempt.submitted when they finish, or call GET /v1/attempts?external_user_id=….
When it works with the sandbox key, create a live key (Pro plan and above) and switch QWIKTEST_KEY.
cURL
# 2. Check the key
curl https://open.qwiktest.in/v1/me -H "Authorization: Bearer $QWIKTEST_KEY"
# 3. Pick a test
curl https://open.qwiktest.in/v1/tests -H "Authorization: Bearer $QWIKTEST_KEY"
# 4. Sign a student in (open launch_url in a new tab)
curl -X POST https://open.qwiktest.in/v1/launches \
-H "Authorization: Bearer $QWIKTEST_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: first-try-1" \
-d '{"external_user_id":"student-42","name":"Asha Verma","email":"asha@example.com","test_id":"tst_YOUR_TEST_ID"}'
# 5. Read the result
curl "https://open.qwiktest.in/v1/attempts?external_user_id=student-42" -H "Authorization: Bearer $QWIKTEST_KEY"Authentication
Send your key in the Authorization header: Authorization: Bearer qt_live_… (live) or qt_test_… (sandbox). Keys are made by the workspace owner or admins on the Developers page and shown once.
Sandbox keys work on every plan and see only the sandbox sample tests, so you can build without touching real exams. Live keys need the Pro plan or above.
Keys belong on your server only. Never put a key in a browser, mobile app or public repository. A key can expire, be limited to IP addresses, and be rotated with an overlap so the old one keeps working while you switch.
Each key carries scopes. An endpoint refuses a key without its scope (403 FORBIDDEN_SCOPE).
| Scope | Allows |
|---|---|
| tests:read | Read tests (names, sections, marks, duration) |
| launch:write | Create launch links that sign students in |
| attempts:read | Read attempts and results |
| results:answers | Include chosen and correct answers in results |
Signing students in
POST /v1/launches returns a launch_url that works once and expires after 120 seconds (you may set 30–300). Make it when the student clicks, then open it straight away. Never email or store it.
external_user_id is your id for the student. The same external_user_id is always the same Qwiktest student, so their attempts and rank stay together even if their email changes. Results are sent back with it.
return_url (optional) is where the student's Back button goes after the test. It must be https on one of your allowed domains (Developers → Allowed domains).
Live keys can launch any published test, or only the tests the owner chose (Developers → Tests open to launch).
Errors
Errors always look like { "error": { "code", "message", "request_id" } }. Switch on code; the message may change. Send request_id to support@qwiktest.in when you need help.
| Code | Status | Meaning |
|---|---|---|
| INVALID_REQUEST | 400 | The request is not valid. Check the fields against the docs. |
| UNKNOWN_FIELD | 400 | The request has a field this endpoint does not accept. |
| RETURN_URL_NOT_ALLOWED | 400 | return_url must be an https address on one of your allowed domains (Developers → Allowed domains). |
| UNAUTHORIZED | 401 | Missing or invalid API key. |
| PLAN_REQUIRED | 402 | Live API access needs the Pro plan or above. Sandbox keys work on every plan. |
| FORBIDDEN_SCOPE | 403 | This API key does not have the scope this endpoint needs. |
| IP_NOT_ALLOWED | 403 | This API key cannot be used from this IP address. |
| API_DISABLED | 403 | API access is paused for this account. Contact support@qwiktest.in. |
| LIVE_KEY_IN_BROWSER | 403 | Live keys work only from your server. Use a sandbox key (qt_test_…) in the docs playground. |
| LAUNCH_NOT_ALLOWED | 403 | This test is not open to launch from the API. Turn it on in Developers → Tests open to launch. |
| CANDIDATE_REMOVED | 403 | The organiser removed this student from the test. |
| NOT_FOUND | 404 | Not found. Check the path, and use ids from this key's own workspace: list them with GET /v1/tests using the same key (sandbox keys see only sample tests). |
| METHOD_NOT_ALLOWED | 405 | This method is not allowed on this endpoint. |
| IDEMPOTENCY_CONFLICT | 409 | This Idempotency-Key was already used with a different request. |
| IDEMPOTENCY_IN_PROGRESS | 409 | A request with this Idempotency-Key is still being processed. |
| CANDIDATE_CONFLICT | 409 | This email already belongs to a student with a different external_user_id. |
| TEST_NOT_AVAILABLE | 409 | This test cannot be started now: it is not published, has closed, or runs only in exam centres. |
| PAYLOAD_TOO_LARGE | 413 | The request body is too large. |
| UNSUPPORTED_MEDIA_TYPE | 415 | Send JSON with Content-Type: application/json. |
| RATE_LIMITED | 429 | Too many requests. Wait for Retry-After, or request higher limits. |
| MONTHLY_CAP_REACHED | 429 | This account has used its monthly API requests. Request a higher limit, or wait for the next cycle. |
| INTERNAL | 500 | Something went wrong on our side. Retry with the same Idempotency-Key. |
| UNAVAILABLE | 503 | The API is busy. Retry after a short wait. |
Rate limits
Limits are per account: requests per minute, launch links per minute, and requests per 30-day billing cycle. Every reply carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset; a 429 also carries Retry-After (seconds).
Attempt reads and launches are never stopped by the monthly cap, so a student can always start and finish. Big exam coming? Developers → Request higher limits.
GET /v1/me shows the limits of the key you are using.
Idempotency
Send an Idempotency-Key header (8–100 letters, digits, _ . : -) on POST requests. Retrying with the same key and the same body returns the first reply instead of doing the work twice. The same key with a different body is 409 IDEMPOTENCY_CONFLICT. Keys are kept for 24 hours.
Pagination and ids
Lists return { data, next_cursor }. Pass next_cursor as cursor to get the next page; null means you have everything.
Ids are opaque strings with a prefix: tst_ (test), att_ (attempt), cnd_ (student), lch_ (launch), evt_ (webhook event), key_ (API key). Store them as text; never parse them.
Webhooks
Add an https address on one of your allowed domains on the Developers page, choose Live or Sandbox and the events. We send a POST with a JSON body for each event, only for students your API signed in, never their name or email.
Answer with any 2xx within 10 seconds. Otherwise we try again after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, then mark it failed. Ten events in a row that end failed pause the address and email the owner; Resume it on the Developers page. Every delivery is in the delivery log, with Resend.
The body is { id, type, created, mode, data }. data is the attempt (the same object GET /v1/attempts/{attempt_id} returns). Chosen and correct answers are included only if you ticked that for the address. A test event has type "ping" and data null.
Deliveries can arrive more than once or out of order: dedupe by id, and keep the newest data for an attempt_id (attempt.rescored follows an answer key fix).
| Event | When |
|---|---|
| attempt.started | A student started a test |
| attempt.submitted | A student finished (pressed Submit, time ran out, or closed by the server) |
| attempt.rescored | Marks changed after an answer key fix |
Verifying webhook signatures
Every delivery carries Qwiktest-Signature: t=<unix seconds>,v1=<signature>. The signature is the hex HMAC-SHA256 of "<t>.<raw body>" with your address's signing secret (whsec_…). Compute it over the raw body before parsing JSON, compare in constant time, and reject timestamps more than 5 minutes old.
After you roll the secret we sign with both the new and the old secret for 24 hours (two v1= values), so accept the delivery if any v1 matches.
Node.js
import crypto from "node:crypto";
// Use the RAW body (before JSON.parse), e.g. express.raw({ type: "application/json" }).
export function verifyQwiktest(rawBody, header, secret) {
const fields = header.split(",").map((part) => part.trim().split("="));
const t = Number(fields.find(([k]) => k === "t")?.[1]);
if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false; // older than 5 minutes
const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest();
return fields.some(([k, v]) => {
if (k !== "v1" || !v) return false;
const given = Buffer.from(v, "hex");
return given.length === expected.length && crypto.timingSafeEqual(given, expected);
});
}
app.post("/qwiktest/webhook", express.raw({ type: "application/json" }), (req, res) => {
if (!verifyQwiktest(req.body.toString("utf8"), req.get("Qwiktest-Signature") ?? "", process.env.QWIKTEST_WEBHOOK_SECRET)) {
return res.status(400).end();
}
const event = JSON.parse(req.body);
// Dedupe by event.id, then save event.data (the attempt) against event.data.external_user_id.
res.status(200).end();
});
PHP
<?php
function verify_qwiktest(string $rawBody, string $header, string $secret): bool {
$t = null; $sigs = [];
foreach (explode(',', $header) as $part) {
[$k, $v] = array_pad(explode('=', trim($part), 2), 2, '');
if ($k === 't') $t = (int) $v;
if ($k === 'v1') $sigs[] = $v;
}
if (!$t || abs(time() - $t) > 300) return false;
$expected = hash_hmac('sha256', $t . '.' . $rawBody, $secret);
foreach ($sigs as $sig) if (hash_equals($expected, $sig)) return true;
return false;
}
$raw = file_get_contents('php://input');
if (!verify_qwiktest($raw, $_SERVER['HTTP_QWIKTEST_SIGNATURE'] ?? '', getenv('QWIKTEST_WEBHOOK_SECRET'))) {
http_response_code(400); exit;
}
$event = json_decode($raw, true);
http_response_code(200);
Python
import hashlib, hmac, time
def verify_qwiktest(raw_body: bytes, header: str, secret: str) -> bool:
fields = [p.strip().split("=", 1) for p in header.split(",") if "=" in p]
t = next((int(v) for k, v in fields if k == "t"), 0)
if not t or abs(time.time() - t) > 300:
return False
expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
return any(hmac.compare_digest(expected, v) for k, v in fields if k == "v1")
# Flask
@app.post("/qwiktest/webhook")
def qwiktest_webhook():
if not verify_qwiktest(request.get_data(), request.headers.get("Qwiktest-Signature", ""), os.environ["QWIKTEST_WEBHOOK_SECRET"]):
return "", 400
event = request.get_json()
return "", 200Basics
GET /v1/health: Is the API up
No key needed.
Scope: none
curl https://open.qwiktest.in/v1/health
Response 200
{
"status": "ok"
}GET /v1/me: The key you are using, its workspace, scopes and limits
Any scope may call it. Use it to check a key works.
Scope: none · Errors: 401, 402, 403, 429
curl https://open.qwiktest.in/v1/me \
-H "Authorization: Bearer $QWIKTEST_KEY"
Response 200
{
"key": {
"id": "key_5m7p9r1t3v5x7z9b1d3f5h7k9m1p3r5t",
"key_id": "a1b2c3d4e5f6g7h8",
"name": "Production server",
"mode": "live",
"scopes": [
"tests:read",
"launch:write",
"attempts:read"
],
"expires_at": "2027-11-24T00:00:00.000Z"
},
"workspace": {
"name": "Daily Mock Test"
},
"limits": {
"requests_per_minute": 300,
"launches_per_minute": 120,
"requests_monthly": 200000
}
}Tests
GET /v1/tests: List tests (newest change first)
Scope: tests:read · Errors: 400, 401, 402, 403, 429
status(query, draft | published | archived): Only tests in this stateupdated_since(query, date-time): Only tests changed at or after this time, e.g. 2026-11-30T00:00:00Zlimit(query, integer): 1–100, default 50cursor(query, string): next_cursor from the previous page
curl https://open.qwiktest.in/v1/tests?status=published&limit=20 \
-H "Authorization: Bearer $QWIKTEST_KEY"
Response 200
{
"data": [
{
"test_id": "tst_6k2m9q4x8b1n7c3v5z0w2r4t6y8u0p1s",
"name": "SSC CGL Full Mock 11",
"status": "published",
"sandbox": false,
"duration_minutes": 60,
"total_questions": 100,
"updated_at": "2026-11-24T09:12:44.000Z"
}
],
"next_cursor": "20"
}GET /v1/tests/{test_id}: One test: name, duration, sections, marks, negative marking
Scope: tests:read · Errors: 401, 402, 403, 404, 429
test_id(path, string, required): tst_… from GET /v1/tests
curl https://open.qwiktest.in/v1/tests/tst_YOUR_TEST_ID \
-H "Authorization: Bearer $QWIKTEST_KEY"
Response 200
{
"test_id": "tst_6k2m9q4x8b1n7c3v5z0w2r4t6y8u0p1s",
"name": "SSC CGL Full Mock 11",
"status": "published",
"sandbox": false,
"duration_minutes": 60,
"timer": "whole_test",
"total_questions": 100,
"max_marks": 200,
"negative_marking": 0.5,
"negative_marking_varies": false,
"attempts_allowed": 1,
"starts_at": "2026-11-30T04:30:00.000Z",
"ends_at": "2026-11-30T12:30:00.000Z",
"sections": [
{
"name": "General Intelligence",
"questions": 25,
"counted_questions": 25,
"marks": 50,
"rule": "all",
"answer_limit": null
},
{
"name": "General Awareness",
"questions": 25,
"counted_questions": 25,
"marks": 50,
"rule": "all",
"answer_limit": null
},
{
"name": "Quantitative Aptitude",
"questions": 25,
"counted_questions": 25,
"marks": 50,
"rule": "all",
"answer_limit": null
},
{
"name": "English Comprehension",
"questions": 25,
"counted_questions": 25,
"marks": 50,
"rule": "all",
"answer_limit": null
}
],
"updated_at": "2026-11-24T09:12:44.000Z"
}Launches
POST /v1/launches: Create a launch link that signs a student in
Send an Idempotency-Key so a retry never makes two links. Open launch_url in a new tab within expires_at. The student lands in the test's lobby, already signed in. The same external_user_id is always the same student. return_url must be https on one of your allowed domains. Live keys can launch any published test, or only the tests the owner chose on the Developers page; sandbox keys only sandbox tests.
Scope: launch:write · Errors: 400, 401, 402, 403, 404, 409, 429
Idempotency-Key(header, string): Any unique value, 8–100 letters, digits or _ . : - (for example your order id). A retry with the same key and body gets the same link back for 24 hoursexternal_user_id(body, string, required): Your id for the student (1–128 of A–Z a–z 0–9 _ . : @ -). Same id = same student.name(body, string, required): Shown in the test and on the teacher's results.email(body, string, required): The student's email.phone(body, string): Optional, up to 20 characters.test_id(body, string, required): tst_… from GET /v1/tests.return_url(body, string): https on an allowed domain; the student's way back after the test.external_ref(body, string): Your reference (order, booking…). Sent back on the attempt.expires_in_seconds(body, integer): 30–300, default 120.
curl -X POST https://open.qwiktest.in/v1/launches \
-H "Authorization: Bearer $QWIKTEST_KEY" \
-H "Idempotency-Key: dmt_att_8f2c1" \
-H "Content-Type: application/json" \
-d '{
"external_user_id": "6b015d67a840e7f7a58b885b",
"name": "Rahul Kumar",
"email": "rahul@example.com",
"test_id": "tst_YOUR_TEST_ID",
"return_url": "https://dailymocktest.in/my/exams",
"external_ref": "dmt_att_8f2c1"
}'
Response 201
{
"launch_id": "lch_1a3c5e7g9j1l3n5p7r9t1v3x5z7b9d1f",
"launch_url": "https://dailymocktest.qwiktest.in/launch/9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f",
"expires_at": "2026-11-30T05:02:00.000Z",
"test_id": "tst_6k2m9q4x8b1n7c3v5z0w2r4t6y8u0p1s",
"candidate_id": "cnd_8d0f2g4h6j8k0m2n4p6q8r0s2t4v6w8x",
"external_ref": "dmt_att_8f2c1"
}GET /v1/launches/{launch_id}: Whether a launch link was used
Scope: launch:write · Errors: 401, 403, 404, 429
launch_id(path, string, required): lch_… from POST /v1/launches
curl https://open.qwiktest.in/v1/launches/lch_YOUR_LAUNCH_ID \
-H "Authorization: Bearer $QWIKTEST_KEY"
Response 200
{
"launch_id": "lch_1a3c5e7g9j1l3n5p7r9t1v3x5z7b9d1f",
"status": "used",
"test_id": "tst_6k2m9q4x8b1n7c3v5z0w2r4t6y8u0p1s",
"candidate_id": "cnd_8d0f2g4h6j8k0m2n4p6q8r0s2t4v6w8x",
"external_ref": "dmt_att_8f2c1",
"created_at": "2026-11-30T05:00:00.000Z",
"expires_at": "2026-11-30T05:02:00.000Z",
"used_at": "2026-11-30T05:00:03.000Z"
}Attempts
GET /v1/attempts: A student's finished attempts (newest first)
Only students your API signed in (by external_user_id). The same body as the attempt.submitted webhook. Chosen and correct answers only with the results:answers scope. Not counted against the monthly cap.
Scope: attempts:read · Errors: 400, 401, 403, 429
external_user_id(query, string, required): Your id for the student, as sent when launchingtest_id(query, string): Only attempts at this testsince(query, date-time): Submitted at or after this timelimit(query, integer): 1–100, default 20cursor(query, string): next_cursor from the previous page
curl https://open.qwiktest.in/v1/attempts?external_user_id=6b015d67a840e7f7a58b885b&test_id=tst_YOUR_TEST_ID \
-H "Authorization: Bearer $QWIKTEST_KEY"
Response 200
{
"data": [
{
"attempt_id": "att_3h5j7k9m1n3p5q7r9s1t3v5w7x9y1z2a",
"attempt_number": 1,
"status": "submitted",
"external_user_id": "6b015d67a840e7f7a58b885b",
"external_ref": "dmt_att_8f2c1",
"candidate_id": "cnd_8d0f2g4h6j8k0m2n4p6q8r0s2t4v6w8x",
"test_id": "tst_6k2m9q4x8b1n7c3v5z0w2r4t6y8u0p1s",
"started_at": "2026-11-30T05:00:04.000Z",
"submitted_at": "2026-11-30T05:58:41.000Z",
"submit_reason": "manual",
"time_used_seconds": 3517,
"score": 142.5,
"max_score": 200,
"correct": 76,
"wrong": 15,
"skipped": 9,
"sections": [
{
"name": "General Intelligence",
"score": 41,
"max": 50,
"correct": 21,
"wrong": 2,
"skipped": 2,
"time_seconds": 880
},
{
"name": "General Awareness",
"score": 28.5,
"max": 50,
"correct": 15,
"wrong": 3,
"skipped": 7,
"time_seconds": 610
},
{
"name": "Quantitative Aptitude",
"score": 33,
"max": 50,
"correct": 18,
"wrong": 6,
"skipped": 1,
"time_seconds": 1290
},
{
"name": "English Comprehension",
"score": 40,
"max": 50,
"correct": 22,
"wrong": 4,
"skipped": 0,
"time_seconds": 737
}
],
"questions": [
{
"q_no": 1,
"section": "General Intelligence",
"topic": "Reasoning · Analogy",
"difficulty": "easy",
"result": "correct",
"marks": 2,
"time_seconds": 31
},
{
"q_no": 2,
"section": "General Intelligence",
"topic": "Reasoning · Coding-decoding",
"difficulty": "medium",
"result": "wrong",
"marks": -0.5,
"time_seconds": 74
}
],
"rank": 12,
"total_candidates": 2318,
"percentile": 99.5,
"rank_provisional": true,
"counted": true
}
],
"next_cursor": null
}GET /v1/attempts/{attempt_id}: One attempt: score, sections, questions, rank
Rank moves while students are still finishing (rank_provisional). Not counted against the monthly cap.
Scope: attempts:read · Errors: 401, 403, 404, 429
attempt_id(path, string, required): att_… from a webhook or GET /v1/attempts
curl https://open.qwiktest.in/v1/attempts/att_YOUR_ATTEMPT_ID \
-H "Authorization: Bearer $QWIKTEST_KEY"
Response 200
{
"attempt_id": "att_3h5j7k9m1n3p5q7r9s1t3v5w7x9y1z2a",
"attempt_number": 1,
"status": "submitted",
"external_user_id": "6b015d67a840e7f7a58b885b",
"external_ref": "dmt_att_8f2c1",
"candidate_id": "cnd_8d0f2g4h6j8k0m2n4p6q8r0s2t4v6w8x",
"test_id": "tst_6k2m9q4x8b1n7c3v5z0w2r4t6y8u0p1s",
"started_at": "2026-11-30T05:00:04.000Z",
"submitted_at": "2026-11-30T05:58:41.000Z",
"submit_reason": "manual",
"time_used_seconds": 3517,
"score": 142.5,
"max_score": 200,
"correct": 76,
"wrong": 15,
"skipped": 9,
"sections": [
{
"name": "General Intelligence",
"score": 41,
"max": 50,
"correct": 21,
"wrong": 2,
"skipped": 2,
"time_seconds": 880
},
{
"name": "General Awareness",
"score": 28.5,
"max": 50,
"correct": 15,
"wrong": 3,
"skipped": 7,
"time_seconds": 610
},
{
"name": "Quantitative Aptitude",
"score": 33,
"max": 50,
"correct": 18,
"wrong": 6,
"skipped": 1,
"time_seconds": 1290
},
{
"name": "English Comprehension",
"score": 40,
"max": 50,
"correct": 22,
"wrong": 4,
"skipped": 0,
"time_seconds": 737
}
],
"questions": [
{
"q_no": 1,
"section": "General Intelligence",
"topic": "Reasoning · Analogy",
"difficulty": "easy",
"result": "correct",
"marks": 2,
"time_seconds": 31
},
{
"q_no": 2,
"section": "General Intelligence",
"topic": "Reasoning · Coding-decoding",
"difficulty": "medium",
"result": "wrong",
"marks": -0.5,
"time_seconds": 74
}
],
"rank": 12,
"total_candidates": 2318,
"percentile": 99.5,
"rank_provisional": true,
"counted": true
}