Skip to content

User

A User is an account that can sign in to 4HSE.

Do not confuse it with Person, which is a worker recorded for safety compliance: a person does not necessarily have an account, and an account does not necessarily belong to a worker of the company. Compliance data hangs off Person, not off User.

Access is granted to a user through roles, groups and permissions.

Use this API to:

  • Register a new account and update its details
  • Search accounts
  • Remove an account
Version
2.0.0
OpenAPI version
3.0.0

Security scheme type: oauth2

Flow type: password

Token URL: https://auth.4hse.com/realms/4hse/protocol/openid-connect/token

Security scheme type: apiKey

Query parameter name: access-token

POST
/v2/user/index

Returns a paginated and filterable list of users.
Use POST to allow complex filters via JSON payload.

Parameters for searching users

object
filter
object
user_id

The unique identifier for the user (email address).

string format: email
username

The username of the user.

string
email

The email address of the user.

string
status

The current status of the user (e.g., active, inactive, etc.).

string
created_at

The timestamp when the user was created.

integer
updated_at

The timestamp when the user was last updated.

integer
per-page
integer
default: 100 >= 1
page
integer
default: 1 >= 1
sort

Field to sort by. Prefix with minus for descending order (e.g. -username).

string
Allowed values: username email status
Example
{
"filter": {
"username": "john.doe",
"status": "active"
},
"per-page": 10,
"page": 1,
"sort": "username"
}

List of users

Array<object>
object
user_id

The unique identifier for the user (email address).

string format: email
username

The username of the user.

string
email

The email address of the user.

string
status

The current status of the user (e.g., active, inactive, etc.).

string
created_at

The timestamp when the user was created.

integer
updated_at

The timestamp when the user was last updated.

integer
Example
{
"user_id": "user-1",
"username": "john.doe",
"email": "john.doe@example.com",
"status": "active",
"created_at": 1700000000,
"updated_at": 1700000001
}
X-Pagination-Current-Page
integer

Current page

X-Pagination-Page-Count
integer

Total number of pages

X-Pagination-Per-Page
integer

Number of items per page

X-Pagination-Total-Count
integer

Total number of items

GET
/v2/user/view/{id}

Retrieve a user by its unique ID.

id
required
string format: uuid

ID of the user to retrieve

User found

object
user_id

The unique identifier for the user (email address).

string format: email
username

The username of the user.

string
email

The email address of the user.

string
status

The current status of the user (e.g., active, inactive, etc.).

string
created_at

The timestamp when the user was created.

integer
updated_at

The timestamp when the user was last updated.

integer
Example
{
"user_id": "user-1",
"username": "john.doe",
"email": "john.doe@example.com",
"status": "active",
"created_at": 1700000000,
"updated_at": 1700000001
}

User not found

PUT
/v2/user/update/{id}

Update an existing user by its unique ID.

id
required
string format: uuid

ID of the user to update

User object with updated data

object
user_id

The unique identifier for the user (email address).

string format: email
username

The username of the user.

string
password_hash

The hashed password for the user.

string
password_reset_token

The token used to reset the user’s password (optional).

string
nullable
email

The email address of the user.

string
auth_key

The authentication key used for the user’s sessions.

string
status

The current status of the user (e.g., active, inactive, etc.).

string
created_at

The timestamp when the user was created.

integer
updated_at

The timestamp when the user was last updated.

integer
password

The user’s password, which is write-only and not retrievable.

string
Example
{
"email": "john.doe@newmail.com",
"status": "inactive"
}

User updated successfully

object
user_id

The unique identifier for the user (email address).

string format: email
username

The username of the user.

string
password_hash

The hashed password for the user.

string
password_reset_token

The token used to reset the user’s password (optional).

string
nullable
email

The email address of the user.

string
auth_key

The authentication key used for the user’s sessions.

string
status

The current status of the user (e.g., active, inactive, etc.).

string
created_at

The timestamp when the user was created.

integer
updated_at

The timestamp when the user was last updated.

integer
password

The user’s password, which is write-only and not retrievable.

string
Example
{
"user_id": "user-1",
"email": "john.doe@newmail.com",
"status": "inactive"
}

User not found

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.