Account Users
How to administer your accounts users
Let’s start by creating a new user:
POST /users
Output:
User Creation Fields
When creating a user, you can specify the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | The user’s email address (must be valid) |
name | string | No | The user’s full name |
teamId | number | No | ID of the team the user belongs to |
phone | string | No | The user’s phone number |
imgSrc | string | No | URL to the user’s profile image |
notificationPreferences | object | No | User’s notification preferences |
roles | array | No | Array of role names to assign to the user |
Assigning Roles During User Creation
You can now assign roles to a user directly during creation by including a roles array in the request body. This simplifies user setup by eliminating the need for a separate role assignment request.
The roles array should contain the names of the roles you want to assign to the user. These roles must already exist in your account.
{ "email": "newuser@test.com", "name": "John Doe", "roles": ["user", "agent"]}Listing all users
GET /users
Output:
Impersonating Users
POST /users/{email}/impersonate
Output:
Setting Passwords
You can set passwords for your users manually if necessary, although its recommended to send them a password reset… or users can request a password reset themselves.
POST /auth/admin-force-set-password
Output:
Delete a User
DELETE /users/{email}
Output:
References
For more info see the API Reference section on these items:
POST /users/{email}/impersonate