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

# Docker Hub User Provisioning & Deprovisioning

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

![](https://mintcdn.com/klef/FKKJNtez8OwrXp7D/images/connectors/docker-hub.svg?fit=max\&auto=format\&n=FKKJNtez8OwrXp7D\&q=85\&s=43e0696a880da06f9621f03a9e6f1bf9)

# Docker Hub

## Connection

### Setup

Klef reaches your Docker organization through Docker Hub's API, with an organization access token. Organization access tokens need a Docker Team or Business subscription.

**Step 1**

In [Docker Home](https://app.docker.com), select your organization, then **Identity & auth**, then **Access tokens**, and choose **Generate access token**.

**Step 2**

Under **Organization**, select the **Member Edit**, **Invite Edit**, and **Group Edit** scopes. Set an expiration date you will remember to renew.

**Step 3**

Copy the token into Klef, with your organization's name. Leave **Owner's Docker ID** empty.

To use an organization owner's personal access token instead, enter the owner's Docker ID too.

### Settings

| Setting | Required | Description |
| - | - | - |
| Organization | Yes | Name of your Docker organization, as it appears in its Docker Hub address. |
| Access token | Yes | An organization access token, or the personal access token of an organization owner. |
| Owner's Docker ID | | Docker ID of the owner whose personal access token this is. Leave it empty for an organization access token. |

## docker\_hub.member

### 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. |
| `role` | string | | Organization role, owner, editor, or member, or the name of a custom role. Defaults to member. |
| `teams` | entitlements | | Teams the member belongs to. Applied once the member has accepted their invite. One row grants one team. |
| `teams[]` | string | | Team name. |
| `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 Docker Hub, 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

### Docker Hub members

A Docker Hub organization invite for every engineer, removed when they leave, or withdrawn if never accepted.

```hcl theme={null}
stage active {
  target docker_hub.member {
    email  = worker.business_email
    role   = "member"
    status = enabled
  }
}
```


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