Actions35
- File Actions
- Folder Actions
- Room Actions
- User Actions
User → Update User
AI-generatedSummary
Changes the account type (role) of an existing ONLYOFFICE DocSpace user, then returns the user's updated record. The node checks the caller's and target's current types first, and errors if the transition isn't allowed.
Inputs
- authentication (required) — Auth method: API Key, Basic Auth, OAuth2 or Personal Access Token. Determines which credential is used.
- userId (required) — The user to update. Pick from a searchable list of users, or enter the ID manually.
- type — The new user type: Room Admin (1), Guest (2), DocSpace Admin (3) or User (4). Defaults to Guest (2). If it is empty or falsy, no change is made and the current user record is returned.
Output shape
One item per input item, containing the user's record as returned by DocSpace (GET api/2.0/people/{userId}) after the update.
The node fetches the authenticated user (people/@self) and the target user to work out their current types. It then calls POST api/2.0/people/type or PUT api/2.0/people/type/{type}, depending on the transition. If the transition isn't supported or the caller lacks permission, it throws 'Insufficient permissions or unsupported employee type transition'. The owner's type can't be set. With Continue On Fail enabled, a failed item returns {error: message}.
Examples
Example 1: Promote a regular user to Room Admin when an onboarding form is approved.
Resource: User; Operation: Update User; User ID: select the user or pass an expression with the ID; Type: Room Admin.
Example 2: Downgrade a collaborator to Guest after a contract ends.
User ID by expression from a previous node; Type: Guest. Requires the credentials to belong to an owner or DocSpace admin.