---
title: Identity system tables reference
description: Learn how to use the identity system tables to query users, service principals, groups, group membership, and workspace entitlements in your account.
canonical_url: https://docs.databricks.com/gcp/en/admin/system-tables/identity
---

# Identity system tables reference

> [!NOTE]
> **Beta**
>
> This feature is in [Beta](https://docs.databricks.com/gcp/en/release-notes/release-types.md). Account admins can manage access to this feature from the account console **Previews** page. See [ Manage account-level previews](https://docs.databricks.com/gcp/en/admin/workspace-settings/manage-previews.md#account).

This page explains how to use the identity system tables to query the users, service principals, and groups in your Databricks account, how groups nest inside each other, and which entitlements each principal holds in each workspace. Use these tables to answer questions such as "who belongs to this group, including nested members?" or "who is a workspace admin?" with SQL, and join them with other system tables to resolve principal IDs to names and emails.

To query these tables, you need `USE CATALOG` on `system`, `USE SCHEMA` on `system.access`, and `SELECT` on each table.

## <a id="tables" />Tables

| Table                                         | Description                                                                                                   | Primary key                           |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| `system.access.principals_latest`             | One row per principal: users, service principals, account groups, and workspace-local groups.                 | `account_id`, `principal_id`          |
| `system.access.parent_groups_latest`          | One row per transitive group membership. Includes every ancestor group, not only direct parents.              | `account_id`, `parent_id`, `child_id` |
| `system.access.workspace_entitlements_latest` | One row per principal per workspace, listing the entitlements the principal holds directly in that workspace. | `workspace_id`, `principal_id`        |

Each table contains the latest known state of each principal, membership, or assignment. Soft-deleted records remain in the tables with `delete_time` set. Records removed at the source drop out of the tables, so the tables don't provide a complete deletion history. To exclude soft-deleted records, filter on `delete_time IS NULL`.

## <a id="principals-table-schema" />Principals table schema

The `principals_latest` table includes all account-level users, service principals, and groups in your account, plus all workspace-local groups.

| Column name      | Data type | Description                                                                                                                                                                                                 |
| ---------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `account_id`     | string    | ID of the Databricks account.                                                                                                                                                                               |
| `workspace_id`   | string    | ID of the workspace. Set only for workspace-local groups. Null for account-level principals.                                                                                                                |
| `principal_id`   | string    | ID of the principal.                                                                                                                                                                                        |
| `principal_type` | string    | Type of the principal. One of `USER`, `GROUP`, or `SERVICE_PRINCIPAL`.                                                                                                                                      |
| `display_name`   | string    | Display name of the principal. Can be null.                                                                                                                                                                 |
| `status`         | string    | Status of the principal. One of `ACTIVE` or `INACTIVE`.                                                                                                                                                     |
| `email`          | string    | Username of the principal, typically an email address. Set when `principal_type` is `USER`. Null otherwise.                                                                                                 |
| `application_id` | string    | Application ID of the service principal. Set when `principal_type` is `SERVICE_PRINCIPAL`. Null otherwise.                                                                                                  |
| `idp_metadata`   | struct    | Identity provider metadata, set when the principal is managed by an external identity provider. Contains `external_id` (the ID of the principal in the identity provider) and `provider` (`AAD` or `OKTA`). |
| `create_time`    | timestamp | When the principal was added to the account.                                                                                                                                                                |
| `update_time`    | timestamp | When the principal was last modified.                                                                                                                                                                       |
| `delete_time`    | timestamp | When the principal was deleted from the account. Null while the principal exists.                                                                                                                           |

## <a id="parent-groups-table-schema" />Parent groups table schema

The `parent_groups_latest` table contains the transitive closure of group membership. If user A belongs to group B, and group B belongs to group C, the table contains a row for A in B, a row for A in C, and a row for B in C.

| Column name    | Data type | Description                                                                                                                                           |
| -------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `account_id`   | string    | ID of the Databricks account the parent group belongs to.                                                                                             |
| `workspace_id` | string    | ID of the workspace the parent group belongs to. Set only when the parent group is a workspace-local group. Null for account-level groups.            |
| `child_id`     | string    | ID of the member principal. Join with `principals_latest.principal_id` to get its details.                                                            |
| `parent_id`    | string    | ID of the group the member belongs to. Join with `principals_latest.principal_id` to get its details.                                                 |
| `create_time`  | timestamp | When the membership was created. For a transitive membership, the earliest time any connecting path of memberships was fully established.             |
| `update_time`  | timestamp | When the membership was last modified. For a transitive membership, the most recent modification across the connecting memberships.                   |
| `delete_time`  | timestamp | When the membership was deleted. Null while the membership holds. For a transitive membership, set only after every connecting path has been deleted. |

## <a id="workspace-entitlements-table-schema" />Workspace entitlements table schema

The `workspace_entitlements_latest` table lists the entitlements each principal holds directly in each workspace. A principal appears only if it holds at least one direct entitlement and is assigned to the workspace, either directly or through (possibly nested) group membership. The table contains rows for workspaces in the same region as the metastore you query from.

Entitlements are direct only. Entitlements a principal inherits through its group memberships don't appear in its row. To find a principal's effective entitlements, join with `parent_groups_latest` and include the entitlements of every group the principal belongs to.

| Column name    | Data type       | Description                                                                                                                                                                                                         |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `account_id`   | string          | ID of the Databricks account.                                                                                                                                                                                       |
| `workspace_id` | string          | ID of the workspace.                                                                                                                                                                                                |
| `principal_id` | string          | ID of the principal assigned to the workspace.                                                                                                                                                                      |
| `entitlements` | array of string | Entitlements the principal holds directly in this workspace. Values: `WORKSPACE_ACCESS`, `WORKSPACE_CONSUME`, `DATABRICKS_SQL_ACCESS`, `ALLOW_CLUSTER_CREATE`, `ALLOW_INSTANCE_POOL_CREATE`, and `WORKSPACE_ADMIN`. |
| `create_time`  | timestamp       | When both the direct entitlement record and the workspace assignment existed.                                                                                                                                       |
| `update_time`  | timestamp       | Most recent modification across the entitlement and assignment records.                                                                                                                                             |
| `delete_time`  | timestamp       | When either the contributing entitlement records or every assignment path was deleted. Null otherwise.                                                                                                              |

See [Manage entitlements](https://docs.databricks.com/gcp/en/security/auth/entitlements.md).

## <a id="sample-queries" />Sample queries

The following sections include sample SQL queries using the identity system tables.

* [Who belongs to a group, including nested members?](https://docs.databricks.com/gcp/en/admin/system-tables/identity.md#who-belongs-to-a-group-including-nested-members)
* [Which users are workspace admins?](https://docs.databricks.com/gcp/en/admin/system-tables/identity.md#which-users-are-workspace-admins)
* [Which service principals are in my account?](https://docs.databricks.com/gcp/en/admin/system-tables/identity.md#which-service-principals-are-in-my-account)

### <a id="group-members" />Who belongs to a group, including nested members?

Because `parent_groups_latest` contains every transitive membership, this query returns direct and nested members in one step.

```sql
SELECT
  pg.child_id AS member_id,
  p.principal_type,
  p.display_name,
  p.email
FROM
  system.access.parent_groups_latest AS pg
  JOIN system.access.principals_latest AS p
    ON pg.account_id = p.account_id
    AND pg.child_id = p.principal_id
WHERE
  pg.parent_id = '<group-id>'
  AND pg.delete_time IS NULL
  AND p.delete_time IS NULL;
```

### <a id="workspace-admins" />Which users are workspace admins?

This query returns users who hold the `WORKSPACE_ADMIN` entitlement directly in a workspace. It doesn't include users who are admins through a group. To include them, join with `parent_groups_latest`.

```sql
SELECT
  we.principal_id,
  p.display_name,
  p.email
FROM
  system.access.workspace_entitlements_latest AS we
  JOIN system.access.principals_latest AS p
    ON we.account_id = p.account_id
    AND we.principal_id = p.principal_id
WHERE
  we.workspace_id = '<workspace-id>'
  AND array_contains(we.entitlements, 'WORKSPACE_ADMIN')
  AND we.delete_time IS NULL
  AND p.delete_time IS NULL
  AND p.principal_type = 'USER';
```

### <a id="service-principals" />Which service principals are in my account?

This query returns the active service principals in your account and their application IDs.

```sql
SELECT
  principal_id,
  application_id,
  display_name,
  status,
  create_time
FROM
  system.access.principals_latest
WHERE
  principal_type = 'SERVICE_PRINCIPAL'
  AND delete_time IS NULL;
```

## <a id="limitations" />Limitations

* The tables refresh about every hour, so recent changes to users, groups, or entitlements might not appear immediately.
* The tables contain the latest state only, not a history of changes.

## <a id="additional-resources" />Additional resources

| Resource                                                                                   | Description                                                   |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------- |
| [System tables reference](https://docs.databricks.com/gcp/en/admin/system-tables/index.md) | See the other system tables and how to enable and query them. |
| [Manage entitlements](https://docs.databricks.com/gcp/en/security/auth/entitlements.md)    | Learn what each workspace entitlement grants.                 |
