---
title: "Update fields in data table"
method: POST
path: "/v1/projects/{project_id}/tables/{id}/fields"
tags: ["DataTable"]
---

# Update fields in data table

`POST /v1/projects/{project_id}/tables/{id}/fields`

## Request

- Base URL: `https://api.telerivet.com`
- URL: `https://api.telerivet.com/v1/projects/{project_id}/tables/{id}/fields`
- Auth: one of:
  - HTTP basic
  - OAuth 2 (authorization code, authorization URL `https://telerivet.com/oauth/authorize`, token URL `https://api.telerivet.com/oauth/token`)

Updates metadata for one or more fields (columns) in the data table. Only the specified fields are updated; other fields are not affected.

 To delete a field, include an object with the `variable` and `delete` properties set (e.g. `{"variable": "my_field", "delete": true}`). Deleting a field will also clear the corresponding variable on all rows in the table.

## Path parameters

- `project_id` string, required
- `id` string, required

## Request body

- object
  - `metadata` object[], required: Array of up to 100 objects describing the fields to create, update, or delete. Each object must contain a `variable` property. Only the properties provided for each field will be updated.
    - `variable` string, required: Variable name of the field
    - `name` string: Display name for the field
    - `type` string: Field type
    - `order` integer: Display order of the field
    - `readonly` boolean: Whether the field is read-only
    - `lookup_key` boolean: Whether the field is a lookup key
    - `items` object[]: For select or radio fields, the list of options
      - `value` string: Option value stored in the database
      - `label` string: Option label displayed to users
    - `delete` boolean: Set to true to delete this field. Other properties besides `variable` are ignored when deleting.

## Response `200`

Successful response

- object[]
  - `name` string: Display name of the field
  - `variable` string: Variable name used in the API
  - `type` string: Field type
  - `order` integer: Display order of the field
  - `readonly` boolean: Whether the field is read-only
  - `lookup_key` boolean: Whether the field is a lookup key

## Other responses

- `400`: Invalid request parameters
- `401`: Invalid or missing API key or Bearer token
- `404`: Resource not found

---

[API](https://skmtc.dev/telerivet/apis/telerivet-api.md) · [All operations](https://skmtc.dev/telerivet/apis/telerivet-api/llms.txt) · [OpenAPI document](https://skmtc.dev/telerivet/apis/telerivet-api/revisions/4e14b1c8d917?raw)
