# Create

Launch stage: Beta

`POST /api/2.0/identity/accounts/{account_id}/service-principals`

Creates a local service principal in the <Databricks> account and returns the created service
 principal. A local service principal is one that is not synced from the customer's identity
 provider, and can be created whether or not Account Identity Management (AIM) is enabled.

 When AIM is enabled, supplying an external ID returns an error. To provision the identity from
 your identity provider, resolve it by its external ID with ResolveServicePrincipal; to read an
 existing external identity, use the ExternalServicePrincipal resource.

API scopes: identity

## Path parameters

- `account_id` (string, optional)
  Required. The account ID for which the service principal is being created.

## Request body

- `service_principal` (object, optional)
  Required. Service principal to be created in <Databricks>
  - `account_id` (string, optional)
    The parent account ID for the service principal in <Databricks>.
  - `service_principal_id` (string, optional)
    Internal service principal ID of the service principal in <Databricks>.
  - `external_id` (string, optional)
    ExternalId of the service principal in the customer's IdP.
  - `application_id` (string, optional)
    Application ID of the service principal. Set at creation time and cannot be changed
     afterwards; when omitted, the server generates one.
  - `display_name` (string, optional)
    Display name of the service principal.
  - `account_sp_status` (string, optional)
    The activity status of a service principal in a <Databricks> account.
    Possible values: `STATE_UNSPECIFIED`, `ACTIVE`, `INACTIVE`

## Returns

Returns the ServicePrincipal object.

## Response

```json
{
  "account_id": "string",
  "service_principal_id": "string",
  "external_id": "string",
  "application_id": "string",
  "display_name": "string",
  "account_sp_status": "string"
}
```

