Skip to content
Get started

Create and invite a new user

UserInviteResponse viewer().users().invite(UserInviteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
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
UserInviteParams params
boolean canManageStudies
ClinicRole clinicRole

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

String email

User's email address for login and notifications

String firstName

User's first name

minLength1
boolean hasDashboardAccess
String lastName

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.

Optional<String> middleName

User's middle name (optional)

minLength1
Optional<String> phoneNumber

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

Optional<String> suffix1

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

minLength1
Optional<String> suffix2

Additional name suffix (optional)

minLength1
ReturnsExpand Collapse
class UserInviteResponse:

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

boolean canManageStudies

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("Doctor")
PHYSICIAN("Physician")
SURGEON("Surgeon")
RADIOLOGIST("Radiologist")
CARDIOLOGIST("Cardiologist")
NEUROLOGIST("Neurologist")
UROLOGIST("Urologist")
GYNECOLOGIST("Gynecologist")
ENDOCRINOLOGIST("Endocrinologist")
ONCOLOGIST("Oncologist")
RADIATION_ONCOLOGIST("Radiation Oncologist")
HEMATOLOGIST("Hematologist")
GASTROENTEROLOGIST("Gastroenterologist")
PULMONOLOGIST("Pulmonologist")
NEPHROLOGIST("Nephrologist")
RHEUMATOLOGIST("Rheumatologist")
DERMATOLOGIST("Dermatologist")
OPHTHALMOLOGIST("Ophthalmologist")
OTOLARYNGOLOGIST("Otolaryngologist")
PEDIATRICIAN("Pediatrician")
OBSTETRICIAN("Obstetrician")
PSYCHIATRIST("Psychiatrist")
ANESTHESIOLOGIST("Anesthesiologist")
EMERGENCY_MEDICINE_PHYSICIAN("Emergency Medicine Physician")
FAMILY_MEDICINE_PHYSICIAN("Family Medicine Physician")
INTERNAL_MEDICINE_PHYSICIAN("Internal Medicine Physician")
PATHOLOGIST("Pathologist")
NUCLEAR_MEDICINE_PHYSICIAN("Nuclear Medicine Physician")
PAIN_MANAGEMENT_SPECIALIST("Pain Management Specialist")
INFECTIOUS_DISEASE_SPECIALIST("Infectious Disease Specialist")
IMMUNOLOGIST("Immunologist")
PHYSICIAN_ASSISTANT("Physician Assistant")
NURSE_PRACTITIONER("Nurse Practitioner")
CERTIFIED_REGISTERED_NURSE_ANESTHETIST("Certified Registered Nurse Anesthetist")
PSYCHOLOGIST("Psychologist")
MEDICAL_ASSISTANT("Medical Assistant")
SCRIBE("Scribe")
REGISTERED_NURSE("Registered Nurse")
NURSE_MANAGER("Nurse Manager")
PATIENT_CARE_COORDINATOR("Patient Care Coordinator")
IMAGING_TECHNOLOGIST("Imaging Technologist")
LABORATORY_TECHNICIAN("Laboratory Technician")
MEDICAL_LABORATORY_SCIENTIST("Medical Laboratory Scientist")
PATHOLOGISTS_ASSISTANT("Pathologists' Assistant")
PHLEBOTOMIST("Phlebotomist")
PHARMACIST("Pharmacist")
PHARMACY_TECHNICIAN("Pharmacy Technician")
PHYSICAL_THERAPIST("Physical Therapist")
OCCUPATIONAL_THERAPIST("Occupational Therapist")
SPEECH_LANGUAGE_PATHOLOGIST("Speech-Language Pathologist")
RESPIRATORY_THERAPIST("Respiratory Therapist")
NUTRITIONIST("Nutritionist")
FRONT_DESK_OPERATOR("Front Desk Operator")
REVENUE_CYCLE_MANAGER("Revenue Cycle Manager")
ADMINISTRATIVE_DIRECTOR("Administrative Director")
ADMINISTRATIVE_ASSISTANT("Administrative Assistant")
LEGAL_ADMINISTRATOR("Legal Administrator")
IT_ADMINISTRATOR("IT Administrator")
IT_SUPPORT("IT Support")
SOFTWARE_ENGINEER("Software Engineer")
OTHER("Other")
Optional<LocalDateTime> createdAt

Timestamp when the user was created

formatdate-time
String email

User's email address for login and notifications

String firstName

User's first name

minLength1
boolean hasDashboardAccess

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("dashboard")
API("api")
Optional<LocalDateTime> lastLoginAt

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

formatdate-time
String lastName

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("admin")
MEMBER("member")
String userId

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

Optional<String> middleName

User's middle name (optional)

minLength1
Optional<String> phoneNumber

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

Optional<String> suffix1

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

minLength1
Optional<String> suffix2

Additional name suffix (optional)

minLength1

Create and invite a new user

package com.avara.example;

import com.avara.client.AvaraClient;
import com.avara.client.okhttp.AvaraOkHttpClient;
import com.avara.models.AssignableUserLevel;
import com.avara.models.ClinicRole;
import com.avara.models.viewer.users.UserInviteParams;
import com.avara.models.viewer.users.UserInviteResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        AvaraClient client = AvaraOkHttpClient.fromEnv();

        UserInviteParams params = UserInviteParams.builder()
            .canManageStudies(true)
            .clinicRole(ClinicRole.RADIOLOGIST)
            .email("dr.johnson@hospital.org")
            .firstName("Sarah")
            .hasDashboardAccess(true)
            .lastName("Johnson")
            .level(AssignableUserLevel.MEMBER)
            .build();
        UserInviteResponse response = client.viewer().users().invite(params);
    }
}
{
  "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"
}