SentnelOpsSentnelOpsbeta
LAYER 5 · HUMANS & TENANTS

Reference

Endpoints, the user record, session claims, and the role-capability matrix — everything on this page mirrors the code, not aspiration.

Auth & user endpoints

EndpointMin roleBodyErrors
POST /orgs/registerpublicorg_name (2–120), email, password (8–200), name? → 201 with org_id, one-time api_key, user, session token409 email already registered
POST /auth/loginpublicemail, passwordtoken + user401 invalid credentials — identical for unknown email, wrong password, and disabled account
GET /auth/meviewer— → via (session/api_key), org_id, role, user (null for the API key)401 bad credential
POST /auth/passwordviewer (session only)current_password, new_password (8–200)400 if called with the API key · 403 current password is wrong
GET /usersadmin— → array of user records for your org403 requires the admin role
POST /usersadminemail, password (8–200), role (default developer), name?409 email already registered · 422 unknown role · 403 role error
PATCH /users/{id}adminrole?, status? (active/disabled), name? — no password field404 unknown user (foreign or malformed IDs look identical) · 409 cannot remove the last admin · 422 bad role/status · 403 role error

Any authenticated caller below an endpoint's floor gets 403 requires the <role> role (you are <role>).

The user record

FieldTypeNotes
idUUIDPrimary key, generated
org_idUUIDThe tenant — foreign key to orgs
emailtextGlobally unique across all tenants; the login identifier
password_hashtextbcrypt; never returned by any endpoint
nametextDisplay name, defaults to empty
roletextOne of viewerdevelopersecurityadmin; default developer
statustextactivedisabled; checked fresh on every request
created_at / updated_attimestamptzISO-8601 strings in API responses

Session token claims

ClaimValue
subThe user's ID (UUID)
orgThe tenant's org ID
emailThe account email at issue time
roleRole at issue time — advisory only; the account row is re-checked per request
typuser — what makes this token unusable as an agent identity
iat / expIssued-at and expiry; exp = iat + 12 h

Role-capability matrix

Actionviewerdevelopersecurityadmin
Read registry, calls, audit, exports, approvals list
Register / update agents, rotate agent tokens, activate
Approve / suspend / reactivate / decommission agents, decide approvals, manage MCP servers, edit org policy
Create users, change roles, disable accounts

The org API key holds the admin row of this matrix as a machine principal. For how this layer fits the other four, see The five layers.