Fields
Create Field
Adds a new field to an existing table using either table ID or table name.
POST
/
bases
/
{databaseId}
/
tables
/
{tableId}
/
fields
Create field
curl --request POST \
--url https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "single_select",
"name": "Status",
"template": {
"options": [
{
"label": "Active",
"color": "green"
},
{
"label": "Inactive",
"color": "gray"
}
]
}
}
'import requests
url = "https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields"
payload = {
"type": "single_select",
"name": "Status",
"template": { "options": [
{
"label": "Active",
"color": "green"
},
{
"label": "Inactive",
"color": "gray"
}
] }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'single_select',
name: 'Status',
template: {
options: [{label: 'Active', color: 'green'}, {label: 'Inactive', color: 'gray'}]
}
})
};
fetch('https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'single_select',
'name' => 'Status',
'template' => [
'options' => [
[
'label' => 'Active',
'color' => 'green'
],
[
'label' => 'Inactive',
'color' => 'gray'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields"
payload := strings.NewReader("{\n \"type\": \"single_select\",\n \"name\": \"Status\",\n \"template\": {\n \"options\": [\n {\n \"label\": \"Active\",\n \"color\": \"green\"\n },\n {\n \"label\": \"Inactive\",\n \"color\": \"gray\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"single_select\",\n \"name\": \"Status\",\n \"template\": {\n \"options\": [\n {\n \"label\": \"Active\",\n \"color\": \"green\"\n },\n {\n \"label\": \"Inactive\",\n \"color\": \"gray\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"single_select\",\n \"name\": \"Status\",\n \"template\": {\n \"options\": [\n {\n \"label\": \"Active\",\n \"color\": \"green\"\n },\n {\n \"label\": \"Inactive\",\n \"color\": \"gray\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"type": "single_line_text",
"template": {},
"order": 123
}
Both
type and name are required. The template object structure varies by field type - see Field Types Reference for complete detailsExample Field Creation
Here’s how to create a single select field:{
"type": "single_select",
"name": "Status",
"template": {
"options": [
{"label": "Active", "color": "green"},
{"label": "Inactive", "color": "gray"},
{"label": "Pending", "color": "yellow"},
{"label": "Archived", "color": "red"}
]
}
}
purple, orange, blue, gray, red, yellow, green, pink, lime, tangerine, emerald, sky, teal, indigo, cyan, violet, fuchsia), not hex codes. Omit color to have one assigned.Path Parameters
Body
application/json
Field type. See Field types for the value shape and template of each type.
Available options:
single_line_text, long_text, rich_text, email, url, phone_number, number, currency, percent, rating, duration, single_select, multiple_select, checkbox, date, datetime, attachments, linked_record, lookup, rollup, formula, autonumber, source, created_at, updated_at, created_by, updated_by, user Field-specific configuration. Optional, except for linked_record, lookup, rollup, and formula; source needs an empty object ({}). See Field types for the template of each type.
Response
Field created successfully
Field type. See Field types for the value shape and template of each type.
Available options:
single_line_text, long_text, rich_text, email, url, phone_number, number, currency, percent, rating, duration, single_select, multiple_select, checkbox, date, datetime, attachments, linked_record, lookup, rollup, formula, autonumber, source, created_at, updated_at, created_by, updated_by, user Field-specific configuration options. See Field types for detailed template structure by field type.
⌘I
Create field
curl --request POST \
--url https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "single_select",
"name": "Status",
"template": {
"options": [
{
"label": "Active",
"color": "green"
},
{
"label": "Inactive",
"color": "gray"
}
]
}
}
'import requests
url = "https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields"
payload = {
"type": "single_select",
"name": "Status",
"template": { "options": [
{
"label": "Active",
"color": "green"
},
{
"label": "Inactive",
"color": "gray"
}
] }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'single_select',
name: 'Status',
template: {
options: [{label: 'Active', color: 'green'}, {label: 'Inactive', color: 'gray'}]
}
})
};
fetch('https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'single_select',
'name' => 'Status',
'template' => [
'options' => [
[
'label' => 'Active',
'color' => 'green'
],
[
'label' => 'Inactive',
'color' => 'gray'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields"
payload := strings.NewReader("{\n \"type\": \"single_select\",\n \"name\": \"Status\",\n \"template\": {\n \"options\": [\n {\n \"label\": \"Active\",\n \"color\": \"green\"\n },\n {\n \"label\": \"Inactive\",\n \"color\": \"gray\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"single_select\",\n \"name\": \"Status\",\n \"template\": {\n \"options\": [\n {\n \"label\": \"Active\",\n \"color\": \"green\"\n },\n {\n \"label\": \"Inactive\",\n \"color\": \"gray\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"single_select\",\n \"name\": \"Status\",\n \"template\": {\n \"options\": [\n {\n \"label\": \"Active\",\n \"color\": \"green\"\n },\n {\n \"label\": \"Inactive\",\n \"color\": \"gray\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"type": "single_line_text",
"template": {},
"order": 123
}