Registries & schema
Create a registry
POST
/registriesCreate another registry and name it anything: a new intake, a branch, a department, an event day. Its kind is always your account’s. Names must be unique in your institution.
curl -X POST "https://api.facetrustai.com/v1/registries" \ -H "Authorization: Bearer $FACETRUST_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "name": "Postgraduate School 2027", "primaryKeyLabel": "Matric Number" }'
// Node.js 18+, ES module (built-in fetch and FormData) const res = await fetch('https://api.facetrustai.com/v1/registries', { method: 'POST', headers: { Authorization: `Bearer ${process.env.FACETRUST_API_KEY}`, 'Idempotency-Key': crypto.randomUUID(), 'Content-Type': 'application/json', }, body: JSON.stringify({ "name": "Postgraduate School 2027", "primaryKeyLabel": "Matric Number" }), }); const data = await res.json();
import os, uuid, requests res = requests.post( "https://api.facetrustai.com/v1/registries", headers={"Authorization": f"Bearer {os.environ['FACETRUST_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())}, json={ "name": "Postgraduate School 2027", "primaryKeyLabel": "Matric Number" }, timeout=15, ) res.raise_for_status() data = res.json()
curl -X POST "https://api.facetrustai.com/v1/registries" \ -H "Authorization: Bearer $FACETRUST_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "name": "Abuja Office", "primaryKeyLabel": "Employee ID" }'
// Node.js 18+, ES module (built-in fetch and FormData) const res = await fetch('https://api.facetrustai.com/v1/registries', { method: 'POST', headers: { Authorization: `Bearer ${process.env.FACETRUST_API_KEY}`, 'Idempotency-Key': crypto.randomUUID(), 'Content-Type': 'application/json', }, body: JSON.stringify({ "name": "Abuja Office", "primaryKeyLabel": "Employee ID" }), }); const data = await res.json();
import os, uuid, requests res = requests.post( "https://api.facetrustai.com/v1/registries", headers={"Authorization": f"Bearer {os.environ['FACETRUST_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())}, json={ "name": "Abuja Office", "primaryKeyLabel": "Employee ID" }, timeout=15, ) res.raise_for_status() data = res.json()
curl -X POST "https://api.facetrustai.com/v1/registries" \ -H "Authorization: Bearer $FACETRUST_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "name": "Builders Summit, Day 3", "primaryKeyLabel": "Ticket ID" }'
// Node.js 18+, ES module (built-in fetch and FormData) const res = await fetch('https://api.facetrustai.com/v1/registries', { method: 'POST', headers: { Authorization: `Bearer ${process.env.FACETRUST_API_KEY}`, 'Idempotency-Key': crypto.randomUUID(), 'Content-Type': 'application/json', }, body: JSON.stringify({ "name": "Builders Summit, Day 3", "primaryKeyLabel": "Ticket ID" }), }); const data = await res.json();
import os, uuid, requests res = requests.post( "https://api.facetrustai.com/v1/registries", headers={"Authorization": f"Bearer {os.environ['FACETRUST_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())}, json={ "name": "Builders Summit, Day 3", "primaryKeyLabel": "Ticket ID" }, timeout=15, ) res.raise_for_status() data = res.json()
200 · application/json
{
"id": "reg_9d1e",
"name": "Postgraduate School 2027",
"kind": "education",
"status": "active",
"createdAt": "2026-11-19T09:12:40Z"
}200 · application/json
{
"id": "reg_9d1e",
"name": "Abuja Office",
"kind": "corporate",
"status": "active",
"createdAt": "2026-11-19T09:12:40Z"
}200 · application/json
{
"id": "reg_9d1e",
"name": "Builders Summit, Day 3",
"kind": "events",
"status": "active",
"createdAt": "2026-11-19T09:12:40Z"
}Use it for
Systems that open a new intake, site or event and push its people.
Headers#
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <key>, a key with the registry: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 |
Body parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Any name, unique in your institution. |
primaryKeyLabel | string | No | Defaults to your account type’s template (Matric Number, Employee ID, Ticket ID). |
fields | RegistryField[] | No | Defaults to the template for your account type. |
courses | Course[] | No | School accounts: the course list students can register for. |
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. |
validation_failed | 422 | The request body failed validation; see fields for per-field errors. |