# Update

Launch stage: Beta

`PATCH /api/2.0/identity/accounts/{account_id}/workspaces/{workspace_id}/workspace-assignments/{principal_id}`

Updates the entitlements of a directly assigned principal in a workspace. Changes are applied
 one at a time rather than atomically. If the request fails partway through, only some of the
 requested changes take effect. Get the assignment afterwards to confirm the final state.

API scopes: identity

## Path parameters

- `account_id` (string, optional)
  Required. The account ID for which the workspace assignment is being updated.
- `workspace_id` (int64, optional)
  Required. The workspace ID for which the workspace assignment is being updated.
- `principal_id` (int64, optional)
  Required. ID of the principal in <Databricks>.

## Query parameters

- `update_mask` (string, optional)
  Required. The list of fields to update.

## Request body

- `workspace_assignment` (object, optional)
  Required. Workspace assignment to be updated in <Databricks>.
  - `principal_type` (string, optional)
    The type of the principal (user/service principal/group) that is assigned.
    Possible values: `PRINCIPAL_TYPE_UNSPECIFIED`, `USER`, `SERVICE_PRINCIPAL`, `GROUP`
  - `principal_id` (int64, optional)
    The internal ID of the principal (user/sp/group) in <Databricks>.
  - `workspace_id` (int64, optional)
    The workspace ID where the principal is assigned.
  - `account_id` (string, optional)
    The account ID parent of the workspace where the principal is assigned
  - `entitlements` (array of string, optional)
    Entitlements granted directly to the principal on this workspace. This is the only
     client-settable field. Create and update manage exactly this set, including entitlements the
     principal also holds through a group.
     List responses leave this field empty. Get a single principal to read its entitlements.
    Possible values: `ENTITLEMENT_UNSPECIFIED`, `WORKSPACE_ACCESS`, `WORKSPACE_CONSUME`, `DATABRICKS_SQL_ACCESS`, `WORKSPACE_ADMIN`, `ALLOW_CLUSTER_CREATE`, `ALLOW_INSTANCE_POOL_CREATE`
  - `effective_entitlements` (array of string, optional)
    Every entitlement the principal holds in this workspace, whether granted directly or through
     group membership. Get responses populate this field. List responses leave it empty.
    Possible values: `ENTITLEMENT_UNSPECIFIED`, `WORKSPACE_ACCESS`, `WORKSPACE_CONSUME`, `DATABRICKS_SQL_ACCESS`, `WORKSPACE_ADMIN`, `ALLOW_CLUSTER_CREATE`, `ALLOW_INSTANCE_POOL_CREATE`

## Returns

Returns the WorkspaceAssignment object.

## Response

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

