# Update

Launch stage: Beta

`PATCH /api/2.0/identity/service-principals/{service_principal_id}`

Updates an existing service principal in the
 <Databricks> account that parents the calling workspace. Only the fields named in the update mask
 are modified. Returns the updated ServicePrincipal resource.

 When AIM is enabled and the service principal is an external identity (its external_id is set),
 only external_id can be updated; its other fields are sourced from your identity provider.

API scopes: identity

## Path parameters

- `service_principal_id` (string, optional)
  Required. Internal ID of the service principal in <Databricks>.

## Query parameters

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

## Request body

- `service_principal` (object, optional)
  Required. Service principal to be updated 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"
}
```

