> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/action-center/google-workspace/update-role.md).

# Update Role

Changes the name, description or privileges of one existing Google Workspace admin role. System roles cannot be updated. It runs once and does not use the matched assets.

### Before you begin

* A Google service account with domain-wide delegation enabled. Paste the content of its JSON key file into **Service Account Key**.
* The email of a Workspace admin user for the job to impersonate (**Workspace Admin Email**).
* The service account must be authorized for the OAuth scope `https://www.googleapis.com/auth/admin.directory.rolemanagement` in the domain-wide delegation settings of your Google Workspace.
* Asset type: the job only accepts **User**, but it does not read any asset data.
* Defaults: you can save the connection fields once under **Action Center** > **Settings** > **Google Workspace** (each job has its own tab). See [Action Center Settings](broken://pages/463cb9354fc80aafe89eadc3c2511cf858c22856).

### Settings

| Setting               | Type             | Required | Default | Description                                                                                                                  |
| --------------------- | ---------------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- |
| Service Account Key   | Text (sensitive) | Yes      | None    | Content of the Google service account JSON key file, with domain-wide delegation enabled. Masked after saving.               |
| Workspace Admin Email | Email            | Yes      | None    | Email of the admin user to impersonate through domain-wide delegation.                                                       |
| Role ID               | Text             | Yes      | None    | ID of the admin role to update.                                                                                              |
| Role Name             | Text             | No       | None    | New name for the admin role.                                                                                                 |
| Role Description      | Text             | No       | None    | New description for the admin role.                                                                                          |
| Role Privileges       | JSON             | No       | None    | New privileges of the role as a JSON list. Example: `[{"privilegeName": "USERS_RETRIEVE", "serviceId": "00haapch16h1ysv"}]`. |
| Request Timeout       | Number           | No       | 30      | Timeout in seconds for API requests.                                                                                         |

### How it works

* The job sends one PATCH request to the role's endpoint with only the fields you filled in. If **Role Privileges** is filled in it must be a JSON list.
* At least one of **Role Name**, **Role Description** or **Role Privileges** must be filled in. If all are empty the job fails with `At least one of role name, description or privileges must be provided.`
* The job does not check whether the role is a system role. Google rejects the request, and the rejection is only written to the log.
* It does not read any asset data. If Google rejects the request (HTTP status 400 or higher) the job writes the status and response to the log, and the node does not fail. If the access token request fails (for example a wrong key or missing delegation), the job fails.
* The job passes on all assets it received, unchanged, through the **NEXT** edge.

This job is one of the Google Workspace jobs. To create a role, use [Create Role](broken://pages/20c54deff18f497bff7168bc561ac05133c3b76e).

### Example

```
Job: Google Workspace - Update Role
Role ID: YOUR_ROLE_ID
Role Description: Read only access for the helpdesk
```

### What's next?

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>About Action Center</strong></td><td>Workflows, triggers, conditions and job nodes.</td><td><a href="broken://pages/b6784ce27913947f154229ea6e014c1e567d94fc">Broken link</a></td></tr><tr><td><strong>Action Center Settings</strong></td><td>Save connection defaults for Google Workspace jobs.</td><td><a href="broken://pages/463cb9354fc80aafe89eadc3c2511cf858c22856">Broken link</a></td></tr><tr><td><strong>Create Role</strong></td><td>Create a new role.</td><td><a href="broken://pages/20c54deff18f497bff7168bc561ac05133c3b76e">Broken link</a></td></tr></tbody></table>
