> ## Documentation Index
> Fetch the complete documentation index at: https://www.plain.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ThreadFieldSchema

> Defines the shape and behaviour of a custom field that can be attached to threads.



**Kind**: `object`

## Fields

**`id`**: `ID!`

---

**`label`**: `String!`

The human-readable name of the field. Must be unique across all thread field schemas in the workspace; reusing a label fails with `cannot_create_thread_field_schema`.

---

**`key`**: `String!`

A stable identifier for the field used when reading and writing values. Must be lowercase and contain only letters, numbers, and underscores (it is validated against `^[a-z0-9_]+$`), so camelCase and hyphens are rejected. Set at creation and immutable thereafter — correcting a mistyped key means deleting and recreating the field, which discards any stored values.

---

**`description`**: `String!`

---

**`order`**: `Int!`

Controls the position of this field relative to other thread field schemas in the UI.

---

**`type`**: `ThreadFieldSchemaType!`

---

**`enumValues`**: `[String!]!`

Valid options for ENUM-typed fields. Empty for all other field types.

---

**`defaultStringValue`**: `String`

---

**`defaultBooleanValue`**: `Boolean`

---

**`defaultNumberValue`**: `Float`

---

**`defaultDateValue`**: `DateTime`

---

**`isRequired`**: `Boolean!`

When true, a thread cannot be marked as done until this field has a value.

---

**`isAiAutoFillEnabled`**: `Boolean!`

When true, Plain's AI will attempt to automatically fill this field based on the thread's content. Only supported for ENUM and BOOL field types.

---

**`isAvailableToAgents`**: `Boolean!`

When true, this field may be included as context for an AI agent handling the thread.

---

**`isClientReadonly`**: `Boolean!`

When true, the field value can only be set via the API and is not editable by agents in the Plain UI.

---

**`dependsOnThreadField`**: `DependsOnThreadFieldType`

If set, this field is only shown when the referenced sibling field has a specific value. Nesting is capped at one level: the referenced parent field must not itself depend on another thread field, otherwise creation fails with `cannot_create_thread_field_schema` (the dependent nesting level is too deep).

---

**`dependsOnLabels`**: `[DependsOnLabelType!]!`

If non-empty, this field is only shown when the thread has at least one of the listed label types.

---

**`createdAt`**: `DateTime!`

---

**`createdBy`**: `InternalActor!`

---

**`updatedAt`**: `DateTime!`

---

**`updatedBy`**: `InternalActor!`



This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.