# Add a conversation attribute

Adds an attribute every conversation can hold, such as the issue type. Teammates fill it in the conversation's details and the AI can fill it as the customer writes. Returns the attribute.

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

## Authorization

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

## Body

- `data_type` (string, required): text, long_text, number, decimal, choice, multiple_choice, boolean, date, datetime, file, contact or company. One of: `text`, `long_text`, `number`, `decimal`, `choice`, `multiple_choice`, `boolean`, `date`, `datetime`, `file`, `contact`, `company`.
- `description` (string): What it means, up to 500 characters. The AI reads it to decide the value, so say what to look for.
- `filled_by` (string): ai, teammates or both. The AI fills only text, numbers, yes or no, dates and lists. One of: `ai`, `teammates`, `both`.
- `key` (string, required): The attribute's key, lowercase letters, digits and underscores, such as issue_type.
- `label` (string, required): What the team calls it, up to 80 characters, such as Issue type.
- `option_descriptions` (object): With choice or multiple_choice, what some options mean, by option, 300 characters each, such as {"Billing": "Charges, invoices and refunds"}. The AI reads them.
- `options` (string[] | null): With choice or multiple_choice, the values it may take, at most 200.
- `required_to_close` (boolean): true to stop teammates closing a conversation while it is empty.
- `team_ids` (string[] | null): The teams that see it in the inbox, every team when empty.

## 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, long_text, number, decimal, choice, multiple_choice, boolean, date, datetime, file, contact or company.
  - `description` (string, required): What it means; the AI reads it to decide the value. Empty when not set.
  - `filled_by` (string, required): Who fills it: ai, teammates or both.
  - `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.
  - `option_descriptions` (object, required): What some options mean, by option, for the AI to read. Empty when none is described.
  - `options` (string[] | null, required): With choice or multiple_choice, the values it may take. Empty otherwise.
  - `required_to_close` (boolean, required): Whether teammates must fill it before closing a conversation.
  - `status` (string, required): active while it is filled, archived once it stopped.
  - `team_ids` (string[] | null, required): The teams that see it in the inbox. Empty when every team does.
  - `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/conversation-attributes' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "data_type": "text",
  "description": "<string>",
  "filled_by": "ai",
  "key": "<string>",
  "label": "<string>",
  "option_descriptions": {
    "<key>": "<string>"
  },
  "options": [
    "<string>"
  ],
  "required_to_close": true,
  "team_ids": [
    "<string>"
  ]
}'
```

## Example response

```json
{
  "data": {
    "created_at": "2026-11-01T09:30:00Z",
    "data_type": "<string>",
    "description": "<string>",
    "filled_by": "<string>",
    "id": "<string>",
    "key": "<string>",
    "label": "<string>",
    "object": "<string>",
    "option_descriptions": {
      "<key>": "<string>"
    },
    "options": [
      "<string>"
    ],
    "required_to_close": true,
    "status": "<string>",
    "team_ids": [
      "<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)
