Skip to content
Get started

Create and invite a new user

client.viewer.users.invite(UserInviteParams { canManageStudies, clinicRole, email, 8 more } body, RequestOptionsoptions?): UserInviteResponse { canManageStudies, clinicRole, createdAt, 12 more }
POST/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.

ParametersExpand Collapse
body: UserInviteParams { canManageStudies, clinicRole, email, 8 more }
canManageStudies: boolean
clinicRole: ClinicRole

A user's clinical or organizational role within the clinic.

Accepts one of the following:
"Doctor"
"Physician"
"Surgeon"
"Radiologist"
"Cardiologist"
"Neurologist"
"Urologist"
"Gynecologist"
"Endocrinologist"
"Oncologist"
"Radiation Oncologist"
"Hematologist"
"Gastroenterologist"
"Pulmonologist"
"Nephrologist"
"Rheumatologist"
"Dermatologist"
"Ophthalmologist"
"Otolaryngologist"
"Pediatrician"
"Obstetrician"
"Psychiatrist"
"Anesthesiologist"
"Emergency Medicine Physician"
"Family Medicine Physician"
"Internal Medicine Physician"
"Pathologist"
"Nuclear Medicine Physician"
"Pain Management Specialist"
"Infectious Disease Specialist"
"Immunologist"
"Physician Assistant"
"Nurse Practitioner"
"Certified Registered Nurse Anesthetist"
"Psychologist"
"Medical Assistant"
"Scribe"
"Registered Nurse"
"Nurse Manager"
"Patient Care Coordinator"
"Imaging Technologist"
"Laboratory Technician"
"Medical Laboratory Scientist"
"Pathologists' Assistant"
"Phlebotomist"
"Pharmacist"
"Pharmacy Technician"
"Physical Therapist"
"Occupational Therapist"
"Speech-Language Pathologist"
"Respiratory Therapist"
"Nutritionist"
"Front Desk Operator"
"Revenue Cycle Manager"
"Administrative Director"
"Administrative Assistant"
"Legal Administrator"
"IT Administrator"
"IT Support"
"Software Engineer"
"Other"
email: string

User's email address for login and notifications

firstName: string

User's first name

minLength1
hasDashboardAccess: boolean
lastName: string

User's last name

minLength1

User access level assignable via the API. 'admin' can manage users/settings, 'member' has standard access. 'owner' is dashboard-only and cannot be assigned via the API.

Accepts one of the following:
"admin"
"member"
middleName?: string

User's middle name (optional)

minLength1
phoneNumber?: string

User's phone number (10-15 digits, optional)

suffix1?: string

Name suffix (e.g., 'Jr.', 'Sr.', 'III') - optional

minLength1
suffix2?: string

Additional name suffix (optional)

minLength1
ReturnsExpand Collapse
UserInviteResponse { canManageStudies, clinicRole, createdAt, 12 more }

Response for inviting a user to Viewer. Level is restricted to admin/member since owners cannot be invited via API.

canManageStudies: boolean

Whether the user has permission to create, update, and manage studies

clinicRole: ClinicRole

A user's clinical or organizational role within the clinic.

Accepts one of the following:
"Doctor"
"Physician"
"Surgeon"
"Radiologist"
"Cardiologist"
"Neurologist"
"Urologist"
"Gynecologist"
"Endocrinologist"
"Oncologist"
"Radiation Oncologist"
"Hematologist"
"Gastroenterologist"
"Pulmonologist"
"Nephrologist"
"Rheumatologist"
"Dermatologist"
"Ophthalmologist"
"Otolaryngologist"
"Pediatrician"
"Obstetrician"
"Psychiatrist"
"Anesthesiologist"
"Emergency Medicine Physician"
"Family Medicine Physician"
"Internal Medicine Physician"
"Pathologist"
"Nuclear Medicine Physician"
"Pain Management Specialist"
"Infectious Disease Specialist"
"Immunologist"
"Physician Assistant"
"Nurse Practitioner"
"Certified Registered Nurse Anesthetist"
"Psychologist"
"Medical Assistant"
"Scribe"
"Registered Nurse"
"Nurse Manager"
"Patient Care Coordinator"
"Imaging Technologist"
"Laboratory Technician"
"Medical Laboratory Scientist"
"Pathologists' Assistant"
"Phlebotomist"
"Pharmacist"
"Pharmacy Technician"
"Physical Therapist"
"Occupational Therapist"
"Speech-Language Pathologist"
"Respiratory Therapist"
"Nutritionist"
"Front Desk Operator"
"Revenue Cycle Manager"
"Administrative Director"
"Administrative Assistant"
"Legal Administrator"
"IT Administrator"
"IT Support"
"Software Engineer"
"Other"
createdAt: string | null

Timestamp when the user was created

formatdate-time
email: string

User's email address for login and notifications

firstName: string

User's first name

minLength1
hasDashboardAccess: boolean

Whether the user can access the dashboard interface. Required for admin users

invitedSource: InvitedSource

How a user/invitation was created - via the dashboard UI ('dashboard') or the API ('api').

Accepts one of the following:
"dashboard"
"api"
lastLoginAt: string | null

Timestamp of user's last login, null if never logged in

formatdate-time
lastName: string

User's last name

minLength1

User access level assignable via the API. 'admin' can manage users/settings, 'member' has standard access. 'owner' is dashboard-only and cannot be assigned via the API.

Accepts one of the following:
"admin"
"member"
userId: string

Unique user identifier. Format: usr_{32-hex-chars}

middleName?: string

User's middle name (optional)

minLength1
phoneNumber?: string

User's phone number (10-15 digits, optional)

suffix1?: string

Name suffix (e.g., 'Jr.', 'Sr.', 'III') - optional

minLength1
suffix2?: string

Additional name suffix (optional)

minLength1

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"
}