Users list


Request description

Endpoint: /users/list/:limit/:lastUserId
Method: GET

The following parameters can be passed through the URL:

  • limit: specifies the maximum number of users to return in the query
  • lastUserId: specifies the identifier of the last userId returned. This parameter is used if pagination is to be performed.
{
  "Content-Type": "application/json",
  "Authorization": "Bearer <accessToken>"
}

Note: the <accessToken> is obtained as a result of the authentication

Responses

Correct response

Successful request

Describe the characteristics of a satisfactory response

200

Response structure:

type ListUsersResponseType = {
  users: IUser[] //  List of users related to the query
}

Below we will describe the structure of the IUser interface:
interface IUser = {
   id: string, // Unique user identifier
   fullName: string, // User fullname
   userType: UserType, // User role in the organization
   lastLogin: number, // Timestamp related to the user's last login
   createdAt: number, // Timestamp related to the user creation time
   groupId: string // Group ID related to the user
}

type UserType = 'ORGANIZATION_OWNER' | 'ORGANIZATION_ADMIN' | 'REGULAR'

Wrong responses

Unauthorized request

Describe the characteristics of an unauthorized request

401

Response body

{
  // empty body
}

Description: this error occurs when endpoint authorizers fail to validate the token sent in the request header.

Bad request

Describe the characteristics of a bad request

400


Response body

type ListUsersResponseType = {
    errorType: LIST_USERS_ERROR_TYPE,
    errorMessage?: string
}

enum LIST_USERS_ERROR_TYPE {
    INVALID_LIMIT_VALUE = 'invalidLimitValue'
}