# Set a conversation's attributes

Sets or clears some of a conversation's attribute values. A value set here is never replaced by the AI. Returns the conversation's attributes as they now are.

```http
PATCH https://trydimmi.com/api/v1/conversations/{conversation}/attributes
```

## Authorization

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

## Path parameters

- `conversation` (string, required): Id of the conversation, such as conv_01jx2m8k4t, or its number, such as 1042 for #1042. Find it with GET /conversations or GET /search.

## Body

- `values` (object, required): The values to set, by key, such as {"issue_type": "Billing"}; null clears one. Each must fit its attribute's type.

## Response 200 (OK)

- `data` (object, required)
  - `checked_at` (string | null, required): When the AI last read the conversation. Null when it never has.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `values` (object[] | null, required): Each active attribute with its value, and each archived one that still holds one.
    - `attribute` (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.
    - `files` (object[] | null, required): With a file attribute, the files the value holds, each with a short-lived link. Empty otherwise.
      - `blocked` (boolean, required): True when the malware scan refused the file, so it cannot be downloaded.
      - `content_id` (string | null, required): The id an email's text uses to show this picture in place, written there as cid:<content id>. Null for an ordinary attachment.
      - `content_type` (string, required): The file's media type, such as image/png or application/pdf.
      - `filename` (string, required): The file's name, such as invoice.pdf.
      - `height` (integer | null, required): Height of an image in pixels. Null when it is not known or the file is not an image.
      - `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.
      - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
      - `scanned` (boolean, required): True when the malware scan found the file clean. A file with a url that is not scanned was never checked.
      - `size_bytes` (integer, required): The file's size in bytes.
      - `url` (string | null, required): A link that reads the file for a few minutes; fetch it again when it lapses. Null until the malware scan lets the file through.
      - `width` (integer | null, required): Width of an image in pixels. Null when it is not known or the file is not an image.
    - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
    - `set_by` (object, required)
      - `at` (string, required): When it was set, as an RFC 3339 time.
      - `by` (string, required): ai, member, workflow or import.
      - `id` (string | null, required): The teammate's id when a teammate set it. Null otherwise.
      - `name` (string | null, required): The teammate's or the workflow's name. Null for the AI and imports.
      - `reason` (string | null, required): Why the AI chose the value, in a sentence. Null when the AI gave none or someone else set it.
      - `sureness` (number | null, required): How sure the AI was, from 0 to 1. Null when the AI did not say or someone else set it.
    - `value` (any, required): The value, in the attribute's type: text, a number, true or false, a YYYY-MM-DD date, an RFC 3339 date and time, an option, a list of options or file ids, or a contact or company id. Null when empty.

## 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 PATCH \
  --url 'https://trydimmi.com/api/v1/conversations/{conversation}/attributes' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "values": {
    "<key>": null
  }
}'
```

## Example response

```json
{
  "data": {
    "checked_at": "2026-11-01T09:30:00Z",
    "object": "<string>",
    "values": [
      {
        "attribute": {
          "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": {},
          "options": [],
          "required_to_close": true,
          "status": "<string>",
          "team_ids": [],
          "updated_at": "2026-11-01T09:30:00Z"
        },
        "files": [
          {}
        ],
        "object": "<string>",
        "set_by": {
          "at": "2026-11-01T09:30:00Z",
          "by": "<string>",
          "id": "<string>",
          "name": "<string>",
          "reason": "<string>",
          "sureness": 123.45
        },
        "value": null
      }
    ]
  }
}
```

---

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