# Add a ticket field

```http
POST https://trydimmi.com/api/v1/ticket-types/{type}/fields
```

## Authorization

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

## Path parameters

- `type` (string, required): Id of the ticket type, starting with tktt_, such as tktt_01jx2m8k4t. Find it with GET /ticket-types.

## Body

- `ai_auto` (boolean): true to let the AI save its proposed value straight into this field on a new ticket when the field is empty; false to keep it as a suggestion a teammate accepts.
- `ai_hint` (string): A short note telling the AI how to fill this field, such as "The order number from the customer's message, like A-1042". At most 500 characters. When updating, send null to clear it.
- `currency` (string): A three-letter currency code, such as USD.
- `data_type` (string): What kind of value the field holds: short_text, long_text, number (whole), decimal, currency, boolean, date, single_choice, multiple_choice, file, member or company, such as "single_choice". It is set when the field is added and never changes; when updating, a value sent here is ignored. One of: `short_text`, `long_text`, `number`, `decimal`, `currency`, `boolean`, `date`, `single_choice`, `multiple_choice`, `file`, `member`, `company`.
- `description` (string): The description of the ticket field, at most 300 characters, such as The order this request is about.
- `editable_customer` (boolean): true to let the customer fill or change this field on their own tickets; false for team only. Turning it on also makes the field visible to the customer.
- `key` (string): The short name field values are stored under: lowercase letters, digits and underscores, starting with a letter, at most 40 characters, unique within the type, such as "order_number". It is set when the field is added and never changes; when updating, a value sent here is ignored.
- `label` (string): The name of the field shown on forms, 1 to 80 characters, such as "Order number".
- `options` (string[] | null): The choices of a single_choice or multiple_choice field, as a list of texts of 1 to 100 characters, at most 200, such as ["Refund", "Exchange", "Other"]. Choice fields need at least one. Sending it replaces the whole list.
- `required_create` (boolean): true if the team, the API and automation must fill this field to create a ticket; false if it may be left empty.
- `required_create_customer` (boolean): true if a customer must fill this field when they open a ticket themselves; false if they may leave it empty.
- `required_resolve` (boolean): true if this field must have a value before a ticket can move to a resolved state; false if not.
- `show_when` (object)
  - `equals` (string[] | null): The values of the other field that make this field show, as a list of up to 50 texts, such as ["refund", "exchange"]. Left out or empty, this field shows whenever the other field has any value.
  - `field` (string, required): Key of another field of the same ticket type that this field depends on: it must have a value for this field to show. At most 40 characters, such as reason.
- `visible_customer` (boolean): true to show this field and its value to the customer on their tickets; false to keep it for the team. It is always true while editable_customer is true.

## Response 201 (Created)

- `data` (object, required)
  - `ai_auto` (boolean, required): True when the AI may fill this field in by itself.
  - `ai_hint` (string | null, required): Guidance telling the AI how to fill this field, up to 500 characters. Null when none is set.
  - `archived_at` (string | null, required): When the field was archived: hidden from new work but kept on old tickets. Null while it is in use.
  - `currency` (string | null, required): Three-letter uppercase currency code for a currency field, such as USD. Null when none is set.
  - `data_type` (string, required): The type of value the field holds: short_text, long_text, number, decimal, currency, boolean, date, single_choice, multiple_choice, file, member or company.
  - `description` (string, required): Help text explaining the field, up to 300 characters. Empty when none is set.
  - `editable_customer` (boolean, required): True when the customer may change this field's value.
  - `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 field's key within its type, lowercase letters, digits and underscores, such as order_number. Use it as the key in a ticket's fields object.
  - `label` (string, required): The field's name as people see it, 1 to 80 characters.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `options` (string[] | null, required): The choices of a single_choice or multiple_choice field, as a list of strings. Empty for fields without choices.
  - `position` (integer, required): The field's place in its type's field order, lower first.
  - `required_create` (boolean, required): True when a teammate must give this field a value to create a ticket.
  - `required_create_customer` (boolean, required): True when a customer must give this field a value to create a ticket.
  - `required_resolve` (boolean, required): True when the field must have a value before the ticket can be resolved.
  - `show_when` (object, required)
    - `equals` (string[] | null): Values of the other field under which this one shows. Left out when any value is enough.
    - `field` (string, required): Key of the other ticket field that must have a value for this one to show.
  - `type_id` (string, required): Id of the ticket type the field belongs to, such as tktt_.... Send it wherever a ticket type is asked for.
  - `visible_customer` (boolean, required): True when the customer sees this field on their ticket.

## 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/ticket-types/{type}/fields' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "ai_auto": true,
  "ai_hint": "<string>",
  "currency": "<string>",
  "data_type": "short_text",
  "description": "<string>",
  "editable_customer": true,
  "key": "<string>",
  "label": "<string>",
  "options": [
    "<string>"
  ],
  "required_create": true,
  "required_create_customer": true,
  "required_resolve": true,
  "show_when": {
    "equals": [
      "<string>"
    ],
    "field": "<string>"
  },
  "visible_customer": true
}'
```

## Example response

```json
{
  "data": {
    "ai_auto": true,
    "ai_hint": "<string>",
    "archived_at": "2026-11-01T09:30:00Z",
    "currency": "<string>",
    "data_type": "<string>",
    "description": "<string>",
    "editable_customer": true,
    "id": "<string>",
    "key": "<string>",
    "label": "<string>",
    "object": "<string>",
    "options": [
      "<string>"
    ],
    "position": 123,
    "required_create": true,
    "required_create_customer": true,
    "required_resolve": true,
    "show_when": {
      "equals": [
        "<string>"
      ],
      "field": "<string>"
    },
    "type_id": "<string>",
    "visible_customer": true
  }
}
```

---

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