# Create Service Principal

Launch stage: GA

`POST /api/2.0/preview/scim/v2/ServicePrincipals`

Creates a new service principal in the <Databricks> workspace.

API scopes: scim

## Request body

- `active` (boolean, optional)
  If this user is active
- `applicationId` (string, optional)
  UUID relating to the service principal
- `displayName` (string, optional)
  String that represents a concatenation of given and family names.
  Example: `etl-service`
- `entitlements` (array of object, optional)
  Entitlements assigned to the service principal. See [assigning entitlements](https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements) for a full list of supported values.
  - `display` (string, optional)
  - `primary` (boolean, optional)
  - `$ref` (string, optional)
  - `type` (string, optional)
  - `value` (string, optional)
- `externalId` (string, optional)
- `groups` (array of object, optional)
  - `display` (string, optional)
  - `primary` (boolean, optional)
  - `$ref` (string, optional)
  - `type` (string, optional)
  - `value` (string, optional)
- `id` (string, optional)
  <Databricks> service principal ID.
- `roles` (array of object, optional)
  Corresponds to AWS instance profile/arn role.
  - `display` (string, optional)
  - `primary` (boolean, optional)
  - `$ref` (string, optional)
  - `type` (string, optional)
  - `value` (string, optional)
- `schemas` (array of string, optional)
  The schema of the List response.
  Possible values: `SERVICE_PRINCIPAL_SCHEMA_UNSPECIFIED`, `URN_IETF_PARAMS_SCIM_SCHEMAS_CORE_2_0_SERVICE_PRINCIPAL`

## Returns

- `active` (boolean, optional)
  If this user is active
- `applicationId` (string, optional)
  UUID relating to the service principal
- `displayName` (string, optional)
  String that represents a concatenation of given and family names.
  Example: `etl-service`
- `entitlements` (array of object, optional)
  Entitlements assigned to the service principal. See [assigning entitlements](https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements) for a full list of supported values.
  - `display` (string, optional)
  - `primary` (boolean, optional)
  - `$ref` (string, optional)
  - `type` (string, optional)
  - `value` (string, optional)
- `externalId` (string, optional)
  Constraints: `<= 64 characters`
- `groups` (array of object, optional)
  - `display` (string, optional)
  - `primary` (boolean, optional)
  - `$ref` (string, optional)
  - `type` (string, optional)
  - `value` (string, optional)
- `id` (string, optional)
  <Databricks> service principal ID.
- `roles` (array of object, optional)
  Corresponds to AWS instance profile/arn role.
  - `display` (string, optional)
  - `primary` (boolean, optional)
  - `$ref` (string, optional)
  - `type` (string, optional)
  - `value` (string, optional)
- `schemas` (array of string, optional)
  The schema of the List response.
  Possible values: `SERVICE_PRINCIPAL_SCHEMA_UNSPECIFIED`, `URN_IETF_PARAMS_SCIM_SCHEMAS_CORE_2_0_SERVICE_PRINCIPAL`

## Response

```json
{
  "active": true,
  "applicationId": "string",
  "displayName": "etl-service",
  "entitlements": [
    {
      "display": "string",
      "primary": true,
      "$ref": "string",
      "type": "string",
      "value": "string"
    }
  ],
  "externalId": "string",
  "groups": [
    {
      "display": "string",
      "primary": true,
      "$ref": "string",
      "type": "string",
      "value": "string"
    }
  ],
  "id": "string",
  "roles": [
    {
      "display": "string",
      "primary": true,
      "$ref": "string",
      "type": "string",
      "value": "string"
    }
  ],
  "schemas": [
    "string"
  ]
}
```

