# Update Workspace Permission Assignment

`PUT /api/2.0/accounts/{account_id}/workspaces/{workspace_id}/permissionassignments/principals/{principal_id}`

Creates or updates the workspace permissions assignment in a given account and workspace for the specified principal.

API scopes: access-management

## Path parameters

- `account_id` (string, optional)
  The account ID.
- `workspace_id` (int64, optional)
  The workspace ID.
- `principal_id` (int64, optional)
  The ID of the user, service principal, or group.

## Request body

- `permissions` (array of string, optional)
  Array of permissions assignments to update on the workspace.
   Valid values are "USER" and "ADMIN" (case-sensitive).
   If both "USER" and "ADMIN" are provided, "ADMIN" takes precedence.
   Other values will be ignored.
   Note that excluding this field, or providing unsupported values, will have the same effect as providing an empty list, which will result in the deletion of all permissions for the principal.
  Possible values: `UNKNOWN`, `USER`, `ADMIN`

## Returns

- `principal` (object, optional)
  Information about the principal assigned to the workspace.
  - `user_name` (string, required)
    The username of the user. Present only if the principal is a user.
  - `group_name` (string, required)
    The group name of the group. Present only if the principal is a group.
  - `service_principal_name` (string, required)
    The name of the service principal. Present only if the principal is a service principal.
  - `principal_id` (int64, optional)
    The unique, opaque id of the principal.
  - `display_name` (string, optional)
    The display name of the principal.
- `permissions` (array of string, optional)
  The permissions level of the principal.
  Possible values: `UNKNOWN`, `USER`, `ADMIN`
- `error` (string, optional)
  Error response associated with a workspace permission assignment, if any.

## Response

```json
{
  "principal": {
    "user_name": "string",
    "group_name": "string",
    "service_principal_name": "string",
    "principal_id": 0,
    "display_name": "string"
  },
  "permissions": [
    "string"
  ],
  "error": "string"
}
```

