Skip to main content

Users

Get all users

Request

Definition

GET /api/v1/users

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}

Response

Status codes

Status codeMessage
200"List of users"
403"Forbidden"

Body

  • data.users.id string

    User ID.

  • data.users.username string

    Username.

  • data.users.first_name string

    User's first name.

  • data.users.last_name string

    User's last name.

  • data.users.auth_type string

    Authentication type used by user.

  • data.users.is_first_access boolean

    Indicates whether it is the user's first access.

  • data.users.is_disabled boolean

    Indicates whether the user id disabled.

  • data.users.password_updated_at string

    Date of the last password update.

  • data.users.attrs_updated_at string

    Date of last attributes update.

  • data.users.email string

    User's email.

  • data.users.groups array<object>

    List of Groups which the user belongs to.

  • data.users.inserted_at string

    Date of the user insertion.

Get a specific user

Request

Definition

GET /api/v1/users/{id}

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}

Response

Status codes

Status codeMessage
200"User retrieved"
400"Error retrieving user"
403"Forbidden"

Body

{
"data": {
"user": {
"access_limits": null,
"attrs_updated_at": "2024-01-17T13:11:41Z",
"auth_type": "basic",
"email": "test@test.it",
"first_name": "FirstTest",
"groups": [],
"id": "a8axx6e5-xxxxx-4768-xxxx-699xxxx908ab",
"inserted_at": "2024-01-17T13:11:41Z",
"is_disabled": false,
"is_first_access": true,
"last_name": "LastTest",
"password_updated_at": "2024-01-17T13:11:41Z",
"username": "test"
}
},
"message": "User retrieved",
"status": "ok"
}

Create a user

Request

Definition

POST /api/v1/users

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}
  • Content-Type required

    application/json

Request body

{
"user": {
"auth_type": "basic",
"email": "test@test.it",
"first_name": "FirstTest",
"last_name": "LastTest",
"password": "Password",
"password_confirmation": "Password",
"username": "test"
}
}

Response

Status codes

Status codeMessage
200"User created succesfully."
400"Error creating new user."
400"Generic error"
403"Forbidden"

Body

{
"data": {
"user": {
"access_limits": null,
"attrs_updated_at": "2024-01-17T13:11:40Z",
"auth_type": "basic",
"email": "test@test.it",
"first_name": "FirstTest",
"groups": [],
"id": "a8axx6e5-xxxxx-4768-xxxx-699xxxx908ab",
"inserted_at": "2024-01-17T13:11:40Z",
"is_disabled": false,
"is_first_access": true,
"last_name": "LastTest",
"password_updated_at": "2024-01-17T13:11:40Z",
"settings": {
"gui_display_mode": "light",
"timezone": "Europe/Rome"
},
"username": "test"
}
},
"message": "User created succesfully.",
"status": "ok"
}

Update user

Request

Definition

PUT /api/v1/users/{id}

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}
  • Content-Type required

    application/json

Request body

{
"attrs": {
"email": "new_email@test.it"
}
}

Response

Status codes

Status codeMessage
200"User updated succesfully."
400"Error updating the user"
403"Forbidden"

Body

{
"data": {
"user": {
"access_limits": null,
"attrs_updated_at": "2024-01-17T13:11:39Z",
"auth_type": "basic",
"email": "new_email@test.it",
"first_name": "FirstTest",
"groups": [],
"id": "a8axx6e5-xxxxx-4768-xxxx-699xxxx908ab",
"inserted_at": "2024-01-17T13:11:39Z",
"is_disabled": false,
"is_first_access": true,
"last_name": "LastTest",
"password_updated_at": "2024-01-17T13:11:39Z",
"settings": {
"gui_display_mode": "light",
"timezone": "Europe/Rome"
},
"username": "test"
}
},
"message": "User updated succesfully.",
"status": "ok"
}

Change password

Request

Definition

POST /api/v1/users/{id}/change_password

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}
  • Content-Type required

    application/json

Request body

{
"attrs": {
"password": "Password",
"password_confirmation": "Password"
},
"curr_password": "password"
}

Response

Status codes

Status codeMessage
200OK
400"Error updating the password"
400"Error revoking user sessions"
403"Forbidden"

Body

{
"data": {
"user": {
"access_limits": null,
"attrs_updated_at": "2024-01-17T13:11:22Z",
"auth_type": "basic",
"email": "user@seerbox",
"first_name": null,
"groups": [
{
"id": "fd4cxx2e-xxxx-4c34-xxxx-axxxx6abxx6b",
"name": "admins"
}
],
"id": "a8axx6e5-xxxxx-4768-xxxx-699xxxx908ab",
"inserted_at": "2024-01-17T13:11:22Z",
"is_disabled": false,
"is_first_access": false,
"last_name": null,
"password_updated_at": "2024-01-17T13:11:42Z",
"username": "username"
}
},
"message": "Password updated succesfully",
"status": "ok"
}

Reset password

Request

Definition

POST /api/v1/users/{id}/reset_password

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}
  • Content-Type required

    application/json

Request body

{
"attrs": {
"password": "Password",
"password_confirmation": "Password"
}
}

Response

Status codes

Status codeMessage
200"Password reset succesfully"
400"Error resetting the password"
400"Error revoking user sessions"
403"Forbidden"

Body

{
"data": {
"user": {
"access_limits": null,
"attrs_updated_at": "2024-01-17T13:11:38Z",
"auth_type": "basic",
"email": "test@test.it",
"first_name": "FirstTest",
"groups": [],
"id": "a8axx6e5-xxxxx-4768-xxxx-699xxxx908ab",
"inserted_at": "2024-01-17T13:11:38Z",
"is_disabled": false,
"is_first_access": true,
"last_name": "LastTest",
"password_updated_at": "2024-01-17T13:11:38Z",
"settings": {
"gui_display_mode": "light",
"timezone": "Europe/Rome"
},
"username": "test"
}
},
"message": "Password reset succesfully",
"status": "ok"
}

Delete user

Request

Definition

DELETE /api/v1/users/{id}

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}
  • Content-Type required

    application/json

Response

Status codes

Status codeMessage
200"User deleted succesfully."
400"Error deleting the user."
400"Error revoking user sessions"
403"Forbidden"

Body

{
"data": {
"user": {
"access_limits": null,
"attrs_updated_at": "2024-01-17T13:11:36Z",
"auth_type": "basic",
"email": "test@test.it",
"first_name": "FirstTest",
"id": "a8axx6e5-xxxxx-4768-xxxx-699xxxx908ab",
"inserted_at": "2024-01-17T13:11:36Z",
"is_disabled": false,
"is_first_access": true,
"last_name": "LastTest",
"password_updated_at": "2024-01-17T13:11:36Z",
"username": "test"
}
},
"message": "User deleted succesfully.",
"status": "ok"
}