# List service principals

Launch stage: GA

`GET /api/2.0/accounts/{account_id}/scim/v2/ServicePrincipals`

Gets the set of service principals associated with a Databricks account.

API scopes: scim

## Path parameters

- `account_id` (string, uuid, required)
  Databricks account ID

## Query parameters

- `attributes` (string, optional)
  Comma-separated list of attributes to return in response.
- `count` (int64, optional)
  Desired number of results per page. Default is 10000.
  Constraints: `<= 100`
- `excludedAttributes` (string, optional)
  Comma-separated list of attributes to exclude in response.
- `filter` (string, optional)
  Query by which the results have to be filtered. Supported operators are equals(`eq`), contains(`co`), starts with(`sw`) and not equals(`ne`). Additionally, simple expressions can be formed using logical operators - `and` and `or`. The [SCIM RFC](https://tools.ietf.org/html/rfc7644#section-3.4.2.2) has more details but we currently only support simple expressions.
  Example: `displayName co "sp" and displayName co "foo"` : Service principals whose displayName contains sp and displayName contains foo.
  Example: `displayName co "bar"` : Service principals whose displayName contains bar.
  Example: `displayName eq "foo"` : Service principals whose displayName equals foo.
  Example: `displayName ne "qux"` : Service principals whose displayName not equals qux.
  Example: `displayName co "sp" or displayName co "foo"` : Service principals whose displayName contains sp or displayName contains foo.
  Example: `displayName sw "baz"` : Service principals whose displayName starts with baz.
- `sortBy` (string, optional)
  Attribute to sort the results.
- `sortOrder` (string, optional)
  The order to sort the results.
  Possible values:
  - `ascending`
  - `descending`
- `startIndex` (int64, optional)
  Specifies the index of the first result. First item is number 1.

## Returns

Returns a list of AccountServicePrincipal objects.

## Response

```json
{
  "itemsPerPage": 0,
  "Resources": [
    {
      "active": true,
      "applicationId": "string",
      "displayName": "etl-service",
      "externalId": "string",
      "id": "string",
      "roles": [
        {}
      ],
      "account_id": "string"
    }
  ],
  "startIndex": 1,
  "totalResults": 0
}
```

