# Create

Launch stage: Beta

`POST /api/2.0/identity/workspace-assignments`

Creates a workspace assignment for a principal in the calling workspace. Entitlements
 are granted one at a time rather than atomically. If the request fails partway through, the
 principal stays assigned to the workspace with only some of the requested entitlements. Get the
 assignment afterwards to confirm which entitlements were granted.

API scopes: identity

## Request body

- `workspace_assignment` (object, required)
  Required. Workspace assignment to be created 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, required)
    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"
  ]
}
```

