/api/v1/user

Manage user accounts. The required rights differ per operation: listing and reading users need only an authenticated session (reading the password hash via include_password requires system.root); creating or updating users is governed by a per-user save-right check (a user may save their own record, but changing a protected field of it — email, _acl, _system_rights, _password, … — still requires the corresponding right); deleting a user requires the system.user system right (or system.root); and changing the password requires the system.user.change_password system right (or system.root). Some properties additionally require system.root.

GET /user — List all users visible to the authenticated user.

List all users visible to the authenticated user.

get

Differs from easydb 5: listing requires only an authenticated session, not the system.user read right. The filter parameter is group_ids (easydb 5: groupids) and the default limit is 100 (easydb 5: default and maximum 1000).

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Query parameters
limitintegerOptional

Maximum number of users to return. Defaults to 100 when omitted or not positive.

Default: 100
offsetintegerOptional

Number of users to skip from the start of the result.

group_idsstringOptional

Comma-separated list of group _ids; returns only users that are members of one of the given groups.

typestringOptional

Comma-separated list of user types to filter by (for example easydb).

changed_sincestringOptional

ISO-8601 timestamp; returns only users whose _updated_at is at or after this time.

archived_sincestringOptional

ISO-8601 timestamp, or the literal null. With null, only non-archived users are returned. Otherwise returns users whose _archived_at is at or after the given time.

include_passwordbooleanOptional

If true, each entry includes the stored password hash (for backup tooling). Requires system.root.

Responses
200

Array of all users visible to the current session.

application/json

A user record. Used as the request and response body of the /api/v1/user* endpoints.

_basetypestring · enumRequired

Fixed marker identifying this object as a user.

Possible values:
_passwordstring · max: 100Optional

Plaintext password (write-only). Set on user creation to seed a password; otherwise use POST /user/change_password. Never echoed back in responses.

_password_hashstringOptional

The stored password hash. Only returned when include_password=true is set and the requester holds system.root — used by backup tooling.

_created_atstring · date-timeOptional

UTC time the user was created.

_updated_atstring · date-timeOptional

UTC time the user was last updated.

_archived_atstring · date-timeOptional

UTC time the user was archived. Archived users cannot sign in (login fails with LoginUserArchived) and cannot be modified.

_last_seen_atstring · date-timeOptional

UTC time of the user's most recent activity.

POST /user — Create or update one or more users.

Create or update one or more users.

post

The payload is an array of user objects. Users with _id set are updated; users without _id are created. The response carries the saved users.

Differs from easydb 5: POST and PUT are aliases and both create and update; create vs. update is decided by the presence of _id. In easydb 5 PUT /api/v1/user only creates, POST /api/v1/user only updates, and an update must carry the current _version.

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Query parameters
confirmstring · enumOptional

Set to ignore_password_requirements to re-submit a request that was answered with a 202 because a password did not satisfy the configured complexity rules, saving the user anyway (see the 202 response).

Possible values:
skip_constraintsbooleanOptional

If true, skip email-format validation on the saved users. Allowed only with system.root; without it the request fails with a 400 (code ServerGeneric).

Bodyobject[]

A user record. Used as the request and response body of the /api/v1/user* endpoints.

_basetypestring · enumRequired

Fixed marker identifying this object as a user.

Possible values:
_passwordstring · max: 100Optional

Plaintext password (write-only). Set on user creation to seed a password; otherwise use POST /user/change_password. Never echoed back in responses.

_password_hashstringOptional

The stored password hash. Only returned when include_password=true is set and the requester holds system.root — used by backup tooling.

_created_atstring · date-timeOptional

UTC time the user was created.

_updated_atstring · date-timeOptional

UTC time the user was last updated.

_archived_atstring · date-timeOptional

UTC time the user was archived. Archived users cannot sign in (login fails with LoginUserArchived) and cannot be modified.

_last_seen_atstring · date-timeOptional

UTC time of the user's most recent activity.

Responses
200

The users were saved.

application/json

A user record. Used as the request and response body of the /api/v1/user* endpoints.

_basetypestring · enumRequired

Fixed marker identifying this object as a user.

Possible values:
_passwordstring · max: 100Optional

Plaintext password (write-only). Set on user creation to seed a password; otherwise use POST /user/change_password. Never echoed back in responses.

_password_hashstringOptional

The stored password hash. Only returned when include_password=true is set and the requester holds system.root — used by backup tooling.

_created_atstring · date-timeOptional

UTC time the user was created.

_updated_atstring · date-timeOptional

UTC time the user was last updated.

_archived_atstring · date-timeOptional

UTC time the user was archived. Archived users cannot sign in (login fails with LoginUserArchived) and cannot be modified.

_last_seen_atstring · date-timeOptional

UTC time of the user's most recent activity.

PUT /user — Create or update one or more users (alias for POST).

Create or update one or more users (alias for POST).

put
Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Query parameters
confirmstring · enumOptional

Set to ignore_password_requirements to re-submit a request that was answered with a 202 because a password did not satisfy the configured complexity rules, saving the user anyway (see the 202 response).

Possible values:
skip_constraintsbooleanOptional

If true, skip email-format validation on the saved users. Allowed only with system.root; without it the request fails with a 400 (code ServerGeneric).

Bodyobject[]

A user record. Used as the request and response body of the /api/v1/user* endpoints.

_basetypestring · enumRequired

Fixed marker identifying this object as a user.

Possible values:
_passwordstring · max: 100Optional

Plaintext password (write-only). Set on user creation to seed a password; otherwise use POST /user/change_password. Never echoed back in responses.

_password_hashstringOptional

The stored password hash. Only returned when include_password=true is set and the requester holds system.root — used by backup tooling.

_created_atstring · date-timeOptional

UTC time the user was created.

_updated_atstring · date-timeOptional

UTC time the user was last updated.

_archived_atstring · date-timeOptional

UTC time the user was archived. Archived users cannot sign in (login fails with LoginUserArchived) and cannot be modified.

_last_seen_atstring · date-timeOptional

UTC time of the user's most recent activity.

Responses
200

The users were saved.

application/json

A user record. Used as the request and response body of the /api/v1/user* endpoints.

_basetypestring · enumRequired

Fixed marker identifying this object as a user.

Possible values:
_passwordstring · max: 100Optional

Plaintext password (write-only). Set on user creation to seed a password; otherwise use POST /user/change_password. Never echoed back in responses.

_password_hashstringOptional

The stored password hash. Only returned when include_password=true is set and the requester holds system.root — used by backup tooling.

_created_atstring · date-timeOptional

UTC time the user was created.

_updated_atstring · date-timeOptional

UTC time the user was last updated.

_archived_atstring · date-timeOptional

UTC time the user was archived. Archived users cannot sign in (login fails with LoginUserArchived) and cannot be modified.

_last_seen_atstring · date-timeOptional

UTC time of the user's most recent activity.

GET /user/session — Information about the current session.

Information about the current session.

get

Returns the access token, the authenticated user, their groups, system rights, the resolved configuration (defaults and base config) and the instance settings. Does not require any specific system right beyond being authenticated. Unlike the other /user operations, an unauthenticated request is rejected with 400 InvalidToken rather than 401.

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Responses
200

The current session.

application/json

A session descriptor — returned by GET /api/v1/user/session. Carries the access token, the authenticated user and their groups, the system rights they hold, available authentication methods, and instance-wide defaults the front end needs to render correctly.

access_tokenstringRequired

The session's access token. Use it as the Bearer token (or in the x-fylr-authorization / Authorization header) for subsequent requests.

frontend_languagestringOptional

The user's preferred UI language as a BCP-47 tag (de-DE, en-US, ...).

current_max_event_idinteger · int64Optional

The latest _id issued in the event log when the session was built. Pass it as fromEventId to /api/v1/event/poll/{fromEventId} to subscribe to subsequent events.

POST /user/change_password — Change the authenticated user's password.

Change the authenticated user's password.

post

Changes the authenticated user's password. The current password (password) must be supplied and is verified; it is always the authenticated user's own password that is changed. Requires the system.user.change_password system right (or system.root). The new password must satisfy the configured complexity rules. On success, the user's existing OAuth2 tokens are invalidated.

The request body is form-encoded (application/x-www-form-urlencoded) or sent as a JSON object; the fields below are read with FormValue.

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Body
new_passwordstringRequired

The new password.

passwordstringRequired

The current password, re-confirmed. Must be non-empty and must match the authenticated user's current password.

Responses
200

Password was changed.

application/json
statusstring · enumRequiredPossible values:

GET /user/{id} — Retrieve a single user by id.

Retrieve a single user by id.

get
Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Path parameters
idinteger · int64 · min: 1Required

The user's _id.

Query parameters
include_passwordbooleanOptional

If true, the response includes the stored password hash (for backup tooling). Requires system.root.

Responses
200

The user, returned as an array with a single element. When the id is well-formed but no user exists, the response is 400 with code UserNotFound (not 404).

application/json

A user record. Used as the request and response body of the /api/v1/user* endpoints.

_basetypestring · enumRequired

Fixed marker identifying this object as a user.

Possible values:
_passwordstring · max: 100Optional

Plaintext password (write-only). Set on user creation to seed a password; otherwise use POST /user/change_password. Never echoed back in responses.

_password_hashstringOptional

The stored password hash. Only returned when include_password=true is set and the requester holds system.root — used by backup tooling.

_created_atstring · date-timeOptional

UTC time the user was created.

_updated_atstring · date-timeOptional

UTC time the user was last updated.

_archived_atstring · date-timeOptional

UTC time the user was archived. Archived users cannot sign in (login fails with LoginUserArchived) and cannot be modified.

_last_seen_atstring · date-timeOptional

UTC time of the user's most recent activity.

DELETE /user/{id} — Delete a user by id.

Delete a user by id.

delete

Removes a user. System users (system:root, system:everybody, ...) cannot be deleted, and the requester cannot delete themselves. The behaviour is selected by delete_policy:

  • delete — hard-deletes the user record. Objects, pools, groups and share links owned by the user are reassigned to the system user system:deleted_user. Irreversible.
  • archive — sets _archived_at and pseudonymizes the user record (name, address, login and email are cleared or randomized per the group's pseudonymization configuration). The user's collections are deleted and cannot be restored. Irreversible.
  • unarchive — restores a previously archived user.

When delete_policy is omitted, the instance's configured default policy applies; if that is ask (or the selection is ambiguous), the endpoint returns a 202 prompting the caller to choose (see below). The deleted, archived or restored user record(s) are returned.

Differs from easydb 5: the caller chooses the outcome explicitly via delete_policy (delete, archive or unarchive), and an omitted policy can yield a 202 prompt. In easydb 5 there is no such parameter — the user "is archived if there has been activity, otherwise deleted", and there is no unarchive via this endpoint.

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Path parameters
idinteger · int64 · min: 1Required

The user's _id.

Query parameters
delete_policystring · enumOptional

How to remove the user. Omit to receive a 202 prompting for the choice (when the configured default policy is ask). See the operation description for the semantics of each value.

Possible values:
confirmstringOptional

Carried by the 202 confirm button. The operative parameter when resolving the 202 is delete_policy.

Responses
200

The affected user record(s), as an array of UserApi.

application/json

A user record. Used as the request and response body of the /api/v1/user* endpoints.

_basetypestring · enumRequired

Fixed marker identifying this object as a user.

Possible values:
_passwordstring · max: 100Optional

Plaintext password (write-only). Set on user creation to seed a password; otherwise use POST /user/change_password. Never echoed back in responses.

_password_hashstringOptional

The stored password hash. Only returned when include_password=true is set and the requester holds system.root — used by backup tooling.

_created_atstring · date-timeOptional

UTC time the user was created.

_updated_atstring · date-timeOptional

UTC time the user was last updated.

_archived_atstring · date-timeOptional

UTC time the user was archived. Archived users cannot sign in (login fails with LoginUserArchived) and cannot be modified.

_last_seen_atstring · date-timeOptional

UTC time of the user's most recent activity.

Last updated