Create and invite a new user
viewer.users.invite(UserInviteParams**kwargs) -> UserInviteResponse
/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
email: str
User's email address for login and notifications
first_name: str
User's first name
minLength1
last_name: str
User's last name
minLength1
middle_name: Optional[str]
User's middle name (optional)
minLength1
phone_number: Optional[str]
User's phone number (10-15 digits, optional)
suffix1: Optional[str]
Name suffix (e.g., 'Jr.', 'Sr.', 'III') - optional
minLength1
suffix2: Optional[str]
Additional name suffix (optional)
minLength1
Returns
Create and invite a new user
import os
from avara import Avara
client = Avara(
api_key=os.environ.get("AVARA_API_KEY"), # This is the default and can be omitted
)
response = client.viewer.users.invite(
can_manage_studies=True,
clinic_role="Radiologist",
email="dr.johnson@hospital.org",
first_name="Sarah",
has_dashboard_access=True,
last_name="Johnson",
level="member",
)
print(response.middle_name)
{
"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"
}