# Create

Launch stage: Beta

`POST /api/2.0/identity/accounts/{account_id}/groups/{group_id}/direct-members`

Creates a group membership (assigns a principal to a group).

API scopes: identity

## Path parameters

- `account_id` (string, optional)
  Required. The account ID for which the group membership is being created.
- `group_id` (int64, optional)
  Required. Internal ID of the group in <Databricks>.

## Request body

- `direct_group_member` (object, optional)
  Required. The direct group member to be added to the group.
  - `principal_id` (int64, optional)
    Internal ID of the principal in <Databricks>.
  - `principal_type` (string, optional)
    The type of the principal (user/service principal/group).
    Possible values: `PRINCIPAL_TYPE_UNSPECIFIED`, `USER`, `SERVICE_PRINCIPAL`, `GROUP`
  - `membership_source` (string, optional)
    The source of group membership (internal or from identity provider).
    Possible values: `GROUP_MEMBERSHIP_SOURCE_UNSPECIFIED`, `INTERNAL`, `IDENTITY_PROVIDER`
  - `display_name` (string, optional)
    Display name of the principal.
  - `external_id` (string, optional)
    The external ID of the principal in <Databricks>.
  - `group_id` (int64, optional)
    The internal ID of the group this member belongs to.

## Returns

Returns the DirectGroupMember object.

## Response

```json
{
  "principal_id": 0,
  "principal_type": "string",
  "membership_source": "string",
  "display_name": "string",
  "external_id": "string",
  "group_id": 0
}
```

