---
title: "Update an existing table"
method: PATCH
path: "/cms/v3/hubdb/tables/{tableIdOrName}/draft"
tags: ["Tables"]
---

# Update an existing table

`PATCH /cms/v3/hubdb/tables/{tableIdOrName}/draft`

Update an existing HubDB table. You can use this endpoint to add or remove columns to the table as well as restore an archived table. Tables updated using the endpoint will only modify the draft verion of the table. Use the `/publish` endpoint to push all the changes to the published version. To restore a table, include the query parameter `archived=true` and `"archived": false` in the json body.
**Note:** You need to include all the columns in the input when you are adding/removing/updating a column. If you do not include an already existing column in the request, it will be deleted.

## Path parameters

- `tableIdOrName` string, required

## Query parameters

- `isGetLocalizedSchema` boolean
- `archived` boolean
- `includeForeignIds` boolean

## Request body

- HubDbTableV3Request
  - `dynamicMetaTags` object — Specifies the key value pairs of the [metadata fields](https://developers.hubspot.com/docs/cms/guides/dynamic-pages/hubdb#dynamic-pages) with the associated column IDs.
  - `allowPublicApiAccess` boolean — Specifies whether the table can be read by public without authorization
  - `useForPages` boolean — Specifies whether the table can be used for creation of dynamic pages
  - `columns` ColumnRequest[] — List of columns in the table
    - `foreignTableId` integer — The id of another table to which the column refers/points to.
    - `name` string, required — Name of the column
    - `options` Option[], required — Options to choose for select and multi-select columns
      - `createdByUserId` integer
      - `createdAt` string, date-time, required
      - `updatedBy` SimpleUser
        - `firstName` string, required
        - `lastName` string, required
        - `id` string, required
        - `email` string, required
      - `createdBy` SimpleUser
        - `firstName` string, required
        - `lastName` string, required
        - `id` string, required
        - `email` string, required
      - `name` string, required
      - `id` string, required
      - `label` string
      - `updatedByUserId` integer
      - `type` string, required
      - `order` integer, required
      - `updatedAt` string, date-time, required
    - `id` integer, required — Column Id
    - `label` string, required — Label of the column
    - `type` 'NULL' | 'TEXT' | 'NUMBER' | 'URL' | 'IMAGE' | 'SELECT' | 'MULTISELECT' | 'BOOLEAN' | 'LOCATION' | 'DATE' | 'DATETIME' | 'CURRENCY' | 'RICHTEXT' | 'FOREIGN_ID' | 'VIDEO' | 'CTA' | 'FILE' | 'JSON' | 'COMPOSITE' | 'CODE', required — Type of the column
    - `foreignColumnId` integer — The id of the column from another table to which the column refers/points to.
  - `name` string, required — Name of the table
  - `enableChildTablePages` boolean — Specifies creation of multi-level dynamic pages using child tables
  - `label` string, required — Label of the table
  - `allowChildTables` boolean — Specifies whether child tables can be created

## Response `200`

successful operation

- HubDbTableV3
  - `dynamicMetaTags` object — Specifies the key value pairs of the [metadata fields](https://developers.hubspot.com/docs/cms/guides/dynamic-pages/hubdb#dynamic-pages) with the associated column IDs.
  - `updatedBy` SimpleUser
    - `firstName` string, required
    - `lastName` string, required
    - `id` string, required
    - `email` string, required
  - `allowPublicApiAccess` boolean — Specifies whether the table can be read by public without authorization
  - `useForPages` boolean — Specifies whether the table can be used for creation of dynamic pages
  - `publishedAt` string, date-time — Timestamp at which the table is published recently
  - `columns` Column[] — List of columns in the table
    - `createdByUserId` integer
    - `foreignTableId` integer — Foreign table id referenced
    - `updatedBy` SimpleUser
      - `firstName` string, required
      - `lastName` string, required
      - `id` string, required
      - `email` string, required
    - `description` string
    - `label` string, required — Label of the column
    - `updatedByUserId` integer
    - `type` 'NULL' | 'TEXT' | 'NUMBER' | 'URL' | 'IMAGE' | 'SELECT' | 'MULTISELECT' | 'BOOLEAN' | 'LOCATION' | 'DATE' | 'DATETIME' | 'CURRENCY' | 'RICHTEXT' | 'FOREIGN_ID' | 'VIDEO' | 'CTA' | 'FILE' | 'JSON' | 'COMPOSITE' | 'CODE', required — Type of the column
    - `optionCount` integer — Number of options available
    - `foreignIds` ForeignId[] — Foreign Ids
      - `name` string, required
      - `id` string, required
      - `type` string, required
    - `createdAt` string, date-time
    - `deleted` boolean
    - `createdBy` SimpleUser
      - `firstName` string, required
      - `lastName` string, required
      - `id` string, required
      - `email` string, required
    - `name` string, required — Name of the column
    - `options` Option[] — Options to choose for select and multi-select columns
      - `createdByUserId` integer
      - `createdAt` string, date-time, required
      - `updatedBy` SimpleUser
        - `firstName` string, required
        - `lastName` string, required
        - `id` string, required
        - `email` string, required
      - `createdBy` SimpleUser
        - `firstName` string, required
        - `lastName` string, required
        - `id` string, required
        - `email` string, required
      - `name` string, required
      - `id` string, required
      - `label` string
      - `updatedByUserId` integer
      - `type` string, required
      - `order` integer, required
      - `updatedAt` string, date-time, required
    - `width` integer — Column width for HubDB UI
    - `id` string — Column Id
    - `foreignIdsById` object — Foreign ids
    - `foreignColumnId` integer — Foreign Column id
    - `foreignIdsByName` object — Foreign ids by name
    - `updatedAt` string, date-time
  - `label` string, required — Label of the table
  - `published` boolean
  - `columnCount` integer — Number of columns including deleted
  - `allowChildTables` boolean — Specifies whether child tables can be created
  - `createdAt` string, date-time — Timestamp at which the table is created
  - `deleted` boolean
  - `createdBy` SimpleUser
    - `firstName` string, required
    - `lastName` string, required
    - `id` string, required
    - `email` string, required
  - `name` string, required — Name of the table
  - `enableChildTablePages` boolean — Specifies creation of multi-level dynamic pages using child tables
  - `id` string — Id of the table
  - `rowCount` integer — Number of rows in the table
  - `isOrderedManually` boolean
  - `updatedAt` string, date-time — Timestamp at which the table is updated recently

## Other responses

- `default` — An error occurred.

## Changes

- **2024-06-04** (v3) `4f23fa1e0b9f` — 1 info
  - api tag `テーブル` removed
- **2024-06-04** (v3) `5e12947894e6` — 1 info
  - api tag `テーブル` added
- **2024-06-04** (v3) `4f23fa1e0b9f` — 1 info
  - api tag `テーブル` removed
- **2024-06-04** (v3) `5e12947894e6` — 1 info
  - api tag `テーブル` added
- **2024-06-04** (v3) `4f23fa1e0b9f` — 1 info
  - api tag `Tabelas` removed

[Full history](https://skmtc.dev/hubspot/apis/cms-hubdb/changes/cms/v3/hubdb/tables/:tableIdOrName/draft/patch.md)

---

[API](https://skmtc.dev/hubspot/apis/cms-hubdb.md) · [All operations](https://skmtc.dev/hubspot/apis/cms-hubdb/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hubspot/cms-hubdb/revisions/7b5dfec02eb7/schema)
