Plans: Pro and Enterprise. Self-hosted: Enterprise license.
402 with code plan_feature_not_included.
Creating, deleting, deactivating, and reinstating users, and issuing new credentials, work as on a self-hosted open-source server. Callers below the “Who” floor on the reads get
200 with {"available": false} rather than an error.
The user record
GET /api/users/me, GET /api/users/{id}, the items of GET /api/users, and the response of PUT /api/users/{id} share one shape:
List users
GET /api/users
An
admin sees everyone. A manager sees people in their units and everyone beneath the units they lead, whatever filters they send. Newest first.
400 with {"error": "invalid role; valid: admin, manager, member"} or {"error": "invalid status; valid: active, disabled"}.
GET /api/users/stats returns {"available": true, "total": 48, "admins": 2}, counted over the same scope. admins includes superusers.
Agents a user can reach
GET /api/users/me/accessible-agents and GET /api/users/{id}/accessible-agents
Agents the user owns, public agents, and agents shared with them directly or through an org unit they belong to.
owned and shared split accessible_agents by owner. grant_list is always empty. For another user outside your scope: 403 with {"error": "you do not have permission to view this user's agents"}.
Update a user
PUT /api/users/{id}
Fields you leave out are unchanged. Returns
200 with the updated user record.
Change a role
PUT /api/users/{id}/role
204 on success. The user is signed out of every session. Demoting to member also clears them as lead of any unit. 400 for an unknown role, 403 for your own role or, unless you’re a superuser, a superuser’s role, 404 for no such user, 409 for demoting the last admin. Managers change roles through PUT /api/org/users/{id}/role instead.
Revoke sessions
POST /api/auth/tokens/revoke-user/{id} signs one user out everywhere. POST /api/auth/tokens/revoke-all signs out every user, including you. Both need a superuser, take no body, and return:
revoked is the number of sessions ended. CLI: nasiko-ee admin user-revoke <user-id> and nasiko-ee admin revoke-all.