Create and invite a new user
client.viewer.users.invite(UserInviteParams { canManageStudies, clinicRole, email, 8 more } body, RequestOptionsoptions?): UserInviteResponse { canManageStudies, clinicRole, createdAt, 12 more }
/v1/viewer/users
Creates a new user in the Viewer system and sends them an invitation email. The user will have the specified permissions and access level. Dashboard access can be enabled to allow login.
Parameters
Returns
Create and invite a new user
import Avara from 'avara';
const client = new Avara({
apiKey: process.env['AVARA_API_KEY'], // This is the default and can be omitted
});
const response = await client.viewer.users.invite({
canManageStudies: true,
clinicRole: 'Radiologist',
email: 'dr.johnson@hospital.org',
firstName: 'Sarah',
hasDashboardAccess: true,
lastName: 'Johnson',
level: 'member',
});
console.log(response.middleName);
{
"canManageStudies": true,
"clinicRole": "Radiologist",
"createdAt": "2024-01-15T10:00:00Z",
"email": "dr.johnson@hospital.org",
"firstName": "Sarah",
"hasDashboardAccess": true,
"invitedSource": "api",
"lastLoginAt": "2024-03-15T09:00:00Z",
"lastName": "Johnson",
"level": "member",
"userId": "usr_1234567890abcdef1234567890abcdef",
"middleName": "Marie",
"phoneNumber": "5551234567",
"suffix1": "MD",
"suffix2": "FACR"
}
Returns Examples
{
"canManageStudies": true,
"clinicRole": "Radiologist",
"createdAt": "2024-01-15T10:00:00Z",
"email": "dr.johnson@hospital.org",
"firstName": "Sarah",
"hasDashboardAccess": true,
"invitedSource": "api",
"lastLoginAt": "2024-03-15T09:00:00Z",
"lastName": "Johnson",
"level": "member",
"userId": "usr_1234567890abcdef1234567890abcdef",
"middleName": "Marie",
"phoneNumber": "5551234567",
"suffix1": "MD",
"suffix2": "FACR"
}