---
title: "PUT /userprofiles/{+profileId}/userRoles"
method: PUT
path: "/userprofiles/{+profileId}/userRoles"
tags: ["userRoles"]
---

# PUT /userprofiles/{+profileId}/userRoles

`PUT /userprofiles/{+profileId}/userRoles`

Updates an existing user role.

## Path parameters

- `profileId` string, required

## Request body

- UserRole — Contains properties of auser role, which is used to manage user access.
  - `subaccountId` string, int64 — Subaccount ID of this user role. This is a read-only field that can be left blank.
  - `id` string, int64 — ID of this user role. This is a read-only, auto-generated field.
  - `accountId` string, int64 — Account ID of this user role. This is a read-only field that can be left blank.
  - `name` string — Name of this user role. This is a required field. Must be less than 256 characters long. If this user role is under a subaccount, the name must be unique among sites of the same subaccount. Otherwise, this user role is a top-level user role, and the name must be unique among top-level user roles of the same account.
  - `parentUserRoleId` string, int64 — ID of the user role that this user role is based on or copied from. This is a required field.
  - `permissions` UserRolePermission[] — List of permissions associated with this user role.
    - `kind` string — Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolePermission".
    - `availability` 'NOT_AVAILABLE_BY_DEFAULT' | 'ACCOUNT_BY_DEFAULT' | 'SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT' | 'ACCOUNT_ALWAYS' | 'SUBACCOUNT_AND_ACCOUNT_ALWAYS' | 'USER_PROFILE_ONLY' — Levels of availability for a user role permission.
    - `id` string, int64 — ID of this user role permission.
    - `name` string — Name of this user role permission.
    - `permissionGroupId` string, int64 — ID of the permission group that this user role permission belongs to.
  - `defaultUserRole` boolean — Whether this is a default user role. Default user roles are created by the system for the account/subaccount and cannot be modified or deleted. Each default user role comes with a basic set of preassigned permissions.
  - `kind` string — Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRole".

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/dfareporting.md) · [All operations](https://skmtc.net/google/apis/dfareporting/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/dfareporting/versions/8163d57aeb31/schema)
