# TENANT.BIND

> Record that an ACL user belongs to a tenant.

URL: https://docs.hotkv.com/commands/tenant-bind/

```
TENANT.BIND tenant-id username
```

- Group: Tenancy
- Complexity: O(N) where N is the number of users bound to the tenant
- HotKV Cloud: Scale plan
- On-Premise: requires the multi-tenancy license feature

`TENANT.BIND` adds a user name to a tenant's list of users, on every node.
Binding a user that is already bound does nothing. The user does not have to
exist in the ACL yet.

The binding is a record of which users belong to which tenant. It does not
change what the user may do or which keys it sees: keep each tenant's users
to their own keys
with ACL key patterns, for example
`ACL SETUSER acme-app on >secret ~acme:* +@all -@dangerous`.

## Return value

Simple string `OK` in RESP2 and RESP3, or one of these errors:

| Case | Error |
| --- | --- |
| No such tenant | `ERR tenant not found` |
| No license that includes `multi-tenancy` | `NOLICENSE multi-tenancy requires a HotKV license. Contact sales@hotkv.com` |

## Examples

```
127.0.0.1:6379> TENANT.BIND acme acme-app
OK
127.0.0.1:6379> TENANT.BIND nosuch acme-app
(error) ERR tenant not found
```

## Compatibility

HotKV-only command.

## See also

[TENANT.UNBIND](https://docs.hotkv.com/commands/tenant-unbind/index.md), [ACL SETUSER](https://docs.hotkv.com/commands/acl-setuser/index.md)