# Update a custom attribute

```http
PATCH https://trydimmi.com/api/v1/attribute-definitions/{attribute}
```

## Authorization

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

## Path parameters

- `attribute` (string, required): Id of the custom attribute, starting with atd_, such as atd_01jx2m8k4t. Find it with GET /attribute-definitions.

## Body

- `client_writable` (boolean): Contacts only: true lets the messenger set it from the browser, so its values are claimed, not trusted. 20 attributes at most.
- `description` (string): The description of the attribute definition, at most 500 characters.
- `label` (string): The new name people see for the attribute, 1 to 80 characters. Such as Plan tier.
- `options` (string[]): The values a list attribute may take: 1 to 200 different non-empty strings, replacing the old list. Only for attributes whose data type is list; other types refuse any options. Such as ["free","pro","enterprise"].
- `status` (string): active or archived. One of: `active`, `archived`.

## Response 200 (OK)

- `data` (object, required)
  - `client_writable` (boolean, required): Whether browsers (the messenger on a customer's page) may write this attribute. At most 20 attributes can be.
  - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `data_type` (string, required): The type of the attribute's values: string, number, boolean, date or list. Dates are kept as Unix seconds.
  - `description` (string | null, required): What the attribute is for, up to 500 characters. Null when none was written.
  - `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 name in data: a lowercase letter then up to 63 lowercase letters, digits or underscores, such as plan_tier.
  - `label` (string, required): The name people see for the attribute, 1 to 80 characters, such as Plan tier.
  - `last_value_at` (string | null, required): When a value was last written for this attribute. Null when none ever was.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `of` (string, required): Whose attribute it is: contact or company.
  - `options` (any, required): The allowed values of a list attribute, as an array of up to 200 strings. An empty array for other types.
  - `origin` (string, required): How the definition came to be: created by the team, or observed on the first verified write of a new key.
  - `status` (string, required): active, or archived: an archived attribute keeps its values but takes no new writes.

## 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/attribute-definitions/{attribute}' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "client_writable": true,
  "description": "<string>",
  "label": "<string>",
  "options": [
    "<string>"
  ],
  "status": "active"
}'
```

## Example response

```json
{
  "data": {
    "client_writable": true,
    "created_at": "2026-11-01T09:30:00Z",
    "data_type": "<string>",
    "description": "<string>",
    "id": "<string>",
    "key": "<string>",
    "label": "<string>",
    "last_value_at": "2026-11-01T09:30:00Z",
    "object": "<string>",
    "of": "<string>",
    "options": null,
    "origin": "<string>",
    "status": "<string>"
  }
}
```

---

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