Courses
Replace the course list
PUT
/registries/{registryId}/coursesComing soonSet the full course list. Codes are unique and upper-cased. Removing a course also removes students’ registrations for it; exams already scheduled stay.
curl -X PUT "https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/courses" \ -H "Authorization: Bearer $FACETRUST_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "courses": [ { "code": "CSC 301", "title": "Data Structures", "units": 3 }, { "code": "MTH 201", "title": "Linear Algebra", "units": 2 }, { "code": "GST 111", "title": "Use of English", "units": 2 } ] }'
// Node.js 18+, ES module (built-in fetch and FormData) const res = await fetch('https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/courses', { method: 'PUT', headers: { Authorization: `Bearer ${process.env.FACETRUST_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "courses": [ { "code": "CSC 301", "title": "Data Structures", "units": 3 }, { "code": "MTH 201", "title": "Linear Algebra", "units": 2 }, { "code": "GST 111", "title": "Use of English", "units": 2 } ] }), }); const data = await res.json();
import os, uuid, requests res = requests.put( "https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/courses", headers={"Authorization": f"Bearer {os.environ['FACETRUST_API_KEY']}"}, json={ "courses": [ { "code": "CSC 301", "title": "Data Structures", "units": 3 }, { "code": "MTH 201", "title": "Linear Algebra", "units": 2 }, { "code": "GST 111", "title": "Use of English", "units": 2 } ] }, timeout=15, ) res.raise_for_status() data = res.json()
200 · application/json
{
"entries": [
{
"code": "CSC 301",
"title": "Data Structures",
"units": 3
},
{
"code": "MTH 201",
"title": "Linear Algebra",
"units": 2
},
{
"code": "GST 111",
"title": "Use of English",
"units": 2
}
]
}Use it for
Syncing the course catalogue from your academic system each session.
School accounts only
This endpoint is available to School accounts. Calls from other account types return
403 account_type_forbidden.Not live yet
Documented ahead of release so you can plan your integration. School course lists and student registrations. Exam eligibility follows them.
Headers#
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <key>, a key with the registry:write scope. See Authentication. |
Content-Type | Yes | application/json |
Path parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
registryId | uuid | Yes | Your registry. Shown on this page and in the console under Registry. |
Body parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
courses | Course[] | Yes | { code, title, units } for each course. units is optional (0-12). |
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. |
not_found | 404 | No such resource in your institution. |
validation_failed | 422 | The request body failed validation; see fields for per-field errors. |