Courses
Add course registrations
POST
/registries/{registryId}/course-registrationsComing soonRegister students for courses in bulk: rows of { primaryKey, courseCode }. Existing registrations stay. Rows with an unknown student or course are returned in errors.
curl -X POST "https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/course-registrations" \ -H "Authorization: Bearer $FACETRUST_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "rows": [ { "primaryKey": "CFU/24/1068", "courseCode": "CSC 301" }, { "primaryKey": "CFU/24/1068", "courseCode": "MTH 201" } ] }'
// 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/course-registrations', { method: 'POST', headers: { Authorization: `Bearer ${process.env.FACETRUST_API_KEY}`, 'Idempotency-Key': crypto.randomUUID(), 'Content-Type': 'application/json', }, body: JSON.stringify({ "rows": [ { "primaryKey": "CFU/24/1068", "courseCode": "CSC 301" }, { "primaryKey": "CFU/24/1068", "courseCode": "MTH 201" } ] }), }); const data = await res.json();
import os, uuid, requests res = requests.post( "https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/course-registrations", headers={"Authorization": f"Bearer {os.environ['FACETRUST_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())}, json={ "rows": [ { "primaryKey": "CFU/24/1068", "courseCode": "CSC 301" }, { "primaryKey": "CFU/24/1068", "courseCode": "MTH 201" } ] }, timeout=15, ) res.raise_for_status() data = res.json()
200 · application/json
{
"added": 2,
"errors": []
}Use it for
Pushing course registrations from your student portal.
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 profiles: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 | 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 |
|---|---|---|---|
rows | { primaryKey, courseCode }[] | Yes | Up to 10,000 rows per request. |
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. |
idempotency_conflict | 409 | This Idempotency-Key was used with a different request body. |