nFocus admin
The nFocus admin app is where nFocus support runs the platform for every client. Its endpoints are under /v1/admin.
Access
Every call needs an access token from Trax Keycloak for the admin app (audience trax-admin), with an admin realm role:
| Role | Can |
|---|---|
trax-support |
Everything |
trax-support-agent |
Read; changes answer 403 admin-write-required |
- The two apps' tokens don't mix. An organization site token is refused here (
401), and an admin token is refused under/v1/manage. Support who work inside one site use the organization site, where they act as Site Admin. - Staff without an admin role answer
403 admin-role-required. - Multi-factor sign-in: where the platform requires it, a token without the multi-factor
acranswers403 admin-mfa-required. Sign in again. - Every call is audited, reads included, and so is a refusal. A read whose audit row can't be written answers
503 audit-unavailableand returns no data.
The admin audit trail
GET https://api.nfocus.solutions/v1/admin/audit?pageSize=5 → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/audit?pageSize=5' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/audit?pageSize=5', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/audit?pageSize=5");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();The trail filters by actor (Keycloak subject or email), siteId, databaseId, and from and to (UTC dates). It
records who, when, the route, the answer's status and the ids the call was about, never request bodies.
Onboarding a portal's website
POST /v1/admin/sites gives a portal its website. siteAdminEmail gets the site's first Site Admin role (they sign in
to the organization site with their own Trax staff account).
- An nFocus site (
provider: "nfocus"): optionaldomains, a platform address and the organization's own. Each is checked at once (see Organization site, "An nFocus site's domains"): a custom domain stays pending until the organization publishes the TXT record itsownershipnames. A domain another site holds (its platform address or an active domain) answers409 domain-taken; a pending claim elsewhere doesn't. No Duda calls, and no site keys. An optionaltemplateKey(andtemplateVersion, else the newest available) starts the site's website draft on that template; without it, the Site Admin chooses one. The answer'snfocusTemplatenames the draft's template. - A Duda website (
provider: "duda"):templateIdand the domain fields, exactly asPOST /v1/manage/sites. The answer'sdudaholds the keys, shown once.
A portal that already has a website answers 409 site-already-provisioned: switch its provider instead.
Organization defaults. An nFocus site starts from the defaults of the nearest organization at or above its portal's organization that has some (see "Organization defaults" below): its template, unless the request names one, and its default branding. An organization's lock doesn't bind nFocus admins.
Onboarding a portal that already has a website
POST https://api.nfocus.solutions/v1/admin/sites → 409, problem details
curl
curl -s -X POST 'https://api.nfocus.solutions/v1/admin/sites' \
-H 'Authorization: Bearer your_admin_app_access_token' \
-H 'Content-Type: application/json' \
-d '{"clientToken": "harbor", "orgToken": "youth", "provider": "nfocus", "siteAdminEmail": "site.admin@example.test", "domains": ["www.harbor-youth.example.test"]}'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/sites', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
'Content-Type': 'application/json',
},
body: JSON.stringify({"clientToken": "harbor", "orgToken": "youth", "provider": "nfocus", "siteAdminEmail": "site.admin@example.test", "domains": ["www.harbor-youth.example.test"]}),
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.nfocus.solutions/v1/admin/sites");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
request.Content = new StringContent("""
{"clientToken": "harbor", "orgToken": "youth", "provider": "nfocus", "siteAdminEmail": "site.admin@example.test", "domains": ["www.harbor-youth.example.test"]}
""", System.Text.Encoding.UTF8, "application/json");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();A dry run. POST /v1/admin/sites?dryRun=true checks the same request and answers 200 with what it would do, writing
nothing but the audit row:
- the site it would use (
existingSiteIdfor a portal registered without a website yet); - the template, and whether it comes from the request or an organization's defaults (
templateFrom,defaultsFrom); brandingFromOrganization, each domain with its expected status andheldElsewhere;- the sign-in client and the invitations;
problems: every conflict the real call would refuse, as{ code, detail }. The real call answers the first.
Invalid input still answers 400. The dry run looks no DNS up: a custom domain is expected to be pending until its check.
What onboarding a portal's nFocus site would do, without doing it
POST https://api.nfocus.solutions/v1/admin/sites?dryRun=true → 200 OK, JSON
curl
curl -s -X POST 'https://api.nfocus.solutions/v1/admin/sites?dryRun=true' \
-H 'Authorization: Bearer your_admin_app_access_token' \
-H 'Content-Type: application/json' \
-d '{"clientToken": "riverbend", "orgToken": "north", "provider": "nfocus", "siteAdminEmail": "first.admin@example.test"}'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/sites?dryRun=true', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
'Content-Type': 'application/json',
},
body: JSON.stringify({"clientToken": "riverbend", "orgToken": "north", "provider": "nfocus", "siteAdminEmail": "first.admin@example.test"}),
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.nfocus.solutions/v1/admin/sites?dryRun=true");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
request.Content = new StringContent("""
{"clientToken": "riverbend", "orgToken": "north", "provider": "nfocus", "siteAdminEmail": "first.admin@example.test"}
""", System.Text.Encoding.UTF8, "application/json");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();Switching provider
PUT /v1/admin/sites/{siteId}/provider with confirm: true moves a site between Duda and an nFocus site. Its content
(profile, locations, staff, posts, announcements, alerts, images) stays either way.
- Duda → nFocus site: a Duda domain another site holds (its platform address or an active domain) stops the switch
(
409 domain-taken): remove it there first; a pending claim elsewhere doesn't. The Duda widget and collection keys stop working, pending Duda updates are cancelled, and the Duda domain becomes a pending nFocus domain: its DNS must move to the platform, and a custom one needs the site's TXT record. The Duda website itself is left in the Duda account untouched:dudaWebsiteUrlsays where, so support can unpublish it there. An optionaltemplateKey(andtemplateVersion) puts the website draft on that template, keeping any content from an earlier nFocus spell. - nFocus site → Duda: runs the Duda onboarding above (
templateIdand the domain fields), connecting the Duda website the site had before, if any. The site's domains stop serving.
Switching a site to the provider it already uses
PUT https://api.nfocus.solutions/v1/admin/sites/3f6b1c2e-8a4d-4e7b-9f10-5c2d7e8a9b01/provider → 409, problem details
curl
curl -s -X PUT 'https://api.nfocus.solutions/v1/admin/sites/3f6b1c2e-8a4d-4e7b-9f10-5c2d7e8a9b01/provider' \
-H 'Authorization: Bearer your_admin_app_access_token' \
-H 'Content-Type: application/json' \
-d '{"provider": "nfocus", "confirm": true}'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/sites/3f6b1c2e-8a4d-4e7b-9f10-5c2d7e8a9b01/provider', {
method: 'PUT',
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
'Content-Type': 'application/json',
},
body: JSON.stringify({"provider": "nfocus", "confirm": true}),
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Put, "https://api.nfocus.solutions/v1/admin/sites/3f6b1c2e-8a4d-4e7b-9f10-5c2d7e8a9b01/provider");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
request.Content = new StringContent("""
{"provider": "nfocus", "confirm": true}
""", System.Text.Encoding.UTF8, "application/json");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();Organization roles
An organization role gives an email a role (author, editor or siteAdmin) on every site at or below one Trax
organization of one client, including sites added later. A siteAdmin role on an organization is an Organization
Admin: besides every site below, it grants roles and report grants in its subtree, onboards nFocus sites there and sets
the organization's defaults (see Organization site, "Organization Admins"). nFocus grants the first one; Organization
Admins grant the rest below them.
- Grant:
POST /v1/admin/org-roleswithdatabaseId(a client the tenant directory lists),organizationId(one of that client's organizations),emailandrole. A second role for the same email and organization answers409 org-role-exists: remove the first. - List:
GET /v1/admin/org-roles, filtered bydatabaseId,organizationIdoremail.linkedturns true once the person signs in to the organization site.organizationNameis null while the client database can't be read. - Remove:
DELETE /v1/admin/org-roles/{orgRoleId}. Roles on the sites themselves stay.
Each call's audit row names the client and the organization, and the organization's own trail (Organization site, "Organization Admins") records the grant or removal too.
Organization roles at one client
GET https://api.nfocus.solutions/v1/admin/org-roles?databaseId=101&pageSize=5 → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/org-roles?databaseId=101&pageSize=5' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/org-roles?databaseId=101&pageSize=5', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/org-roles?databaseId=101&pageSize=5");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();Granting a role on an organization the client doesn't have
POST https://api.nfocus.solutions/v1/admin/org-roles → 400, problem details
curl
curl -s -X POST 'https://api.nfocus.solutions/v1/admin/org-roles' \
-H 'Authorization: Bearer your_admin_app_access_token' \
-H 'Content-Type: application/json' \
-d '{"databaseId": 101, "organizationId": 999999, "email": "regional.admin@example.test", "role": "editor"}'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/org-roles', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
'Content-Type': 'application/json',
},
body: JSON.stringify({"databaseId": 101, "organizationId": 999999, "email": "regional.admin@example.test", "role": "editor"}),
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.nfocus.solutions/v1/admin/org-roles");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
request.Content = new StringContent("""
{"databaseId": 101, "organizationId": 999999, "email": "regional.admin@example.test", "role": "editor"}
""", System.Text.Encoding.UTF8, "application/json");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();The new organization wizard
The admin app's wizard sets up OLR for an organization that already exists in the client's Trax database. It is made of the calls on this page:
- Pick the organization:
GET /v1/admin/clients/{databaseId}/organizationslists every organization of the client in tree order (a parent before its children, with each one'sdepth), with its OLR portal and website.- An organization whose
portalisnullhas no OLR portal yet. Set it up in staff Trax first, as today: this API never writes legacy configuration. It shows up here within five minutes. rolloutis the portal's rollout status.
- An organization whose
- Choose the provider, template and domains, and check them with a dry run (above).
- Set the organization's defaults for the sites below it, if it will have any (below).
- Onboard (
POST /v1/admin/sites), then give the first Organization Admin (POST /v1/admin/org-roles) or let onboarding'ssiteAdminEmailinvite the first Site Admin.
Creating Trax organizations or client databases stays with nFocus's provisioning.
A client's Trax organizations with their portals and websites (the new organization wizard)
GET https://api.nfocus.solutions/v1/admin/clients/101/organizations → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/clients/101/organizations' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/clients/101/organizations', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/clients/101/organizations");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();Organization defaults
An organization can hold defaults for new sites below it: a template (and version) and branding (colours for the template's slots and a heading font; a logo belongs to one site's media library), each of which can be locked for the subtree.
- Read:
GET /v1/admin/clients/{databaseId}/organizations/{orgId}/defaultsanswers the organization's own defaults (own, null without any), what it inherits from organizations above (inherited, with where each part comes from and where it is locked) and anETag. - Change:
PUT …/defaultsreplaces them (If-Matchonce it has some):templateKey,templateVersion,branding,templateLocked,brandingLocked. A part left out is cleared. Branding is checked against the template's contrast pairs, as a site's is.DELETE …/defaults(If-Match) removes them. - What they do: a new site starts from the nearest defaults at or above its organization; a locked part higher up
wins. A lock stops site roles and Organization Admins below the locking organization from switching the template or
changing the branding of an nFocus site (
403 template-locked,403 branding-locked). Defaults aren't copied into existing sites.
An organization's defaults for new sites, in the admin app
GET https://api.nfocus.solutions/v1/admin/clients/101/organizations/1/defaults → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/clients/101/organizations/1/defaults' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/clients/101/organizations/1/defaults', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/clients/101/organizations/1/defaults");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();Templates Organization Admins may use
GET /v1/admin/clients/{databaseId}/templates lists the templates the client's Organization Admins may onboard with
(templateKeys) and the available ones. An empty list means every available template. PUT …/templates with
{ "templateKeys": [...] } replaces the list. nFocus admins may onboard with any available template.
The templates a client's Organization Admins may onboard with
GET https://api.nfocus.solutions/v1/admin/clients/101/templates → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/clients/101/templates' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/clients/101/templates', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/clients/101/templates");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();Report grants
A report grant lets someone run reports, and nothing else, on one site or on a Trax organization and everything below it. Site Admins and Organization Admins have report access without one.
- Give:
POST /v1/admin/report-grantswithdatabaseId,emailand eithersiteId(a site of that client) ororganizationId. A second grant for the same email and scope answers409 report-grant-exists. - List:
GET /v1/admin/report-grants, filtered bydatabaseId,siteId,organizationIdoremail. A staff user's detail lists their grants too (reportGrants). - Remove:
DELETE /v1/admin/report-grants/{reportGrantId}.
Each grant and removal is also in the site's or the organization's audit trail.
Report grants at one client
GET https://api.nfocus.solutions/v1/admin/report-grants?databaseId=101&pageSize=5 → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/report-grants?databaseId=101&pageSize=5' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/report-grants?databaseId=101&pageSize=5', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/report-grants?databaseId=101&pageSize=5");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();Opening a site as support
POST /v1/admin/sites/{siteId}/support-session (the read role is enough) answers { url }: where the organization site
opens that site. Keycloak's single sign-on means no second password there. The call is in the admin audit, and the
site's own audit trail says "Opened by nFocus support". In the organization site, full support act as Site Admin on
every site and agents (trax-support-agent) read every site and change nothing (403 support-read-only); the site's
trail records each support person's first visit of the day.
Open a site in the organization site as nFocus support
POST https://api.nfocus.solutions/v1/admin/sites/7d3c2a10-5b4e-4f6a-9c1d-2e8f0a6b4c21/support-session → 200 OK, JSON
curl
curl -s -X POST 'https://api.nfocus.solutions/v1/admin/sites/7d3c2a10-5b4e-4f6a-9c1d-2e8f0a6b4c21/support-session' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/sites/7d3c2a10-5b4e-4f6a-9c1d-2e8f0a6b4c21/support-session', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.nfocus.solutions/v1/admin/sites/7d3c2a10-5b4e-4f6a-9c1d-2e8f0a6b4c21/support-session");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();Key contacts
Each client's key contacts for nFocus: kind (primary, billing, technical or other), name, title, email, phone
and notes. GET /v1/admin/clients/{databaseId}/contacts reads them; PUT …/contacts with { "contacts": [...] }
replaces the whole list (an empty list removes them all; up to 20). They name client staff, so they appear nowhere but
here: never in the organization site, a public answer or a log, and the audit row counts them without names.
A client's key contacts, for nFocus only
GET https://api.nfocus.solutions/v1/admin/clients/101/contacts → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/clients/101/contacts' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/clients/101/contacts', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/clients/101/contacts");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();Clients and portals
GET /v1/admin/clients lists the clients the tenant directory lists, and nothing else (in production the directory
is TraxMaster's client list). Each client shows how many registration portals its database has. A client whose
database can't be read just now shows availability: "unavailable" without failing the list.
The clients the tenant directory lists
GET https://api.nfocus.solutions/v1/admin/clients → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/clients' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/clients', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/clients");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();GET /v1/admin/clients/{databaseId} lists the client's portals: the organization, its rollout status and its website
(provider, template, domains, status), if it has one.
A client's portals: rollout status and website
GET https://api.nfocus.solutions/v1/admin/clients/101 → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/clients/101' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/clients/101', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/clients/101");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();Rollout status (legacy, pilot or live; a portal starts as legacy) is set with
PUT /v1/admin/clients/{databaseId}/portals/{orgId}/status. It is information only: the proxy decides where families
go (pilot runbook). Nothing is written to TraxMaster.
Sites, keys and origins
GET /v1/admin/sites lists sites (filter by databaseId, provider, status, or q for a name or token);
GET /v1/admin/sites/{siteId} shows one with its domains, template, roles, origins and its active keys' prefixes.
nFocus sites
GET https://api.nfocus.solutions/v1/admin/sites?provider=nfocus&pageSize=5 → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/sites?provider=nfocus&pageSize=5' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/sites?provider=nfocus&pageSize=5', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/sites?provider=nfocus&pageSize=5");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();- Keys:
POST …/keyswithkind(publishableorsecret) issues a key and shows it once. It replaces the site's other keys of that kind at once, except the Duda website's own widget and collection keys, which the organization site's Duda endpoints rotate. - Origins:
POST …/originsadds an https origin that isn't one of the site's domains, such as a widget host;DELETE …/origins/{originId}removes one. Origins markedfromDomainfollow the site's domains: they come and go with the domain (409 origin-from-domain). The site's sign-in client follows its origins. - Template lock:
PUT …/template-lockwithlocked. A lock blocks template switches and upgrades, not content.
Platform settings
Every platform.PortalSetting key, for one portal (/v1/admin/portals/{databaseId}/{orgId}/settings) or for the whole
client (/v1/admin/clients/{databaseId}/settings, every portal's fallback). Each shows its value, default, source
(portal, client or default), kind and range, and:
locked: nFocus has locked it for the portal's Site Admins;siteAdminsChange: the organization site lets Site Admins change it (the registration settings), so only these can be locked;placeholder: the value in use is placeholder wording.
A client's own settings, every portal's fallback
GET https://api.nfocus.solutions/v1/admin/clients/101/settings → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/clients/101/settings' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/clients/101/settings', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/clients/101/settings");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();| Key | What it is |
|---|---|
| The registration settings | Guest carts, seat holds and cart reminders (see Organization site, "Registration settings") |
MinimumCardPaymentCents |
The smallest card payment, never below the gateway's minimum |
DonationMaximumCents |
The largest gift, $1 to $100,000 (GET P/donations/options shows it) |
DonationReceiptText |
The donation and tax wording on receipts, plain text up to 1,000 characters. Placeholder wording until set |
Email{Kind}Opening, Email{Kind}Closing, Email{Kind}Footer |
Your own paragraphs (up to 1,000 characters) and footer line (up to 250) inside the built-in emails. {Kind} is Receipt, Account (the account emails families get) or CartReminder |
PUT takes values by key (null removes that level's value) and, for a portal, locks by key (true locks, false
unlocks). A link may be any https address here. The minimum card payment can't be above the donation maximum: a gift
without signing in is one card payment, so every gift would be refused. Every change and lock is in the audit trail with its old and new value
(wording by its length). The instance that took the change applies it at once; the others within a minute.
Capabilities
nFocus decides first whether each capability (see Organization site, "Capabilities") is off, available (the
organization chooses; the default) or onLocked (on, and the organization can't turn it off), for the whole client
(/v1/admin/clients/{databaseId}/capabilities) or one portal (/v1/admin/portals/{databaseId}/{orgId}/capabilities). A
portal's own state wins over the client's.
A portal's capabilities: nFocus's state and where it comes from, legacy's value, the organization's choice and the effective value
GET https://api.nfocus.solutions/v1/admin/portals/101/11/capabilities → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/portals/101/11/capabilities' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/portals/101/11/capabilities', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/portals/101/11/capabilities");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();Each capability shows state (this level's own, or null), the state that applies (nfocusState) and where it comes
from (source: portal, client or default), its owner and controlledBy. At a portal it also shows legacy
(legacy configuration's value, for a legacy-owned capability), organizationValue (the organizations' choice, or the
registration setting behind seat holds and reminders) and effective.
PUT takes states by key; null removes this level's state, so the client's (or available) applies.
- Legacy-owned capabilities (
giving.donations,registration.activities,registration.memberships,registration.paymentPlans) are only ever turned off here.onLockedmeans "on wherever legacy has it on"; it never turns on what legacy configuration hasn't set up, and the API never writes legacy configuration. - Seat holds and reminders:
offturns them off whatever the registration setting says;onLockedkeeps them on. organization.childSitesis yours alone:offstops Organization Admins setting up sites for the portal (409 capability-off, also in a dry run'sproblems).- Every change is in the admin audit with its old and new state, and applies at once on this instance, within a minute on the others.
Leave videos to the organization at this portal
PUT https://api.nfocus.solutions/v1/admin/portals/101/11/capabilities → 200 OK, JSON
curl
curl -s -X PUT 'https://api.nfocus.solutions/v1/admin/portals/101/11/capabilities' \
-H 'Authorization: Bearer your_admin_app_access_token' \
-H 'Content-Type: application/json' \
-d '{"states": {"website.videos": "available"}}'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/portals/101/11/capabilities', {
method: 'PUT',
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
'Content-Type': 'application/json',
},
body: JSON.stringify({"states": {"website.videos": "available"}}),
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Put, "https://api.nfocus.solutions/v1/admin/portals/101/11/capabilities");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
request.Content = new StringContent("""
{"states": {"website.videos": "available"}}
""", System.Text.Encoding.UTF8, "application/json");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();Templates
The template catalog: GET /v1/admin/templates lists every template with all its versions, drafts and retired ones
included, and how many sites use each version.
The template catalog, every version
GET https://api.nfocus.solutions/v1/admin/templates → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/templates' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/templates', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/templates");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();- A new template:
POST /v1/admin/templateswithkey(3–40 lower-case letters, digits and hyphens; the front end's template code is named by it),nameanddescription. It starts as a draft. - A new version:
POST …/{key}/versionswith the release JSON, the same format as the seed's files:schema,sampleContent,sampleBrandingandnotes. It goes through the same check as the seed (known section and field types, sane limits, well-formed contrast pairs, sample content that could be published). Versions only go up (409 template-version-exists), and a new version starts as a draft.
A template version that fails the check
POST https://api.nfocus.solutions/v1/admin/templates/community-hub/versions → 400, problem details
curl
curl -s -X POST 'https://api.nfocus.solutions/v1/admin/templates/community-hub/versions' \
-H 'Authorization: Bearer your_admin_app_access_token' \
-H 'Content-Type: application/json' \
-d '{"schema": {"format": 1, "key": "community-hub", "version": 99}}'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/templates/community-hub/versions', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
'Content-Type': 'application/json',
},
body: JSON.stringify({"schema": {"format": 1, "key": "community-hub", "version": 99}}),
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.nfocus.solutions/v1/admin/templates/community-hub/versions");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
request.Content = new StringContent("""
{"schema": {"format": 1, "key": "community-hub", "version": 99}}
""", System.Text.Encoding.UTF8, "application/json");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();- States:
PUT …/{key}/versions/{n}/statusandPUT …/{key}(status,name,description).- A draft can be previewed but no site can choose it.
- An available template and version can be chosen.
- A retired one takes no new choices or upgrades; the sites already on it keep working.
- Something sites could choose never goes back to draft (
409 template-status-change), and a template goes available only with an available version (409 no-available-version).
- Thumbnail:
POST …/{key}/thumbnail(multipart:file,altText; JPEG, PNG or WebP up to 5 MB, re-encoded) replaces the template's thumbnail. It is public atGET /v1/template-images/{id}by its unguessable id, and the organization site's template list shows it (thumbnailUrl,thumbnailAltText). - Preview:
POST …/{key}/versions/{n}/preview-linkreturns a one-hour link toGET /v1/template-preview, which answers the version's sample content as a website (the same shape asGET P/website,no-store), drafts included. - Usage:
GET …/{key}/usagelists the sites on each version: their draft, their published website, or both.
Staff users and roles
nFocus creates staff users in Keycloak; the API doesn't change Keycloak.
- Find:
GET /v1/admin/staff-users?email=(at least 3 characters of an email) finds staff users, and roles waiting for a matching email that no one has signed in with yet. - Read:
GET /v1/admin/staff-users/{id}shows a user's site roles, organization roles, roles still waiting for their email, and when they were last seen. - Grant:
POST /v1/admin/sites/{siteId}/roleswithemailandrolegives any role, the first Site Admin included. - Remove:
DELETE /v1/admin/roles/{roleId}removes one. A site always keeps one Site Admin (409 last-site-admin).
Site role changes also appear in the site's own audit trail.
Operations and reconciliation
GET /v1/admin/ops/status and GET /v1/admin/reconciliation answer exactly what /internal/v1/ops/status and
/internal/v1/reconciliation answer (the same fields and parameters, and format=csv), for the admin app's sign-in.
The read role is enough. Each queue and job in the status has a latestEventId: its latest failure in the
troubleshooting log.
Reports
GET /v1/admin/reports lists nFocus's reports:
- Site usage, sign-ins, and registration and donation revenue run on a client (
client:{databaseId}), a portal (portal:{databaseId}/{orgId}) or every client (all). Revenue groups by period, channel (the new portal or legacy OLR) and client only. - Platform adoption is a snapshot of every client's portals, websites, templates and capability states.
Answers are totals only: nFocus never gets detail rows (detail=true answers 400), nor the outstanding balances
and waitlists reports, which name families. The read role is enough, and every run is in the admin audit. A portal's page traffic needs
its GA4 property id: the portal setting Ga4PropertyId. See Reports and the troubleshooting log.
The reports nFocus runs
GET https://api.nfocus.solutions/v1/admin/reports → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/reports' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/reports', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/reports");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();Troubleshooting log
GET /v1/admin/logs searches every client's troubleshooting events: errors, refusals worth support's attention, failed
sign-ins and lockouts, failed emails, Duda jobs and worker passes, checkout recovery, the scheduled payments' sync and
domain checks. Filter by client, organization, site, kind, severity, code, trace id and time; add the audit trails'
changes with includeChanges=true; export with format=csv. See
Reports and the troubleshooting log.
The troubleshooting log: one client's errors, newest first
GET https://api.nfocus.solutions/v1/admin/logs?databaseId=101&severity=error&pageSize=5 → 200 OK, JSON
curl
curl -s 'https://api.nfocus.solutions/v1/admin/logs?databaseId=101&severity=error&pageSize=5' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/logs?databaseId=101&severity=error&pageSize=5', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/logs?databaseId=101&severity=error&pageSize=5");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();Support lookup
GET /v1/admin/orders finds one order by one of:
receiptwithdatabaseId: the receipt number;traceId: the trace id a family quotes from an error;orderId: the confirmation id the family's order shows.
It shows the order as its receipt does:
- portal, status, when created and completed;
- the lines, with participants' first names as the receipt prints them;
- amounts, the convenience fee, what was paid and what is left for later;
- settlement, the receipt number and the gateway transaction id;
recovery:none,interrupted(the worker completes or voids it),settling,settlementFailed(staff must look), orvoiding(a failed checkout whose authorization is still to be voided; nothing is charged);receiptEmail:notQueued,queued,delivered,failed(given up: it won't arrive), orunknownfor orders from before this lookup existed;events: the troubleshooting events with the order's id or its checkout's trace id, newest first (a declined card's refusal, a settlement retry).
It never shows card data, the household beyond the order's own lines, an address, phone or email, or any other order. An anonymous gift shows its donor's name only.
- One order only. When more than one order matches, the answer is
409 lookup-not-unique. Every anonymous gift has the same legacy receipt number, so look those up by order id or trace id. - Trace ids: a trace id finds only orders made since gate 10f.
Looking up a receipt number that isn't there
GET https://api.nfocus.solutions/v1/admin/orders?databaseId=101&receipt=no-such-receipt → 404, problem details
curl
curl -s 'https://api.nfocus.solutions/v1/admin/orders?databaseId=101&receipt=no-such-receipt' \
-H 'Authorization: Bearer your_admin_app_access_token'JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/admin/orders?databaseId=101&receipt=no-such-receipt', {
headers: {
'Authorization': 'Bearer your_admin_app_access_token',
},
});
const data = await response.json();C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/admin/orders?databaseId=101&receipt=no-such-receipt");
request.Headers.Authorization = new("Bearer", "your_admin_app_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();