---
title: "Set a custom field on a ticket"
method: PUT
path: "/tickets/{ticket}/custom-fields/{customField}"
tags: ["Ticket custom fields"]
---

# Set a custom field on a ticket

`PUT /tickets/{ticket}/custom-fields/{customField}`

## Request

- Base URL: `https://there-there.app/api`
- URL: `https://there-there.app/api/tickets/{ticket}/custom-fields/{customField}`
- Auth: HTTP bearer

Replaces the ticket's value for one custom field. Send `value` for a text field and `option_ulids` for the two select types; sending both, or the wrong one for the field's type, is a validation error. An empty `value` and an empty `option_ulids` clears the field. Returns 404 when the field belongs to another workspace or is not available on the ticket's channel. Read the current values from GET /tickets/{ticket}, which returns the fields that apply to the ticket whether or not they hold a value.

## Path parameters

- `ticket` string, required
- `customField` string, required

## Headers

- `X-Workspace-Id` integer

## Request body

- object
  - `value` string, nullable, required: The text for a text field, or null. Must be null for select fields.
  - `option_ulids` string[], required: The option ULIDs that should end up selected, which replaces the current selection rather than adding to it. At most one for a single-select field. Must be empty for text fields.

## Response `200`

Updated ticket, including its custom fields

- object
  - `data` Ticket
    - `id` integer
    - `ulid` string
    - `number` integer
    - `subject` string
    - `status` 'open' | 'waiting' | 'closed' | 'spam'
    - `channel` Channel
      - `id` integer
      - `ulid` string
      - `name` string
      - `type` 'email' | 'widget'
      - `color` string
      - `email_address` string, nullable
    - `assignee` User
      - `id` integer
      - `name` string
      - `email` string, email
      - `avatar_url` string, nullable
      - `timezone` string, nullable
    - `assigned_team` Team
      - `id` integer
      - `ulid` string
      - `name` string
      - `description` string, nullable
      - `logo_url` string, nullable
      - `member_count` integer
    - `contact` Contact
      - `id` integer
      - `ulid` string
      - `name` string, nullable
      - `email` string, email
      - `avatar_url` string, nullable
      - `company` ContactCompany
        - `ulid` string
        - `name` string
        - `domain` string, nullable
      - `ticket_count` integer, nullable
      - `last_activity_at` string, date-time, nullable
      - `notes` string, nullable
    - `tags` Tag[]
      - `id` integer
      - `ulid` string
      - `name` string
      - `color` string
    - `custom_fields` TicketCustomField[]: Every custom field that applies to this ticket's channel, whether or not it holds a value. Returned on GET /tickets/{ticket} and on every ticket write response; omitted from the paginated list.
      - `ulid` string
      - `name` string
      - `type` 'text' | 'single_select' | 'multi_select'
      - `value` string, nullable: Set for text fields only; null for the two select types.
      - `selected_option_ulids` string[]: Empty for text fields and for select fields with no value.
      - `options` TicketCustomFieldOption[]: The options an admin defined, in the order they arranged them. Empty for text fields.
        - `ulid` string
        - `name` string
        - `color` string, nullable
        - `icon` string, nullable
    - `latest_message_preview` string, nullable
    - `summary` string, nullable
    - `title` string, nullable
    - `from_address` string, nullable
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `last_activity_at` string, date-time

## Other responses

- `422`: Validation failed

---

[API](https://skmtc.dev/there-there/apis/there-there-api.md) · [All operations](https://skmtc.dev/there-there/apis/there-there-api/llms.txt) · [OpenAPI document](https://skmtc.dev/there-there/apis/there-there-api/revisions/1811fb0febc1?raw)
