Skip to Content
API ReferenceUsers API

Users API

User administration manages native Auris profiles within the selected tenant. Creating a profile is separate from granting Console membership, organization membership, or application permissions.

Use an authenticated server-side request and the intended x-tenant context. Listing and reading require view:users; creation, updates, deletion, restoration, and role changes require manage:users. A header alone never grants access.

List users

GET/api/usersRequires: view:users

The list returns success, users, and pagination. Search matches email, username, first name, last name, or subject ID. The native list does not apply the role filter and returns an empty roles summary; read actual assignments with the roles endpoint.

  • page: Page number; default 1.
  • limit: Page size; default 10. Use a positive value up to 1000.
  • search: Case-insensitive text search.
  • status: enabled (default), disabled, or all.
  • sortBy: name, email, or createdTimestamp (default).
  • sortOrder: asc or desc (default).
{ "success": true, "users": [ { "id": "usr_example", "email": "[email protected]", "name": "Bob Jones", "username": "bob", "firstName": "Bob", "lastName": "Jones", "enabled": true, "emailVerified": true, "createdTimestamp": 1739552400000, "roles": [] } ], "pagination": { "page": 1, "limit": 10, "total": 1, "totalPages": 1 } }

Create a user

POST/api/usersRequires: manage:users

Creates an Auris database profile. Required fields are email and name; the API does not create an account in an external credential store and does not send an invitation email.

{ "email": "[email protected]", "name": "Bob", "surname": "Jones", "username": "bob", "enabled": true }
  • email: Email address; must be unique in the tenant.
  • name: Given name; required.
  • surname: Family name; optional.
  • username: Optional; defaults to the normalized email address.
  • enabled: Optional; defaults to true.
  • password: Compatibility field only: ignored and never stored. Omit it.

Use name and surname in create/update requests. The list/read response also exposes firstName and lastName. roles, roleIds, metadata, and sendInvite are not creation fields; assigning roles is a separate request.

Administrative creation is passwordless. It does not require a password reset or automatically email a setup link. The user needs an enabled sign-in method, such as a magic link, WebAuthn, or an identity provider. Configure that method before onboarding.

Example success response (HTTP 201)

{ "success": true, "message": "User created successfully", "userId": "usr_example", "user": { "id": "usr_example", "email": "[email protected]", "name": "Bob", "surname": "Jones", "enabled": true } }

Creation errors

  • HTTP 400 / VALIDATION_ERROR: Missing email or name; an early validation response may contain only error and success.
  • HTTP 409 / USER_EXISTS: Email already present in this tenant.
  • HTTP 404 / TENANT_NOT_FOUND: Tenant not found.
  • HTTP 402 / LIMIT_EXCEEDED_MAU: Monthly active-user limit reached; response includes the applicable limit code.
  • HTTP 401 / 403 / —: Authentication or permission denied.

Read a user

GET/api/users/[id]Requires: view:users

Returns { success: true, user: { ... } }. The native profile includes identity fields, status, email verification, and creation timestamps. Use separate endpoints for roles, sessions, and credentials; do not assume they are expanded here.

Update a user

PUT/api/users/[id]Requires: manage:users

Accepts email, name, surname, and enabled. Only supplied fields are updated. username, roles, and arbitrary metadata are not updated by this endpoint. Disabling a user or changing their email triggers session revocation; revocation failure is an error. You cannot disable your own account.

{ "name": "Robert", "surname": "Jones", "enabled": false }

Example success response:

{ "success": true, "code": "USER_UPDATED_SUCCESS" }

A nonempty compatibility password field on update requests forces re-authentication; it does not set a password. The legacy /reset-password endpoint likewise revokes sessions and records re-authentication metadata, without storing the supplied password.

Assign and remove roles

GET/api/users/[id]/rolesRequires: view:users
POST/api/users/[id]/rolesRequires: manage:users
DELETE/api/users/[id]/rolesRequires: manage:users

Read roles with GET. POST assigns the names in roleNames; DELETE removes those names. This changes the specified assignments rather than replacing the entire role set. Role hierarchy is enforced, and a partial result can return HTTP 207: inspect assignedRoles or removedRoles and failedRoles.

{ "roleNames": [ "viewer" ] }

Example success response (POST):

{ "success": true, "realm": "tenant-slug", "userId": "usr_example", "assignedRoles": [ "viewer" ], "failedRoles": [], "total": 1, "assigned": 1 }

Delete and restore

DELETE/api/users/[id]Requires: manage:users
POST/api/users/deleted/[id]Requires: manage:users
DELETE/api/users/deleted/[id]Requires: manage:users

DELETE disables the native profile, revokes sessions, and records a recoverable deletion. POST to the deleted-user route restores the account while its retained record is available. DELETE on that deleted-user route is permanent. These are separate operations; restoration does not recreate revoked sessions or grant new permissions.

Example success response (DELETE /api/users/[id]):

{ "success": true, "code": "USER_DELETED_SUCCESS" }

Permanent deletion cannot be undone. Review the account and required retention before invoking it. A successful API call alone is not a legal compliance assessment.

Sessions

Use GET /api/admin/sessions?userId={tenantUserId} to inspect recorded sessions and DELETE /api/admin/sessions/{sessionId} to revoke a recorded session; these require manage:sessions. Here userId is the internal tenant-user ID, not the profile subject ID returned as id by /api/users. For account-wide native force re-authentication, use the administrative lifecycle operations described above.

Import and export

Bulk jobs are separate from native profile CRUD and require admin:all. Import accepts CSV/JSON files up to 5 MiB; poll the job route and inspect row errors. Exports must complete before download. The current bulk workflow retains a legacy provider dependency: confirm compatibility with the target environment before planning a native-user migration. Creating a job is not proof of a completed migration.

  • POST / GET /api/users/import — Start / list imports
  • GET /api/users/import/{jobId} — Read import status
  • POST / GET /api/users/export — Start / list exports
  • GET /api/users/export/{jobId}/download — Download completed export

Phone and two-factor authentication

These authenticated self-service endpoints act on the current user, not an arbitrary administrator-selected account. Setting a phone sends its verification code; verification takes { "code": "…" }. Responses expose success and a message, not an ok/data envelope.

POST /api/user/phone/set POST /api/user/phone/verify POST /api/user/2fa/sms/enable POST /api/user/2fa/webauthn/enable

SMS 2FA requires a verified phone and is unavailable while magic-link login is enabled (SMS_2FA_UNAVAILABLE). Enabling WebAuthn 2FA requires an already registered passkey (NO_PASSKEYS otherwise); it does not start passkey registration or return a registration challenge.