Skip to main content
Manage who can use a workspace from code: list its members, former members, and invitees, invite people with a role, change roles, deactivate and reactivate members, and set the email domains whose users join without an invitation.
Prerequisites:
  • These operations are available on every plan.
  • An account API key with the X-Paradime-Workspace header, or a workspace API key.
  • The User access admin capability group. To only list users and read auto-join domains, User access viewer is enough.
Keys, errors, and pagination work the same in every area. See Conventions.

Operations

For new code, use these operations rather than listUsers, inviteUser, updateUserAccountType, and disableUser from the User Management API. The new ones report errors with a code, page their results, filter by status, and can reactivate a user. The older operations keep working, with the User management admin and User metadata viewer groups. Those groups don’t grant the new operations.

List users

users lists the people of the targeted workspace, ordered by email, then status. status is ACTIVE for a member who can sign in, INVITED for someone who hasn’t signed up yet, and DEACTIVATED for a former member. Pass status to list only some of them: every status is listed when you leave it out. An invitee has no uid, and inviteStatus says whether their invitation link still works (PENDING) or not (EXPIRED). For everyone else, uid is the id that updateUser, deactivateUser, and reactivateUser take.

Invite a user

createUser invites a person to the targeted workspace with a role, and sends them the invitation email. The invitee then appears in users as INVITED, with a PENDING invitation.
  • An email that belongs to a member, a former member, or a pending invitation is a CONFLICT. To bring back a former member, use reactivateUser.
  • An expired invitation is not a conflict: call createUser again to send a new one.
An API key can give the roles an Admin can give, except SANDBOX_USER: ADMIN, DEVELOPER, BUSINESS, BILLING_ADMIN, SECURITY_ADMIN, WORKSPACE_SETTINGS_ADMIN, WORKSPACE_ADMIN, and ANALYST. Without role-based access control, only ADMIN, DEVELOPER, and BUSINESS are offered. Any other role is VALIDATION_FAILED.

Change a role, deactivate, or reactivate a user

Each of these takes the user’s uid.
  • updateUser changes the role of an active member. Giving a user the role they hold is not an error. A deactivated user is a CONFLICT: reactivate them first.
  • deactivateUser deactivates a member: they can no longer sign in to the workspace. Deactivating a former member is not an error.
  • reactivateUser brings back a former member, with the role they had. Reactivating an active member is not an error. If an API key can’t give the user’s role, the call is VALIDATION_FAILED: reactivate them in Paradime.
To reactivate the same user, send the same input to reactivateUser:

Set auto-join domains

With auto-join, people whose email is at one of the workspace’s domains join it when they sign in, without an invitation. setAutoJoinDomains replaces the full set of domains. Domains are matched in lowercase. An empty list turns auto-join off.
Workspace.autoJoinDomains returns the domains in lowercase, sorted.

Errors

These are the cases specific to users. For the error format and the codes every area shares, see Errors.