Update Field
Updates field properties and configuration using either field ID or field name.
curl --request PATCH \
--url https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields/{fieldId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template": {
"options": [
{
"label": "Blocked",
"color": "red"
}
],
"removeOptions": [
{
"option": "Archived",
"reassignTo": "Done"
}
]
}
}
'import requests
url = "https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields/{fieldId}"
payload = { "template": {
"options": [
{
"label": "Blocked",
"color": "red"
}
],
"removeOptions": [
{
"option": "Archived",
"reassignTo": "Done"
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template: {
options: [{label: 'Blocked', color: 'red'}],
removeOptions: [{option: 'Archived', reassignTo: 'Done'}]
}
})
};
fetch('https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields/{fieldId}', 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/{fieldId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'template' => [
'options' => [
[
'label' => 'Blocked',
'color' => 'red'
]
],
'removeOptions' => [
[
'option' => 'Archived',
'reassignTo' => 'Done'
]
]
]
]),
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/{fieldId}"
payload := strings.NewReader("{\n \"template\": {\n \"options\": [\n {\n \"label\": \"Blocked\",\n \"color\": \"red\"\n }\n ],\n \"removeOptions\": [\n {\n \"option\": \"Archived\",\n \"reassignTo\": \"Done\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields/{fieldId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template\": {\n \"options\": [\n {\n \"label\": \"Blocked\",\n \"color\": \"red\"\n }\n ],\n \"removeOptions\": [\n {\n \"option\": \"Archived\",\n \"reassignTo\": \"Done\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields/{fieldId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template\": {\n \"options\": [\n {\n \"label\": \"Blocked\",\n \"color\": \"red\"\n }\n ],\n \"removeOptions\": [\n {\n \"option\": \"Archived\",\n \"reassignTo\": \"Done\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"type": "single_line_text",
"template": {},
"order": 123
}template object structure varies by field type - see Field Types Reference for complete detailsSelect options
Forsingle_select and multiple_select fields, template.options merges into the existing options rather
than replacing them:
- An option that matches an existing one by
valueorlabelupdates it. Any other option is added. - Options you leave out are kept. List every option to reorder them.
- To delete options, pass
template.removeOptions: option IDs or labels, or objects that say what happens to records still using the option.
{
"template": {
"options": [{ "label": "Blocked", "color": "red" }],
"removeOptions": [
"Draft",
{ "option": "Archived", "reassignTo": "Done" },
{ "option": "Stale", "clear": true }
]
}
}
"Draft") is refused with 409 Conflict while any record uses the option. reassignTo moves those records
to another option, and clear: true empties the value. A request that uses reassignTo or clear can only
change the field’s options, so send other changes (like a rename) separately.Path Parameters
Body
Updated field configuration. See Field types for the template of each type. For select fields, options you list are matched to existing options by value or label and updated; options you leave out are kept (listing every option reorders them). To delete options, pass removeOptions: an array of option IDs or labels, or objects like { "option": "Done", "reassignTo": "Open" } or { "option": "Done", "clear": true }. A plain removal is refused while records still use the option.
Field type. See Field types for the value shape and template of each type.
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 Response
Field updated successfully
Field type. See Field types for the value shape and template of each type.
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.
curl --request PATCH \
--url https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields/{fieldId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template": {
"options": [
{
"label": "Blocked",
"color": "red"
}
],
"removeOptions": [
{
"option": "Archived",
"reassignTo": "Done"
}
]
}
}
'import requests
url = "https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields/{fieldId}"
payload = { "template": {
"options": [
{
"label": "Blocked",
"color": "red"
}
],
"removeOptions": [
{
"option": "Archived",
"reassignTo": "Done"
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template: {
options: [{label: 'Blocked', color: 'red'}],
removeOptions: [{option: 'Archived', reassignTo: 'Done'}]
}
})
};
fetch('https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields/{fieldId}', 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/{fieldId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'template' => [
'options' => [
[
'label' => 'Blocked',
'color' => 'red'
]
],
'removeOptions' => [
[
'option' => 'Archived',
'reassignTo' => 'Done'
]
]
]
]),
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/{fieldId}"
payload := strings.NewReader("{\n \"template\": {\n \"options\": [\n {\n \"label\": \"Blocked\",\n \"color\": \"red\"\n }\n ],\n \"removeOptions\": [\n {\n \"option\": \"Archived\",\n \"reassignTo\": \"Done\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields/{fieldId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template\": {\n \"options\": [\n {\n \"label\": \"Blocked\",\n \"color\": \"red\"\n }\n ],\n \"removeOptions\": [\n {\n \"option\": \"Archived\",\n \"reassignTo\": \"Done\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tables.zite.com/api/v1/bases/{databaseId}/tables/{tableId}/fields/{fieldId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template\": {\n \"options\": [\n {\n \"label\": \"Blocked\",\n \"color\": \"red\"\n }\n ],\n \"removeOptions\": [\n {\n \"option\": \"Archived\",\n \"reassignTo\": \"Done\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"type": "single_line_text",
"template": {},
"order": 123
}