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

# Attributes, API keys and data controls

> Define what your workspace keeps on a contact, hand a key to your own systems, and erase raw uploads.

Three settings tabs sit behind this page: **Attributes**, **API** and **Data
controls**. They answer three questions. What does this workspace record? What
may a script do? What does Kai hold, and how do you remove it?

## Workspace attributes

An attribute is a field that your workspace keeps on every contact. It appears
on each contact profile, in the inbox rail, and in the API. You do not need a
release to add one.

<Frame caption="Settings, Attributes: the fields this workspace keeps on a contact.">
  <img src="https://mintcdn.com/kai-support/RaOwCZDRMIUnRjWu/images/en/settings-attributes.png?fit=max&auto=format&n=RaOwCZDRMIUnRjWu&q=85&s=ccb2bcb09598af7704239abe979b3568" alt="Settings, Attributes" width="2880" height="2000" data-path="images/en/settings-attributes.png" />
</Frame>

<Steps>
  <Step title="Select Add attribute">
    Open **Settings → Attributes** and select **Add attribute**.
  </Step>

  <Step title="Write the label">
    The label is what a teammate reads, for example `Package`. You can change
    a label at any time.
  </Step>

  <Step title="Check the API name">
    The API name is the key a script sends, for example `package`. Kai derives
    it from the label, and you can edit it here. It cannot be changed later, so
    a renamed label never breaks your nightly sync.
  </Step>

  <Step title="Choose the type">
    Text, Number, Yes / no, Date, Choice, Link, Email or Phone. A **Choice**
    attribute also takes its options, separated by commas.
  </Step>
</Steps>

Four rules govern attributes, and each one exists because the other behaviour
loses data.

**Define the field before you fill it.** Kai refuses a value for an attribute
that the workspace does not define.

**An unknown key is refused, never dropped.** A push of 3000 contacts that
silently discards the one field you cared about is a fault that nobody finds
for months. Kai answers with an error and names the key.

**A type never changes.** Every value already recorded would become unreadable
by its own definition, and no conversion is right for all of them. To store a
different type, archive the attribute and create another one with a new API
name.

**Delete means archive.** **Archive** stops Kai offering the attribute and
refuses new writes to it. Every value that contacts already hold stays, and the
profile still shows it. **Restore** makes it writable again.

<Note>
  Kai never sends an attribute value to a customer on its own. Attributes
  inform your team and your own systems.
</Note>

Read [Workspace attributes](/concepts/attributes) for the accepted input of
each type and for the API calls.

## API keys

An API key lets your own systems push, update, assign and export contacts.
Open **Settings → API**.

<Frame caption="Settings, API: the keys this workspace holds.">
  <img src="https://mintcdn.com/kai-support/RaOwCZDRMIUnRjWu/images/en/settings-api.png?fit=max&auto=format&n=RaOwCZDRMIUnRjWu&q=85&s=a3e04c34a448a8983bcaa6b9604c4909" alt="Settings, API" width="2880" height="2000" data-path="images/en/settings-api.png" />
</Frame>

A key looks like this:

```
kai_live_<id>_<secret>
```

The `kai_` marker is what a secret scanner matches. The id is the lookup
handle, and the list shows it so you can recognise a key. The secret is 32
random bytes.

<Warning>
  Kai shows the full key one time. Kai stores only a hash of the secret half,
  so nobody can read the key again, not even Kai support. Copy it before you
  dismiss the panel. If you lose a key, create another one and revoke the old
  one.
</Warning>

<Steps>
  <Step title="Select Create API key">
    Only an owner or an admin can create a key.
  </Step>

  <Step title="Name it after its job">
    For example `Nightly CRM sync`. The name stays in the list after a revoke,
    so the audit trail stays complete.
  </Step>

  <Step title="Select its permissions">
    `contacts:read`, `contacts:write`, `attributes:read`, `attributes:write`,
    `members:read`. Give a key the smallest set its job needs. A write
    permission includes its read permission.
  </Step>

  <Step title="Copy the key">
    Store it in your secret manager. Select **Revoke** beside a key to stop it
    working; the next request with it returns 401.
  </Step>
</Steps>

**A key's permissions are not the roles that people hold.** They are a
separate, shorter list. A machine has no role and no seat in the workspace, and
joining the two lists would make an API permission something a human role could
grant itself. See [People and permissions](/product/team) for the human list.

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/authentication">
    The header, the errors, and how a key is revoked.
  </Card>

  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Make a key and push your first contact.
  </Card>
</CardGroup>

## Data controls

Open **Settings → Data controls**.

<Frame caption="Settings, Data controls: what Kai holds, and how to erase the raw uploads.">
  <img src="https://mintcdn.com/kai-support/RaOwCZDRMIUnRjWu/images/en/settings-data.png?fit=max&auto=format&n=RaOwCZDRMIUnRjWu&q=85&s=2fa30cf3c571a0b15f4aedd43020d783" alt="Settings, Data controls" width="2880" height="2000" data-path="images/en/settings-data.png" />
</Frame>

### What Kai stores

Kai holds three kinds of data.

* **The raw uploads.** The chat export files exactly as you sent them, plus the
  map that reverses their redactions.
* **The compiled Brain.** The answer library, the conversation flows, the human
  handoff rules, the communication rules, the brand voice and the current
  information. It holds no personal data.
* **Live conversations.** The messages your channels deliver, the contacts
  behind them, and every action Kai took with its reasoning.

### Personal data becomes a placeholder

Kai replaces every phone number, email address and payment reference with a
placeholder before anything reaches a model. This happens during the import,
before the first model call.

The same value always becomes the same placeholder, so Kai still learns the
pattern without holding the value. The map that reverses the placeholders stays
on your own server.

### Erase raw uploads

Select **Erase raw uploads**, then confirm. Kai deletes the original exports
and the map that reverses their redactions.

| Erasing removes                        | Erasing keeps                                   |
| -------------------------------------- | ----------------------------------------------- |
| The uploaded export files              | The compiled Brain, and every published version |
| The map that reverses the placeholders | Your live conversations and contacts            |

<Warning>
  Erasing cannot be undone. Erased uploads do not come back, and no retrain can
  read them again.
</Warning>

Only an Admin can erase. A [retrain](/product/retrain) reads earlier
uploads to reuse their labels, so erase when you no longer need the history,
not before your first retrain.

## Next

<CardGroup cols={2}>
  <Card title="People and permissions" icon="users" href="/product/team">
    Who can create a key, and who can erase.
  </Card>

  <Card title="Best practices" icon="lightbulb" href="/product/best-practices">
    The rules that keep a Brain worth trusting.
  </Card>
</CardGroup>
