# Identifiers (/docs/python/guides/identifiers)



Every scan method accepts an optional `cuid` — a stable identifier for the
user or event the scan belongs to.

```python
client.analyze(user_input, cuid="u_9f2c1a7b3e")
```

## What to pass [#what-to-pass]

The identifier just needs to be **stable** for a given user or event — the
same user should map to the same value across requests.

* A UUID attached to a user, session, or event, **or**
* *(recommended)* a **hash of identifying metadata**, so you never expose
  your internal UUIDs or any user data.

<Callout type="warn">
  **Never pass raw PII.** Don't send emails, names, phone numbers, or any
  personal data as the identifier — always hash or otherwise obfuscate it
  first.
</Callout>

### Hashing example [#hashing-example]

Hash a user id (with a server-side salt) into an opaque, stable identifier:

```python
import hashlib
import os


def to_cuid(user_id: str) -> str:
    salted = f"{user_id}:{os.environ['TAWA_ID_SALT']}"
    return hashlib.sha256(salted.encode()).hexdigest()[:32]


client.analyze(user_input, cuid=to_cuid(current_user.id))
```

## Multi-tenant apps [#multi-tenant-apps]

If you're building on behalf of multiple end customers, pass `tenant_id`
alongside `cuid` to scope the identifier to a specific tenant:

```python
client.analyze(user_input, cuid="u_9f2c1a7b3e", tenant_id=current_tenant.id)
```
