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. Positive integer
  • lastUserId: specifies the identifier of the last userId returned. This parameter is used if pagination is to be performed. Requires limit

Both parameters are optional. Without limit, all the users of the organization are returned.

{
  "Content-Type": "application/json",
  "Authorization": "Bearer <accessToken>"
}

Note: the <accessToken> is obtained as a result of the authentication. The authentication flow you have to follow depends on the access mode, see Access modes.

Access modes

This endpoint accepts two kinds of access token. The users you get back, and their structure, depend on which one you use:

Access tokenReturns the users ofPaginated
Platform userYour platform organizationYes
Dictation serviceYour organization's corporate dictation serverNo
How to get the dictation service token: the dictation path does not use the token returned by User login. Its access token is generated exactly the same way as the AI Services access tokens: with your APP Id and API Key encoded in base64 (appId:apiKey) and sent as Basic <token> to the /api/v1/token endpoint. See AI Services — Credentials for the full procedure and code examples.

Platform user

Returns a page of users. Use limit to set the page size and lastUserId to continue from the last user you received. When a page returns fewer users than limit, there are no more pages.

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
   email: string, // User email
   userType: UserType, // User role in the organization
   lastLogin?: string, // Timestamp (ms) of the user's last login, sent as a numeric string, e.g. "1790861416924". Not present if the user has never logged in
   createdAt: number, // Timestamp (ms) of the user creation time, sent as a number
   groupId: string // Group ID related to the user. "NOT-DEFINED" when the user has no group
}

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

Dictation user

Returns every user of the corporate dictation server of the organization associated with your credentials.

Pagination is not available

limit and lastUserId are accepted but ignored: the complete list is always returned in a single response. If you need pages, split the result on your side.

Response structure

type ListDictationUsersResponseType = {
  users: DictationUser[]; // Complete list of dictation server users
};

Below we will describe the structure of the DictationUser interface:

interface DictationUser = {
   login: string, // Unique login, used to update or delete the user
   name: string, // User full name
   email: string, // User email
   organization: string, // Free-text organization label
   specialtyCode: string, // Speciality code
   rolType: number, // License type assigned by the platform
   active: boolean // Whether the user can sign in
}

login is the value you have to send in the URL of Edit user and Delete user.

See Invite user for details about specialtyCode. rolType is read only: it is assigned by the platform and cannot be set through this API.


Responses

Correct response

Successful request — platform user

Describe the characteristics of a satisfactory response

200

Response body example:

{
  "users": [
    {
      "id": "mock-user-id",
      "fullName": "mock-full-name",
      "email": "mock@mock.com",
      "userType": "REGULAR",
      "lastLogin": "1700000000000",
      "createdAt": 1690000000000,
      "groupId": "mock-group-id"
    }
  ]
}


Successful request — dictation user

Describe the characteristics of a satisfactory response

200

Response body example:

{
  "users": [
    {
      "login": "jperez",
      "name": "Juan Perez",
      "email": "jperez@hospital.com",
      "organization": "Hospital X",
      "specialtyCode": "1",
      "rolType": 2,
      "active": true
    }
  ]
}
Description: an organization with no users returns { "users": [] }.

Wrong responses

Unauthorized request

Describe the characteristics of an unauthorized request

401

Response body

{
  "message": "Unauthorized"
}

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


Bad request — platform user

Describe the characteristics of a bad request

400

Response body

type ListUsersResponseType = {
  errorType: LIST_USERS_ERROR_TYPE;
  errorMessage: string;
  message?: string;
  details?: object[];
};

enum LIST_USERS_ERROR_TYPE {
  INVALID_LIMIT_VALUE = "invalidLimitValue", // limit is not a positive integer
  INVALID_USER_ID = "invaliduSERId",         // lastUserId is not a valid user identifier (the value is spelled exactly like this)
}
Response body example:
{
  "errorMessage": "Invalid limit",
  "message": "Invalid limit",
  "errorType": "invalidLimitValue",
  "details": [
    /* validation detail */
  ]
}


Forbidden — dictation user

Describe the characteristics of a forbidden request

403

Response body

{
  "message": "Forbidden"
}
Description: your credentials are not allowed to manage dictation users.Response body
{
  "message": "Dictation server rejected the operation"
}
Description: the dictation server refused the request.


Not found — dictation user

Describe the characteristics of a not found request

404

Response body

{
  "message": "Tenant not found"
}

Description: there is no dictation server for your organization in this environment.


Dictation server unavailable

Describe the characteristics of an unreachable dictation server

502

Response body

{
  "message": "Dictation server unavailable"
}

Description: the dictation server could not return the list.


Dictation server timeout

Describe the characteristics of a dictation server that does not answer in time

504

Response body

{
  "message": "Dictation server did not respond in time"
}

Description: the dictation server did not answer within the allowed time.