Skip to main content
QUERY
threadFieldSchema(threadFieldSchemaId: ID!): ThreadFieldSchema

Arguments

threadFieldSchemaId
ID!
required
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.

enumValues
[String!]!

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

defaultStringValue
String
defaultBooleanValue
Boolean
defaultNumberValue
Float
defaultDateValue
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

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

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

createdAt
createdBy
updatedAt
updatedBy
Query
Variables
Response