Management API
Each realm has its own management API at <issuer>/api/v1, for consoles, scripts and provisioning.
Access
The caller is a machine client of the realm, with a client credentials token for the realm's management API:
nod client register acme admin-script --machine
nod client grant acme admin-script https://auth.example.com/acme/api --scope users:read --scope users:write
TOKEN=$(curl -s -u admin-script:$SECRET https://auth.example.com/acme/token \
-d grant_type=client_credentials -d resource=https://auth.example.com/acme/api | jq -r .access_token)
curl -H "Authorization: Bearer $TOKEN" https://auth.example.com/acme/api/v1/users
An org's people. In a realm a customer org owns, a member's own token for the accounts API (from [nod login](accounts.md#signing-in-as-yourself)) is accepted too, as far as their org role allows: member reads, deployer also clients:write, admin everything but realm:admin, owner everything. Membership is read at each call.
Scopes: realm:read, realm:admin, users:read, users:write, users:admin, clients:read, clients:write, apis:read, apis:write, connections:read, connections:write, organizations:read, organizations:write, billing:read, billing:write, logs:read, for roles roles:read, roles:write, and for fine-grained authorization fga:admin, fga:write, fga:read, fga:check.
- The client must still hold the scope when it calls. Revoking a grant takes effect at once, even for tokens already issued.
- A token from another realm, a token for another API, a person's own access token (but for an org's people, above), or a nod approval is refused (401). A missing scope is 403.
Sender-constrained tokens
A token bound to its client works here only with the proof it's bound to, exactly as at userinfo, so a stolen one is no use on its own. This holds for a client's own tokens and for those it holds on behalf of a person.
- Bound to a DPoP key (
cnf.jkt; the client sent aDPoPproof to the token endpoint, RFC 9449): send it asAuthorization: DPoP <token>with aDPoPheader carrying a fresh proof for this request:htmits method,htuits URL (without the query),aththe token's hash, and ajtinever used before. A proof works once. The token sent asBearer, no proof or two, another key's proof, or a proof for another URL or method is refused with 401 andWWW-Authenticate: DPoP error="invalid_token"(orinvalid_dpop_proofwhen the proof header is missing), orBearer error="invalid_token"under the Bearer scheme. An unbound token under theDPoPscheme is refused too. - Bound to a TLS client certificate (
cnf.x5t#S256; the client authenticated with its certificate, RFC 8705): the request must present that certificate. As everywhere in Nod, the certificate is the one the proxy that terminated TLS reports in RFC 9440'sClient-Certheader, believed only from the operator's trusted proxies. - Unbound tokens work as Bearer tokens, as before.
TOKEN=$(curl -s -u admin-script:$SECRET -H "DPoP: $(make-proof POST https://auth.example.com/acme/token)" \
https://auth.example.com/acme/token \
-d grant_type=client_credentials -d resource=https://auth.example.com/acme/api | jq -r .access_token)
curl -H "Authorization: DPoP $TOKEN" \
-H "DPoP: $(make-proof GET https://auth.example.com/acme/api/v1/users $TOKEN)" \
https://auth.example.com/acme/api/v1/users
(make-proof stands for the client's DPoP signer, such as openid-client's.)
On behalf of a person
A console that people sign in to can make each change as the person who asked for it: its machine client exchanges their access token (token exchange, RFC 8693) for a token to the management API. That token's sub is the person and its act.sub the client. The person needs the scopes through a realm role whose permissions are set, and which is given or taken away, on the command line only, like a client's grant. So roles:write can't make anyone an administrator: the management API refuses to give a role anything on the management API, and refuses to assign or remove a role that has something there. A role held in an organization counts for nothing on the management API, which administers the whole realm.
nod role create acme operator
nod role grant acme operator https://auth.example.com/acme/api --scope users:read --scope users:write
nod user role acme alice operator
nod client exchange acme console-mgmt --from https://console.example.com/api
TOKEN=$(curl -s -u console-mgmt:$SECRET https://auth.example.com/acme/token \
-d grant_type=urn:ietf:params:oauth:grant-type:token-exchange \
-d subject_token=$ALICES_TOKEN -d subject_token_type=urn:ietf:params:oauth:token-type:access_token \
-d resource=https://auth.example.com/acme/api | jq -r .access_token)
- Accepted only when
act.subis the token's own client, a machine client of this realm with a grant on its management API, andsubis someone else: a person, with the grant id (gid) of their sign-in. Anything else that carriesactis refused (401): another kind of client, a client with no grant there, a client of another realm, a chain of actors. - Bound like the client's own tokens. The exchange binds the new token to the client's DPoP key when the exchange request carries a proof, or to its certificate when the client authenticates with one, and the token is then held to that binding as above (sender-constrained tokens).
- Both sides are checked at every call. The scope must be in the client's grant and in the person's own permissions, both as they are now: a role taken away or a grant reduced is a 403 at the next call. A blocked or deleted person, or a revoked grant (they signed out of the console, or were signed out of everything), is a 401.
- Writes only for a person. Give the console's client the scopes it needs only for people on-behalf-only (
nod client grant acme console-mgmt https://auth.example.com/acme/api --scope users:read --on-behalf-only users:write): its client_credentials tokens then never carry them (invalid_scopeif asked for, left out if not), and a token of its own that does, made before the mark or by hand, is a 403 for them. Only a token exchanged for a person, withact, can use them, within that person's permissions. See scopes only on a person's behalf. - The log names the person. Each change's
admin.changeevent hasactor_id(the person),client_id(the console's client) and, for a change to a user,user_id(that user). See the security log.
Clients: TypeScript in [sdks/typescript](../../sdks/typescript), Python in [sdks/python](../../sdks/python), Go in [sdks/go](../../sdks/go). The whole API is described in OpenAPI 3.1 at [docs/api/management.openapi.json](../api/management.openapi.json), for client generators and API tools. A test keeps it identical to the server's routes and scopes.
Endpoints
| Method and path | Scope | Does |
|---|---|---|
GET /realm | realm:read | The realm and its policies |
PATCH /realm | realm:admin | display_name, passwords_enabled, sign_up_enabled and the other policies in the OpenAPI description. signup_email_domains: self sign-up only for those email domains, everyone else to the waitlist ([] clears it; changing it is a nod with --nod). mail_from (Name <address>), default_roles, branding. GET also shows owner, the org that owns the realm |
GET /realm/text | realm:read | {"languages"}: the languages the sign-in page has the realm's own wording in (sign-in methods) |
GET /realm/text/{lang} | realm:read | {"language", "text", "defaults"}: its wording, and every key's English default |
PUT /realm/text/{lang} | realm:admin | {"text": {key: string}}: replaces that language's wording (known keys only, one line of plain text each) |
DELETE /realm/text/{lang} | realm:admin | Remove a language: the page shows the defaults |
GET /users?limit=50&after=<id> | users:read | A page of users, in creation order, with next for the following page |
GET /users?username=… or ?email=… | users:read | The one user with exactly that username, or that verified address (any case), as a list of one or none. Unverified addresses aren't searched: anyone can type any address into a profile |
POST /users | users:write | Create: username, and optionally display_name, email and profile fields |
GET /users/{id} | users:read | One user |
PATCH /users/{id} | users:write | username, display_name, email, profile fields. A changed email becomes unverified. blocked: true blocks the user (see below; past 5 an hour per caller, a nod or 429), false unblocks. user_metadata, and app_metadata with users:admin too (see below) |
DELETE /users/{id} | users:write | Delete, after revoking all their grants |
POST /users/{id}/password | users:write | {"password": "…"}, if the realm allows passwords |
POST /users/{id}/verify-email | users:admin | Mark the current email verified (email_verified_by: "admin": not counted for org roles) |
POST /users/{id}/revoke | users:write | Revoke every grant: signed out of every app |
GET /users/{id}/export | users:admin | Everything Nod holds about them, for an access request (GDPR): profile, linked accounts, sign-in methods (never secrets), roles, organizations, sessions, security log |
GET /users/{id}/organizations | users:read and organizations:read | {"organizations": [{"id", "name", "display_name", "roles"}]}: every organization of the realm they belong to, by id, with the realm roles they hold in each (name is the id, what apps send as organization=); 404 for no such user. Read from Nod's by-user index: costs what their memberships do, not the realm's size |
GET /users/{id}/sessions | users:read | Their browser sessions at Nod: public sid, when, how they signed in (never a cookie) |
DELETE /users/{id}/sessions | users:write | End every one; apps that signed in through them are told (back-channel logout) |
DELETE /users/{id}/sessions/{sid} | users:write | End one |
POST /users/{id}/totp | users:admin | Start an authenticator app: {secret, uri}, shown once |
POST /users/{id}/totp/confirm | users:admin | {"code": "123456"} turns it on: {recovery_codes}, shown once |
POST /users/{id}/totp/recovery-codes | users:admin | Ten new recovery codes; the old ones stop working |
DELETE /users/{id}/totp | users:admin | Remove it |
GET /waitlist?product=&after=&limit= | users:read | {"entries": [{email, product, created_ms, note, admitted_ms}], "next"}: who asked to sign up and wasn't let in by the realm's signup_email_domains, oldest first (limit up to 1000) |
POST /waitlist/admit | users:write | {"product", "email"} → the entry: their next sign-up for that product (a client id) becomes an account. Past 25 a day per caller, a nod with --nod, else 429 (ceilings) |
POST /clients | clients:write | Register: client_id, redirect_uris, confidential or machine. The secret comes back this once. With "token_endpoint_auth_method": "private_key_jwt" and jwks, no secret is made: it signs with its key |
GET /clients | clients:read | Every client (never secrets) |
PUT /clients/{id}/grants | clients:write | {"resource", "scopes", "on_behalf_only"}: a machine client's scopes on an API; [] revokes. on_behalf_only (optional, each one of scopes): those it may use only in a token exchanged for a person, never in its own; a grant replaces the marks too. Never the management API's own scopes: those come from the command line, so a clients:write token can't make anyone an administrator |
GET /connections, POST /connections | connections:read, connections:write | The outside providers people sign in with. Add one with the fields nod connection add… takes: {"id", "kind"?, "name"?, "issuer", …}, where kind is oidc (the default), github, oauth2, ldap or saml (see sign-in methods). It's checked the same way (an OpenID Connect provider's discovery is read, a SAML certificate parsed). The secret is sealed at rest and never shown again |
GET, PATCH, DELETE /connections/{id} | connections:read, connections:write | One connection, never its secret; {"disabled": true} turns it off (its button goes, and its sign-ins are refused), false back on; {"scopes": […]} changes what it asks for; {"verified_domains": […]} replaces the email domains an OpenID Connect connection may verify addresses in ([]: none; see sign-in methods). Deleting is refused (409) while an organization lists it, since an organization with an empty list allows every connection. People keep their links (by the provider's issuer and their id there), so a connection added again for the same provider signs them in as before. Sign-ins in progress through it fail |
GET /apis, POST /apis | apis:read, apis:write | The realm's APIs; register one with {"identifier", "name"?, "scopes", "token_ttl_s"?} |
GET, PATCH, DELETE /apis/{api} | apis:read, apis:write | One API, its identifier percent-encoded as one path segment. PATCH {"resource_server": "<client id>"} names its resource server for the token vault ("": none; a confidential client of the realm's own, never an agent, platform or someone else's app; see nod.md); GET shows it. PATCH {"token_alg": "RS256"} signs its access tokens with the realm's RSA key, for a verifier that takes no EdDSA (Anthropic's workload identity federation); "EdDSA" (the default) back; never on Nod's own APIs. Deleting is refused (409) while a client grant or role permission names it. The management API itself can't be changed or deleted this way |
DELETE /apis/{api}/scopes?prefix=P | apis:write | Every scope beginning with P, removed from the API, every client grant and every role at once; a grant or permission left with none goes. The prefix matches exactly (end it with : so …:acme: doesn't touch acme2). 204 even when nothing matches, so it can be retried. TwilightDB calls it when a database is deleted |
GET /roles, GET /roles/{name} | roles:read | Roles with their permissions |
DELETE /roles/{name} | roles:write | It grants nothing from then on, to anyone it was assigned to, and its name stays taken: a new role can't inherit old assignments |
GET /fga/model | fga:read | The authorization model as written |
GET /clients/{id} | clients:read | A client (never its secret) |
PATCH /clients/{id} | clients:write | Change its name, redirect_uris, post_logout_redirect_uris or backchannel_logout_uri, checked as at registration; only what you send changes. A redirect on an origin none of its redirects use is a nod with --nod. Its id, type and secret don't. skip_native_confirmation (a first-party app only): its sign-ins at a loopback or private-use redirect go through without the person confirming each (apps); each change is logged as client.native_confirmation |
DELETE /clients/{id} | clients:write | Delete it: its refresh tokens, codes and device codes stop working, and introspection calls its tokens inactive. Access tokens already issued expire with their lifetime at APIs that verify them locally. A nod with --nod |
POST /clients/{id}/secret | clients:write | A new secret, shown this once; the old one stops working at once. Not for public clients or clients that sign with a key With ?claim=1 (MCP), an org member's new secret is held for their browser and the answer carries secret_url instead; anyone else is refused before anything changes. |
PUT /clients/{id}/platform | clients:write | {"platform", "surface_notify"?}: make it a platform (the realm's own confidential app that signs people in), or not. Setting surface_notify (https) makes a new signing secret, in the answer as surface_secret this once; "" clears it; turning platform off clears both. Logged as client.platform |
PUT /clients/{id}/runtimes/{runtime} | clients:write | {"scopes", "resources"}: the platform lets a runtime run its agents, on those APIs and within those scopes (and each person's own); replaces what it had. Answers {platform, runtime, scopes, resources, created_ms}. Logged as runtime.granted |
DELETE /clients/{id}/runtimes/{runtime} | clients:write | Revoke it: the runtime's next exchange for the platform's agents fails; 404 if there was none. Logged as runtime.revoked |
POST /roles | roles:write | {"name", "description"?} |
PUT /roles/{name}/permissions | roles:write | {"resource", "scopes"}: what the role allows on an API |
GET /users/{id}/roles | roles:read | The user's roles |
POST /users/{id}/roles | roles:write | {"role", "assigned": true or false}. Not a role with permissions on the management API (403): those are assigned on the command line |
GET /organizations?limit=50&after=<id> | organizations:read | A page of organizations, by id |
POST /organizations | organizations:write | {"id", "display_name"?} |
GET /organizations/{org} | organizations:read | One organization |
DELETE /organizations/{org} | organizations:write | Delete it and every membership in it |
GET /organizations/{org}/members/{user_id}/roles | organizations:read | A member's roles in the organization |
PUT /organizations/{org}/members/{user_id}/roles | organizations:write | {"roles": [...]}: realm roles the member holds there |
PUT /organizations/{org}/connections | organizations:write | {"connections", "join_on_sign_in"?}: its own providers, and whether signing in through them makes a member |
GET /organizations/{org}/members | organizations:read | A page of members' user ids |
POST /organizations/{org}/members | organizations:write | {"user_id"} |
DELETE /organizations/{org}/members/{user_id} | organizations:write | Remove a member |
POST /organizations/{org}/invitations | organizations:write | {"email"}: emailed, and invitation_url returned once |
GET /organizations/{org}/invitations | organizations:read | Open invitations (never their links) |
DELETE /organizations/{org}/invitations/{id} | organizations:write | Withdraw one |
PATCH /organizations/{org}/metadata | organizations:write | {key: string or null}, merged (see metadata) |
PUT /organizations/{org}/branding | organizations:write | {"logo_url", "accent_color", "background_color"} on its sign-in page ("": the realm's); see organizations |
POST /organizations/{org}/sso-tickets | organizations:write | {"join_on_sign_in"?} → {organization, join_on_sign_in, expires_ms, ticket_url}, once: a self-service SSO link for the customer's IT team (organizations) |
GET /billing/plans | billing:read | The realm's plans |
GET /billing/plans/{plan} | billing:read | One plan |
PUT /billing/plans/{plan} | billing:write | {"display_name"?, "features", "prices"?}: makes or replaces it; a price buys one plan |
PUT /organizations/{org}/directory | organizations:write | {"kind": "bamboohr", "company", "api_key"}, {"kind": "hibob", "company", "service_user", "api_key"} (the service user's token), {"kind": "rippling", "company", "api_key"} (the API token) or {"kind": "workday", "company", "client_id", "api_key", "token_url", "report_url", "refresh_token"?} (the API client's secret; no refresh token: client credentials): the organization's HR directory; the key is sealed and never shown again |
GET /organizations/{org}/directory | organizations:read | {kind, company, service_user, last_sync_ms, last_error, last_counts} |
DELETE /organizations/{org}/directory | organizations:write | Stops syncing; its people stay as they are |
POST /organizations/{org}/directory/sync | organizations:write | {"allow_mass_block"?} → {created, linked, updated, blocked, unblocked, skipped, group_joins, group_leaves}; 502 with why when the HR system refuses, or a run would block more than a tenth of the people or take more than a tenth of a department group's people out of it |
POST /billing/plans/{plan}/prices | billing:write | {"unit_amount", "currency", "interval"?} → {price, plan}: Nod makes the price in Ducat (its own, so the public pricing shows it) and adds it to the plan; the same request again is the same price. 503 without Ducat |
DELETE /billing/plans/{plan} | billing:write | Organizations on it have no features from then on; the id stays taken |
GET /billing/organizations | billing:read | A page (after, limit up to 200) of {id, display_name, plan, status, period_end_ms, customer, as_of_ms, live, features}: the realm's customers. organizations:read alone doesn't show who pays for what |
GET /organizations/{org}/billing | billing:read | {plan, status, period_end_ms, customer, as_of_ms, live, features} |
PUT /organizations/{org}/billing | billing:write | {"plan", "status"?, "period_end_ms"?, "customer"?, "as_of_ms"}: older than the stored as_of_ms changes nothing ("stale": true) |
POST /organizations/{org}/billing/checkout | billing:write | {"plan", "price"?, "success_url", "cancel_url"} → {url, session, customer, price}: a Ducat checkout (checkout and the portal); 503 without Ducat |
POST /organizations/{org}/billing/portal | billing:write | {"return_url"} → {url}: Ducat's customer portal; 409 before a checkout made the customer |
GET /billing/sync | billing:read | {configured, cursor, last_ok_ms, last_error, last_error_ms, behind}: the sync that follows Ducat's event feed |
GET /nods/{auth_req_id} | users:read | One nod (CIBA) request: kind, state (pending, approved, denied, expired), collected, summary, action, who asks (client, agent, platform) for whom (for), decided_by, approvals, approved_in. Never its user code or a way to decide it; 404 for another realm's |
GET /logs?after=<id>&limit=100&type=<prefix>&user_id=<id>&order=newest | logs:read | The security log, oldest first, with next; order=newest for newest first |
GET /logs/stream | logs:read | {url, failures, delivered_through, last_delivered, last_error, retry_at}: where the log is pushed (never the secret); streaming |
PUT /logs/stream | realm:admin | {"url", "from_start"?} → {url, secret}: a new signing secret each time, shown once |
DELETE /logs/stream | realm:admin | Stop pushing |
GET /hooks/{trigger} | realm:read | {url, fail_open} (never the secret). trigger: post-login, pre-registration, credentials-exchange, post-change-password, password-migration (hooks) |
PUT /hooks/{trigger} | realm:admin | {"url", "fail_open"?} → {url, fail_open, secret}: a new signing secret each time, shown once |
DELETE /hooks/{trigger} | realm:admin | Remove it |
PUT /fga/model | fga:admin | The authorization model, as text in OpenFGA's language |
POST /fga/write | fga:write, or fga:write:T | {"writes": [...], "deletes": [...]} tuples, atomically. fga:write:<type> (granted as, say, fga:write:topic) allows only tuples on objects of that type: an agent that writes its own topics can't touch anything else |
POST /fga/read | fga:read | {"object", "relation"}: its tuples |
POST /fga/check | fga:check | {"object", "relation", "user", "contextual_tuples"?} → {"allowed"} |
POST /fga/batch-check | fga:check | {"checks": [{correlation_id, object, relation, user, contextual_tuples?, context?}]} (up to 1,000) → {"result": {id: {"allowed"} or {"error"}}} |
POST /fga/list-objects | fga:check | {"type", "relation", "user"} → {"objects"} |
POST /fga/list-users | fga:check | {"object", "relation", "filters"} → {"users"} |
Bodies are JSON, and unknown fields are refused (422). In particular, email_verified can't be set through a profile update. Errors are {"error": …, "error_description": …} with a fitting status: 400, 401, 403, 404, 409 or 422.
Creating realms is the operator's job (nod realm create) and is not part of a realm's API.
Metadata
Each user has two JSON objects, as in Auth0:
- **
user_metadata**: the app's own data about the person (preferences, settings).users:writechanges it. - **
app_metadata**: what the realm's administrators decide about them (a plan, a tenant, flags). Changing it needsusers:adminas well, since the post-login hook is sent it and may turn it into claims.
PATCH /users/{id} (or POST /users) with either merges at the top level: each key given replaces that key (nested objects whole) and a key given as null is removed. Each is at most 16 KiB of JSON, keys 1 to 100 characters without . or a leading $, nested at most 10 deep; a change over the limits is refused whole. Both come back with the user, in the person's data export, and in nod export (Auth0's format, so they move back and forth).
Organizations and clients have metadata too, as in Auth0: flat maps of strings (up to 255 characters each; 25 keys for an organization, 10 for a client), merged the same way. PATCH /organizations/{org}/metadata with the map (organizations:write), or PATCH /clients/{id} with {"metadata": {…}} (clients:write). Hooks are sent them: the client's with every call that has a client, the organization's (in organization_details) when the app asked for one. Configuration files carry both. They aren't for secrets: whoever reads the organization or client reads them.
Locked out
Ten wrong passwords in a row lock password sign-in for fifteen minutes (passkeys and outside providers still work). While that lasts, GET /users/{id} shows password_locked_until_ms, when it ends. Setting a new password (POST /users/{id}/password, or a reset by email) ends it at once.
Blocking a user
PATCH /users/{id} with {"blocked": true}, or nod user block REALM USERNAME (and unblock):
- No sign-in by password, passkey or outside provider. The person learns they're blocked only after proving who they are: a wrong password still gets the usual answer.
- Everything they hold is revoked: refresh tokens stop at once, and so do access tokens wherever they are checked with Nod (userinfo, introspection). An API that verifies tokens itself accepts them until they expire, so keep access tokens short-lived.
- Their browser sessions at Nod are ended (apps signed in through them are told, by back-channel logout), and no new ones start. Unblocking doesn't bring an ended session back.
- Unblocking lets them sign in again. Revoked grants stay revoked: apps ask them to sign in again.
For agents: MCP
Each realm's management API is also an MCP server (Streamable HTTP) at <issuer>/mcp, so an agent can work the realm on someone's behalf. Each tool is a call on this API with the agent's own token, so the same checks apply: a management token of this realm (or on behalf of a person), holding the endpoint's scope. A token without it, or from another realm, gets the API's refusal as the tool's error. Each tool has a level (see agents.md): free tools read, limits tools change things within the API's own rules, and nod tools need a person's approval of the one action.
| Tool | Level | Scope | Endpoint |
|---|---|---|---|
realm_get | free | realm:read | GET /realm |
clients_list | free | clients:read | GET /clients (never secrets) |
client_get | free | clients:read | GET /clients/{id} |
users_find | free | users:read | GET /users?username= or ?email= (exact; verified addresses only) |
waitlist_list | free | users:read | GET /waitlist |
roles_list | free | roles:read | GET /roles |
logs_list | free | logs:read | GET /logs (paged with after and limit) |
plans_list | free | billing:read | GET /billing/plans |
directory_get | free | organizations:read | GET /organizations/{org}/directory |
billing_customers | free | billing:read | GET /billing/organizations (paged with after and limit) |
org_billing_get | free | billing:read | GET /organizations/{org}/billing |
waitlist_admit | limits | users:write | POST /waitlist/admit {product, email} (past the day's ceiling: a nod, with --nod; approval as Nod-Approval) |
user_sign_out_everywhere | limits | users:write | POST /users/{id}/revoke |
user_block | limits | users:write | PATCH /users/{id} {blocked} (blocked: false unblocks; past the hour's ceiling: a nod, with --nod; approval as Nod-Approval) |
client_rotate_secret | limits | clients:write | POST /clients/{id}/secret?claim=1: never the secret in the answer, a link (secret_url, ten minutes, once) to see it in your own browser, signed in. Only a person (an org member) can rotate through MCP; a machine client is refused before anything changes and rotates with the API directly, where the secret comes back to it |
client_update_redirects | limits | clients:write | PATCH /clients/{id} {redirect_uris} (a new origin: a nod, with --nod; approval as Nod-Approval) |
directory_sync | limits | organizations:write | POST /organizations/{org}/directory/sync (a mass block stays a person's, through the API) |
plan_put | limits | billing:write | PUT /billing/plans/{plan} {display_name?, features, prices} (prices required: the full list, so leaving it out can't take them off) |
plan_price_add | limits | billing:write | POST /billing/plans/{plan}/prices {unit_amount, currency, interval?} (no money moves) |
client_delete | nod | clients:write | DELETE /clients/{id}, approval as Nod-Approval |
plan_delete | nod | billing:write | DELETE /billing/plans/{plan}, approval as Nod-Approval |
realm_set_signup_domains | nod | realm:admin | PATCH /realm {signup_email_domains}, approval as Nod-Approval |
view_realm | free, view harpora:realm | realm:read (and the parts' own) | GET /realm, /clients, /waitlist, /logs?order=newest |
view_nod | free, view harpora:nod | users:read | GET /nods/{request} |
Views. Two tools open Nod's screens in any MCP Apps host (Nelm, a product's own site, Claude, VS Code), following kit's views spec (docs/views.md in kit). Each declares its screen (_meta.ui.resourceUri) and its context (_meta["nelm/view"]) in tools/list, and the screens are served at resources/read as text/html;profile=mcp-app:
view_realm {realm}(contextharpora:realm, screenui://harpora/realm): the realm's apps, sign-up rules, waitlist size (who still waits, per product) and its 15 most recent security events.realmmust be this server's realm. Each part is read with your token: one your token can't read comes back asapps_error,waitlist_errororevents_errorinstead.view_nod {request}(contextharpora:nod, screenui://harpora/nod): one nod request by itsauth_req_id(frombc-authorize, or a platform's surface notification): its summary, who asks for whom, and its state.
A screen renders only from the tool's result, refreshes by calling its own tool again, follows the host's theme, works inline and full screen, and makes no network requests (its CSP allows none). A screen never decides a nod: the nod view has no Approve or Decline, and its data has no user code or link to decide with. The person decides in their own signed-in session (the approval page), or a platform decides in its own frame with /nod/decide.
A request without a token is refused with 401 and WWW-Authenticate: Bearer resource_metadata="…", naming the realm's protected resource metadata (RFC 9728) at /.well-known/oauth-protected-resource/<realm>/mcp (on a realm's own host, /.well-known/oauth-protected-resource/mcp): the resource is the MCP server's own URL (<issuer>/mcp, as RFC 9728 §3.3 and MCP clients require), the authorization server the realm, and the scopes the ones above. A token asked for with resource=<issuer>/mcp (RFC 8707: client_credentials, token exchange on a person's behalf, or a person's sign-in at /authorize or the device flow) has this API's grants and scopes, with the MCP URL as its audience; it works through the MCP tools only, never at this API over HTTP. A person's own token manages nothing either way (MCP). A token for this API (resource=<issuer>/api) works at MCP too.
Nod-level actions
When Nod runs with serve --nod, the API itself (not only MCP) needs a person's approval for these actions:
| Action | Class | Endpoint | Resource | Scope an approver needs |
|---|---|---|---|---|
client.delete | delete | DELETE /clients/{id} | harpora:<realm>:client:<id> | clients:write |
billing.plan_delete | delete | DELETE /billing/plans/{plan}: organizations on it lose its features | harpora:<realm>:plan:<id> | billing:write |
realm.signup_domains | access | PATCH /realm changing signup_email_domains | harpora:<realm>:realm:signup_email_domains=<the new list> (its SHA-256 past 300 characters) | realm:admin |
client.redirect_origin | access | PATCH /clients/{id} adding a redirect on an origin none of its current redirects use (another path on a known origin is free) | harpora:<realm>:client:<id>:origins=<the new origins, sorted> | clients:write |
waitlist.admit_more | access | POST /waitlist/admit past 25 admissions by one caller in a day | harpora:<realm>:waitlist:<product> | users:write |
user.block_more | access | PATCH /users/{id} blocking past 5 people by one caller in an hour | harpora:<realm>:user:<id> | users:write |
The last two are standing ceilings: counted per realm, per caller (the client, and the person it acts for), in the store. Without --nod, a call past one is 429 limit_reached with Retry-After until the window turns. Unblocking isn't counted.
Who may approve. In a realm an org owns, the approval must have been asked under the org's policy: the challenge's org and class unchanged. In a realm no org owns, every approver must hold the action's scope (last column) through their own roles.
Without an approval (after the scope check), the API answers 403 with {"error": "insufficient_authorization"} and
WWW-Authenticate: Bearer error="insufficient_authorization", nod="<issuer>", authorization_details="<base64url JSON>"
naming the realm's issuer and one urn:nod:action (and the realm's owner org and the class, when an org owns it). Ask the realm for it by CIBA (POST <issuer>/bc-authorize with those authorization_details); once the person approves, the token you poll for is the approval. Send it in the Nod-Approval header with the same request (to an MCP nod tool, as approval; its error carries the challenge as JSON on its last line). An approval is good for exactly that action (a sign-up domains approval for exactly that list), once, within its five minutes; the API checks it with the realm's keys, and logs each use as nod.used. Without --nod, these endpoints need only their scope.