POST
/
base
/
{baseId}
/
table
curl --request POST \
  --url https://app.teable.io/api/base/%7BbaseId%7D/table/ \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"name":"string","dbTableName":"string","description":"string","icon":"string","fields":[{"type":"singleSelect","name":"Tags","unique":true,"notNull":true,"dbFieldName":"string","isLookup":true,"description":"this is a summary","lookupOptions":{"foreignTableId":"string","lookupFieldId":"string","linkFieldId":"string","filter":{}},"options":{"expression":"countall({values})","timeZone":"string","formatting":{"date":"string","time":"HH:mm","timeZone":"string"},"showAs":{"type":"url"}},"id":"fldxxxxxxxxxxxxxxxx","order":{"viewId":"string","orderIndex":0}}],"views":[{"name":"string","type":"grid","description":"string","order":0,"options":{"rowHeight":"short","frozenColumnCount":0},"sort":{"sortObjs":[{"fieldId":"string","order":"asc"}],"manualSort":true},"filter":{},"group":[{"fieldId":"string","order":"asc"}],"isLocked":true,"shareId":"string","enableShare":true,"shareMeta":{"allowCopy":true,"includeHiddenField":true,"password":"string","includeRecords":true,"submit":{"allow":true,"requireLogin":true}},"columnMeta":{"property1":{"order":0,"width":0,"hidden":true,"statisticFunc":"count"},"property2":{"order":0,"width":0,"hidden":true,"statisticFunc":"count"}},"pluginId":"string"}],"records":[{"fields":{"single line text":"text value"}}],"order":0,"fieldKeyType":"id"}'
{
  "id": "<string>",
  "name": "<string>",
  "dbTableName": "<string>",
  "description": "<string>",
  "icon": "<string>",
  "fields": [
    {
      "id": "<string>",
      "name": "Tags",
      "type": "singleSelect",
      "description": "this is a summary",
      "options": {
        "expression": "countall({values})",
        "timeZone": "<string>",
        "formatting": {
          "date": "<string>",
          "time": "HH:mm",
          "timeZone": "<string>"
        },
        "showAs": {
          "type": "url"
        }
      },
      "isLookup": true,
      "lookupOptions": {
        "foreignTableId": "<string>",
        "lookupFieldId": "<string>",
        "relationship": "oneOne",
        "fkHostTableName": "<string>",
        "selfKeyName": "<string>",
        "foreignKeyName": "<string>",
        "filter": {},
        "linkFieldId": "<string>"
      },
      "notNull": true,
      "unique": true,
      "isPrimary": true,
      "isComputed": true,
      "isPending": true,
      "hasError": true,
      "cellValueType": "string",
      "isMultipleCellValue": true,
      "dbFieldType": "TEXT",
      "dbFieldName": "<string>"
    }
  ],
  "views": [
    {
      "id": "<string>",
      "name": "<string>",
      "type": "grid",
      "description": "<string>",
      "order": 123,
      "options": {
        "rowHeight": "short",
        "frozenColumnCount": 1
      },
      "sort": {
        "sortObjs": [
          {
            "fieldId": "<string>",
            "order": "asc"
          }
        ],
        "manualSort": true
      },
      "filter": {},
      "group": [
        {
          "fieldId": "<string>",
          "order": "asc"
        }
      ],
      "isLocked": true,
      "shareId": "<string>",
      "enableShare": true,
      "shareMeta": {
        "allowCopy": true,
        "includeHiddenField": true,
        "password": "<string>",
        "includeRecords": true,
        "submit": {
          "allow": true,
          "requireLogin": true
        }
      },
      "createdBy": "<string>",
      "lastModifiedBy": "<string>",
      "createdTime": "<string>",
      "lastModifiedTime": "<string>",
      "columnMeta": {},
      "pluginId": "<string>"
    }
  ],
  "records": [
    {
      "id": "<string>",
      "name": "<string>",
      "fields": {},
      "autoNumber": 123,
      "createdTime": "<string>",
      "lastModifiedTime": "<string>",
      "createdBy": "<string>",
      "lastModifiedBy": "<string>"
    }
  ],
  "order": 123,
  "lastModifiedTime": "<string>",
  "defaultViewId": "<string>"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

baseId
string
required

Body

application/json

params for create a table

name
string

The name of the table.

Minimum length: 1
dbTableName
string

Table name in backend database. Limitation: 1-63 characters, start with letter, can only contain letters, numbers and underscore, case insensitive, cannot be duplicated with existing db table name in the base.

description
string | null

The description of the table.

icon
string | null

The emoji icon string of the table.

fields
object[]

The fields of the table. If it is empty, 3 fields include SingleLineText, Number, SingleSelect will and 3 empty records be generated by default.

views
object[]

The views of the table. If it is empty, a grid view will be generated by default.

records
object[]

The record data of the table. If it is empty, 3 empty records will be generated by default.

order
number
fieldKeyType
enum<string>
default:
name

Define the key type of record.fields[key], You can click "systemInfo" in the field edit box to get fieldId or enter the table design screen with all the field details

Available options:
id,
name

Response

201 - application/json
Returns data about a table.

Complete table structure data and initial record data.

id
string
required

The id of table.

name
string
required

The name of the table.

dbTableName
string
required

Table name in backend database. Limitation: 1-63 characters, start with letter, can only contain letters, numbers and underscore, case insensitive, cannot be duplicated with existing db table name in the base.

fields
object[]
required

The fields of the table.

views
object[]
required

The views of the table.

records
object[]
required

The records of the table.

description
string

The description of the table.

icon
string

The emoji icon string of the table.

order
number
lastModifiedTime
string

The last modified time of the table.

defaultViewId
string

The default view id of the table.