> ## Documentation Index
> Fetch the complete documentation index at: https://klef.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# dbt User Provisioning & Deprovisioning

> Automate dbt user provisioning and deprovisioning from your HRIS. Klef creates, updates, and deactivates accounts when HR makes a change.

![](https://mintcdn.com/klef/KMAbsRw-4cbfJVdy/images/connectors/dbt.svg?fit=max\&auto=format\&n=KMAbsRw-4cbfJVdy\&q=85\&s=5bf24da4ca0ab2395b34595c85b939af)

# dbt

## Connection

### Setup

Klef reaches your dbt account through the Administrative API, with a service token. The Administrative API needs a Starter, Enterprise, or Enterprise+ plan.

**Step 1**

In dbt, open **Account settings**, then **Service tokens**, and choose **Create service token**.

**Step 2**

Name the token for Klef, and give it the **Account Admin** or **Security Admin** permission set.

**Step 3**

Copy the token into Klef, with your account's access URL, such as `ab123.us1.dbt.com`, and the account ID from your dbt address.

dbt has no way to withdraw an invite, so an invite Klef sends to someone who leaves before accepting it is withdrawn in **Account settings**, under **Users**.

### Settings

| Setting | Required | Description |
| - | - | - |
| Access URL | Yes | The host you sign in to dbt at, shown in Account settings. |
| Account ID | Yes | The number after /accounts/ in your dbt address. |
| Service token | Yes | A service token with the Account Admin or Security Admin permission set. |

## dbt.user

### Fields

| Field | Type | Required | Description |
| - | - | - | - |
| `email` | string | Yes | Email address the invite goes to. The connector does not change it. Never changed once the account exists. |
| `license` | enum | | License the user holds. Defaults to developer. A pending invite keeps the license it was sent with. Values: `developer` (Developer), `analyst` (Analyst), `read_only` (Read-only), `it` (IT). |
| `groups` | entitlements | | Groups the user belongs to, which carry their permission sets. A pending invite keeps the groups it was sent with. One row grants one group. |
| `groups[]` | string | | Group ID. |
| `status` | enum | | Whether the person can sign in, the account is kept switched off, or the account is gone. Values: `enabled` (Enabled), `removed` (Removed). |

### Default Account Matching Rules

When Klef [adopts](https://klef.ai/docs/adoption.md) an account that already exists in dbt, it works out whose it is by trying these in order. A connection can override them.

| Account field | Worker field |
| - | - |
| `email` | `worker.business_email` |

## Examples

### dbt developers

A dbt developer license for every engineer, removed when they leave.

```hcl theme={null}
stage active {
  target dbt.user {
    email   = worker.business_email
    license = "developer"
    status  = enabled
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.