# Resolve an external service principal in the Databricks account

Launch stage: Beta

`POST /api/2.0/identity/accounts/{account_id}/service-principals/resolve-by-external-id`

Gets a service principal by its ID in your identity provider (IdP) and syncs its details and
 group memberships from your IdP. If the service principal isn't in your account yet, it's
 added. Requires automatic identity management with Microsoft Entra ID as your IdP.

API scopes: identity

## Path parameters

- `account_id` (string, required)
  The ID of the account to resolve the service principal in.

## Request body

- `external_id` (string, required)
  The ID of the service principal in your IdP.

## Returns

- `service_principal` (object, optional)
  The resolved service principal.
  - `name` (string, optional, ID, Immutable)
    The resource name of the service principal, in one of these formats:
       - Account APIs: `accounts/{account_id}/service-principals/{service_principal_id}`
       - Workspace APIs: `service-principals/{service_principal_id}`
  - `parent` (string, optional, Output only, Immutable)
    The resource name of the account that contains the service principal, in the format
     `accounts/{account_id}`. Workspace APIs return the same format.
  - `account_id` (string, optional, Output only, Immutable)
    The ID of the account that contains the service principal.
  - `service_principal_id` (string, optional, Output only, Immutable)
    The Databricks ID of the service principal.
  - `external_id` (string, optional)
    The ID of the service principal in your identity provider (IdP).
  - `application_id` (string, optional, Immutable)
    The service principal's application ID, a UUID. If you don't set it when you create the
     service principal, Databricks generates one. It must be unique in the account and can't be
     changed.
  - `display_name` (string, required)
    The service principal's display name.
  - `account_sp_status` (string, required)
    Whether the service principal is active in the account.
    Possible values:
    - `ACTIVE`
    - `INACTIVE`

## Response

```json
{
  "service_principal": {
    "name": "string",
    "parent": "string",
    "account_id": "string",
    "service_principal_id": "string",
    "external_id": "string",
    "application_id": "string",
    "display_name": "string",
    "account_sp_status": "ACTIVE"
  }
}
```

