> ## 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.

# Datadog User Provisioning & Deprovisioning

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

![](https://mintcdn.com/klef/9m8m66FBBTmvIvoC/images/connectors/datadog.svg?fit=max\&auto=format\&n=9m8m66FBBTmvIvoC\&q=85\&s=1b1f47a4935b15d97a632927ae453ad1)

# Datadog

## Connection

### Setup

**Step 1**

In Datadog, go to **Organization Settings** > **API Keys** and create an API key for Klef.

**Step 2**

Go to **Organization Settings** > **Application Keys** and create an application key as a user or service account that holds the Datadog Admin Role. If you scope the key, give it `user_access_read`, `user_access_invite`, `user_access_manage`, and `teams_read`.

**Step 3**

Choose your [site](https://docs.datadoghq.com/getting_started/site/), enter both keys in the connection's settings, and click the **Save** button.

### Settings

| Setting | Required | Description |
| - | - | - |
| Site | Yes | The Datadog site your organization is on, as in the address you sign in at. |
| API key | Yes | An API key of the organization. |
| Application key | Yes | An application key of a user or service account that holds the permissions below. |

## datadog.user

### Fields

| Field | Type | Required | Description |
| - | - | - | - |
| `email` | string | Yes | Email address Datadog invites the user at. The connector does not change it once the user exists. Never changed once the account exists. |
| `name` | string, up to 55 | | Full name. |
| `title` | string | | Job title. Datadog takes it only when it creates the user. Never changed once the account exists. |
| `roles` | entitlements | | Roles the user holds. One row grants one role. |
| `roles[]` | string | | Role ID. |
| `teams` | entitlements | | Teams the user belongs to. A team written on its own makes the user a member. One row grants one team. |
| `teams[].team` | string | Yes | Team ID. |
| `teams[].role` | enum | | Role on the team. Values: `member` (Member), `admin` (Admin). |
| `active` | bool | | Whether the user can sign in. The connector disables a user it removes, which Datadog keeps and can enable again. Shows the account's status: a policy reads it and sets `status` instead. |
| `status` | enum | | Whether the person can sign in, the account is kept switched off, or the account is gone. Values: `enabled` (Enabled), `disabled` (Disabled). |

### Default Account Matching Rules

When Klef [adopts](https://klef.ai/docs/adoption.md) an account that already exists in Datadog, 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

### Datadog users

A Datadog user for every engineer, disabled when they leave.

```hcl theme={null}
stage active {
  target datadog.user {
    email  = worker.business_email
    name   = worker.display_name
    title  = worker.job.name
    status = enabled
  }
}
```


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