List all system users

Shows a list of non-researchers.

{info} Only an admin can list system users


Method Uri Auth Role
GET /v1/users Bearer JWT-Token admin

Headers

The API requires a header Accept to be submitted with the request:

{
    "Accept": "application/json",
    "Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3M..." 
}

Success Responses

Condition : User must be an admin.

Code : 200 Okay

Content example : Response will reflect back the created requests.

[
  {
    "id": "2a7eb581-4ccf-4f77-adb6-b2c36b34d6f5",
    "firstName": ...,
    "lastName": ...,
    "email": ...,
    "position": null,
    "institute": null,
    "address": null,
    "postal": null,
    "phone": null,
    "roles": [
      {
        "name": "admin",
        "guard_name": "api",
        "pivot": {
          "model_id": "2a7eb581-4ccf-4f77-adb6-b2c36b34d6f5",
          "role_id": 1,
          "model_type": "App\Models\User"
        }
      }
    ]
  },
  {
    "id": "6b30ff29-cdaf-4798-9c59-72ae1880b159",
    "firstName": "Firstname",
    "lastName": "Firstname",
    ...
    "roles": [
      {
        "name": "admin",
        "guard_name": "api",
        "pivot": {
          "model_id": "6b30ff29-cdaf-4798-9c59-72ae1880b159",
          "role_id": 1,
          "model_type": "App\Models\User"
        }
      }
    ]
  },
  ...
]

Error Responses

Condition : If the current user does not have the role admin attached.

Code : 403 Forbidden

Content example :

{
  "message": "This action is unauthorized."
}