跳转到主要内容
PUT
/
table
/
{tableId}
/
field
/
{fieldId}
/
convert
Convert field type
curl --request PUT \
  --url http://127.0.0.1:3000/api/table/{tableId}/field/{fieldId}/convert \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "singleSelect",
  "name": "<string>",
  "unique": true,
  "notNull": true,
  "dbFieldName": "<string>",
  "isLookup": true,
  "isConditionalLookup": true,
  "description": "this is a summary",
  "lookupOptions": {
    "foreignTableId": "<string>",
    "lookupFieldId": "<string>",
    "linkFieldId": "<string>",
    "filter": {}
  },
  "options": {
    "expression": "countall({values})",
    "timeZone": "<string>",
    "formatting": "<unknown>",
    "showAs": {
      "type": "url"
    }
  },
  "aiConfig": {
    "modelKey": "<string>",
    "type": "extraction",
    "sourceFieldId": "<string>",
    "isAutoFill": true,
    "attachPrompt": "<string>"
  }
}
'
{
  "id": "<string>",
  "name": "Tags",
  "type": "singleSelect",
  "options": {
    "expression": "countall({values})",
    "timeZone": "<string>",
    "formatting": "<unknown>",
    "showAs": {
      "type": "url"
    }
  },
  "cellValueType": "string",
  "dbFieldType": "TEXT",
  "dbFieldName": "<string>",
  "description": "this is a summary",
  "meta": {
    "persistedAsGeneratedColumn": false
  },
  "aiConfig": {
    "modelKey": "<string>",
    "type": "extraction",
    "sourceFieldId": "<string>",
    "isAutoFill": true,
    "attachPrompt": "<string>"
  },
  "isLookup": true,
  "isConditionalLookup": true,
  "lookupOptions": {
    "relationship": "oneOne",
    "foreignTableId": "<string>",
    "lookupFieldId": "<string>",
    "fkHostTableName": "<string>",
    "selfKeyName": "<string>",
    "foreignKeyName": "<string>",
    "linkFieldId": "<string>",
    "baseId": "<string>",
    "filter": {}
  },
  "notNull": true,
  "unique": true,
  "isPrimary": true,
  "isComputed": true,
  "isPending": true,
  "hasError": true,
  "isMultipleCellValue": true,
  "recordRead": true,
  "recordCreate": true
}

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

路径参数

tableId
string
必填
fieldId
string
必填

请求体

application/json

Provide the complete field configuration including all properties, modified or not

type
enum<string>
必填

The field types supported by teable.

可用选项:
singleLineText,
longText,
user,
attachment,
checkbox,
multipleSelect,
singleSelect,
date,
number,
rating,
formula,
rollup,
conditionalRollup,
link,
createdTime,
lastModifiedTime,
createdBy,
lastModifiedBy,
autoNumber,
button
示例:

"singleSelect"

name
string
Minimum string length: 1
unique
boolean

Whether this field is not unique.

notNull
boolean

Whether this field is not null.

dbFieldName
string

Field(column) name in backend database. Limitation: 1-63 characters, can only contain letters, numbers and underscore, case sensitive, cannot be duplicated with existing db field name in the table.

Minimum string length: 1
isLookup
boolean

Whether this field is lookup field. witch means cellValue and [fieldType] is looked up from the linked table.

isConditionalLookup
boolean

Whether this lookup field applies a conditional filter when resolving linked records.

description
string | null

The description of the field.

示例:

"this is a summary"

lookupOptions
object

The lookup options for field, you need to configure it when isLookup attribute is true or field type is rollup.

options
object

The options of the field. The configuration of the field's options depend on the it's specific type.

aiConfig

The AI configuration of the field.

响应

200 - application/json

Returns field data after update.

id
string
必填

The id of the field.

name
string
必填

The name of the field. can not be duplicated in the table.

示例:

"Tags"

type
enum<string>
必填

The field types supported by teable.

可用选项:
singleLineText,
longText,
user,
attachment,
checkbox,
multipleSelect,
singleSelect,
date,
number,
rating,
formula,
rollup,
conditionalRollup,
link,
createdTime,
lastModifiedTime,
createdBy,
lastModifiedBy,
autoNumber,
button
示例:

"singleSelect"

options
object
必填

The configuration options of the field. The structure of the field's options depend on the field's type.

cellValueType
enum<string>
必填

The cell value type of the field.

可用选项:
string,
number,
boolean,
dateTime
dbFieldType
enum<string>
必填

The field type of database that cellValue really store.

可用选项:
TEXT,
INTEGER,
DATETIME,
REAL,
BLOB,
JSON,
BOOLEAN
dbFieldName
string
必填

Field(column) name in backend database. Limitation: 1-63 characters, can only contain letters, numbers and underscore, case sensitive, cannot be duplicated with existing db field name in the table.

Minimum string length: 1
description
string

The description of the field.

示例:

"this is a summary"

meta
object

The metadata of the field. The structure of the field's meta depend on the field's type. Currently formula and link fields have meta.

aiConfig

The AI configuration of the field.

isLookup
boolean

Whether this field is lookup field. witch means cellValue and [fieldType] is looked up from the linked table.

isConditionalLookup
boolean

Whether this lookup field applies a conditional filter when resolving linked records.

lookupOptions
object

field lookup options.

notNull
boolean

Whether this field is not null.

unique
boolean

Whether this field is not unique.

isPrimary
boolean

Whether this field is primary field.

isComputed
boolean

Whether this field is computed field, you can not modify cellValue in computed field.

isPending
boolean

Whether this field's calculation is pending.

hasError
boolean

Whether This field has a configuration error. Check the fields referenced by this field's formula or configuration.

isMultipleCellValue
boolean

Whether this field has multiple cell value.

recordRead
boolean

Field record read permission. When set to false, reading records is denied. When true or not set, reading records is allowed.

recordCreate
boolean

Field record create permission. When set to false, creating records is denied. When true or not set, creating records is allowed.

Last modified on December 10, 2025