# Add an AI conversation attribute

```http
POST https://trydimmi.com/api/v1/ai/conversation-attributes
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `ai:write`.

## Body

- `data_type` (string, required): text, number, date, boolean or choice. One of: `text`, `number`, `date`, `boolean`, `choice`.
- `description` (string): What to look for, for the AI, up to 500 characters.
- `key` (string, required): The attribute's key, lowercase letters, digits and underscores, such as order_number.
- `label` (string, required): What the team calls it, up to 80 characters, such as Order number.
- `options` (string[] | null): With choice, the values it may take, at most 30, such as ["billing", "bug"].

## Response 201 (Created)

- `data` (object, required)
  - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `data_type` (string, required): What the value is: text, number, date, boolean or choice.
  - `description` (string, required): What the AI looks for. Empty when not set.
  - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
  - `key` (string, required): The attribute's key, as conditions and variables name it: conversation.ai.<key>.
  - `label` (string, required): What the team calls the attribute.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `options` (string[] | null, required): With choice, the values it may take. Empty otherwise.
  - `status` (string, required): active while the AI reads it, archived once it stopped.
  - `updated_at` (string, required): When it last changed, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request POST \
  --url 'https://trydimmi.com/api/v1/ai/conversation-attributes' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "data_type": "text",
  "description": "<string>",
  "key": "<string>",
  "label": "<string>",
  "options": [
    "<string>"
  ]
}'
```

## Example response

```json
{
  "data": {
    "created_at": "2026-11-01T09:30:00Z",
    "data_type": "<string>",
    "description": "<string>",
    "id": "<string>",
    "key": "<string>",
    "label": "<string>",
    "object": "<string>",
    "options": [
      "<string>"
    ],
    "status": "<string>",
    "updated_at": "2026-11-01T09:30:00Z"
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
