# List service principals in the account

Launch stage: GA

`GET /api/2.0/identity/{parent=accounts/*}/service-principals`

Lists the service principals in your account, sorted by Databricks ID. Service principals in
 your identity provider that haven't been added to Databricks aren't included.

API scopes: identity

## Path parameters

- `parent` (string, required)
  The resource name of the account to list service principals in, in the format
   `accounts/{account_id}`.

## Query parameters

- `page_size` (int32, optional)
  The maximum number of service principals to return, up to 1000. The default is 1000. A page
   can contain fewer service principals.
- `page_token` (string, optional)
  The `next_page_token` from a previous response, to get the next page.
- `filter` (string, optional)
  Filters service principals by `application_id` or `external_id`, for example
   `application_id eq "<application-id>"`. Put the value in quotes.

## Returns

Returns a list of ServicePrincipal objects.

## Response

```json
{
  "service_principals": [
    {
      "name": "string",
      "parent": "string",
      "account_id": "string",
      "service_principal_id": "string",
      "external_id": "string",
      "application_id": "string",
      "display_name": "string",
      "account_sp_status": "ACTIVE"
    }
  ],
  "next_page_token": "string"
}
```

