# Update a workspace assignment for a workspace

Launch stage: GA

`PATCH /api/2.0/identity/{name=workspace-assignments/*}`

Replaces the entitlements of a principal's direct assignment to this workspace. The new list
 can't be empty.

 Entitlements are changed one at a time. If the request fails partway through, only some of the
 changes take effect. Get the assignment afterwards to check the result.

API scopes: identity

## Path parameters

- `name` (string, required, ID, Immutable)
  The resource name of the assignment, in one of these formats:
     - Account APIs:
       `accounts/{account_id}/workspaces/{workspace_id}/workspace-assignments/{principal_id}`
     - Workspace APIs: `workspace-assignments/{principal_id}`

## Query parameters

- `update_mask` (string, required)
  The fields to update. The only supported field is `entitlements`.

## Request body

The assignment to update. Its `name` identifies the assignment.
- `principal_id` (int64, required, Immutable)
  The Databricks ID of the assigned user, service principal, or group. It can't be changed after
   the assignment is created.
- `entitlements` (array of string, optional, Unordered list)
  The entitlements granted directly by this assignment. Create and update set exactly this list,
   even if the principal also gets some of these entitlements through a group. List responses
   leave it empty.
  Possible values:
  - `WORKSPACE_ACCESS`
  - `WORKSPACE_CONSUME`
  - `DATABRICKS_SQL_ACCESS`
  - `WORKSPACE_ADMIN`
  - `ALLOW_CLUSTER_CREATE`
  - `ALLOW_INSTANCE_POOL_CREATE`

## Returns

Returns the WorkspaceAssignment object.

## Response

```json
{
  "name": "string",
  "parent": "string",
  "principal_type": "USER",
  "principal_id": 0,
  "workspace_id": 0,
  "account_id": "string",
  "entitlements": [
    "WORKSPACE_ACCESS"
  ],
  "effective_entitlements": [
    "WORKSPACE_ACCESS"
  ]
}
```

