Exams
Import a timetable
POST
/registries/{registryId}/exams/importCreate many exam sessions from a CSV with columns course_code, course_title, date (YYYY-MM-DD), start and end (HH:MM, your institution’s time zone) and venue. Header spellings are forgiving ("Course code", "CODE"…). Valid rows are created; invalid ones come back in errors with their row number.
curl -X POST "https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/exams/import" \ -H "Authorization: Bearer $FACETRUST_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -F file=@people.csv
// Node.js 18+, ES module (built-in fetch and FormData) import { readFile } from 'node:fs/promises'; const form = new FormData(); form.append('file', new Blob([await readFile('people.csv')]), 'people.csv'); const res = await fetch('https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/exams/import', { method: 'POST', headers: { Authorization: `Bearer ${process.env.FACETRUST_API_KEY}`, 'Idempotency-Key': crypto.randomUUID(), }, body: form, }); const data = await res.json();
import os, uuid, requests res = requests.post( "https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/exams/import", headers={"Authorization": f"Bearer {os.environ['FACETRUST_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())}, files={"file": open("people.csv", "rb")}, timeout=15, ) res.raise_for_status() data = res.json()
200 · application/json
{
"created": 24,
"errors": [
{
"row": 7,
"reason": "Invalid date \"2026-13-02\" (use YYYY-MM-DD)"
}
]
}Use it for
Load a whole exam timetable at the start of the exam period.
School accounts only
This endpoint is available to School accounts. Calls from other account types return
403 account_type_forbidden.Headers#
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <key>, a key with the exams:write scope. See Authentication. |
Idempotency-Key | No | A UUID you generate. Retrying with the same key returns the original result. See Conventions. |
Content-Type | Yes | multipart/form-data |
Path parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
registryId | uuid | Yes | Your registry. Shown on this page and in the console under Registry. |
Form fields (multipart)#
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | Yes | CSV with a header row. |
Response#
Returns 200 with the body shown in the response example. Examples follow the account type selected at the top of the page.
Shown above, with the request.
Errors#
| Code | HTTP | Meaning |
|---|---|---|
unauthorized | 401 | Missing, malformed, revoked or expired API key. |
forbidden_scope | 403 | The key doesn’t have the scope this endpoint needs. |
account_type_forbidden | 403 | This endpoint isn’t available to your account type. |
module_disabled | 403 | The module is switched off for your account. Contact FaceTrust. |
ip_not_allowed | 403 | The request came from an IP outside the key’s allowlist. |
rate_limited | 429 | Too many requests. Wait for Retry-After seconds. |
invalid_file | 422 | The file couldn’t be read, is the wrong type or is too large. |