GET /users

Request parameters

ParameterTypeDescription
userIdsarray [string]If provided only this user(s) will be returned.

If not provided all user(s) which authenticated user is allowed to see will be retrieved.

If id is provided which authenticated user is not allowed to see, then 401 code will be returned.
organizationNamestringIf provided only users which are assigned to this specific organizationName will be returned.

If not provided all users within all organization units will be retrieved which authenticated user is allowed to see.

If provided together with organizationId then organizationName will be ignored.

If name is provided which authenticated user is not allowed to see, then 401 code will be returned.
organizationIdstringIf provided only users which are assigned to this specific organizationId will be returned.

If not provided all users within all organization units will be retrieved which authenticated user is allowed to see.

If id is provided which authenticated user is not allowed to see, then 401 code will be returned.
rolesarray [string]Possible roles: "employee", "approver", "manager", "administrator", "main_administrator".

If one or many are provided then only users with matching roles will be returned.
inactivebooleanIf "true" is provided only inactive users will be returned. If "false" or nothing is provided only active users will be returned.

Note: A user is inactive if the validTo date is in past.
pageinteger (default 1)Decide which page should be returned.
Note: Maximum of 20 users will be returned per page.

Request example:

https://mctime.com/api/v2/auth/users
//All users which authenticated user is allowed to see will be returned.

https://mctime.com/api/v2/auth/users?userIds=123&userIds=456
//Users with id "123" or "456" will be returned if authenticated user is allowed to see them.

https://mctime.com/api/v2/auth/users?roles=employee
//All users which authenticated user is allowed to see and which have the "employee" role will be returned.

Responses

CodeTitleDescription
200 SuccessReturned if request was successful.
400Bad RequestReturned if request was bad.
401UnauthorizedReturned if request was not authorized (eg. due to bad API key).
404Not FoundReturned if request could not be found.

📘

Users permissions will be considered

The response will consider the permissions of the user who is authenticated by the API call and will only return users which user is allowed to see.

Response JSON example:

{
    "items": [
        {
            "message": "Success",
            "data": {
                "users": [
                    {
                        "id": "123abc45-39c5-436f-a70b-d3a14db753c6",
                        "firstName": "John",
                        "lastName": "Doe",
                        "email": "[email protected]",
                        "mobilePhoneNumber": "+43123123"
                        },
                        {
                        "id": "987abc45-39c5-436f-a70b-d3a14db753c6",
                        "firstName": "Jane",
                        "lastName": "Doe",
                        "email": "[email protected]",
                        "mobilePhoneNumber": "+43987987"
                        }
                ],
                "page": "1", //currently returned page
                "pageSize": "15" //total number of pages
            }
        }
    ],
    "valid": true
}