Tables

Update an existing table

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.

patch/cms/v3/hubdb/tables/{tableIdOrName}/draft

Path parameters

tableIdOrNamestring required

The ID or name of the table to update.

Query parameters

isGetLocalizedSchemaboolean
archivedboolean

Specifies whether to return archived tables. Defaults to false.

includeForeignIdsboolean

Set this to true to populate foreign ID values in the result.

Request body

dynamicMetaTagsobject

Specifies the key value pairs of the metadata fields with the associated column ids

allowPublicApiAccessboolean

Specifies whether the table can be read by public without authorization

useForPagesboolean

Specifies whether the table can be used for creation of dynamic pages

namestring required

Name of the table

enableChildTablePagesboolean

Specifies creation of multi-level dynamic pages using child tables

labelstring required

Label of the table

allowChildTablesboolean

Specifies whether child tables can be created

Example request

{
  "dynamicMetaTags": {
    "DESCRIPTION": 1,
    "FEATURED_IMAGE_URL": 4,
    "LINK_REL_CANONICAL_URL": 5
  },
  "useForPages": true,
  "columns": [
    {
      "id": "1",
      "name": "text_column",
      "type": "TEXT",
      "label": "Text Column"
    }
  ],
  "name": "test_table",
  "label": "Test Table",
  "allowChildTables": true
}

Response

successful operation

dynamicMetaTagsobject

Specifies the key value pairs of the metadata fields with the associated column ids

allowPublicApiAccessboolean

Specifies whether the table can be read by public without authorization

useForPagesboolean

Specifies whether the table can be used for creation of dynamic pages

publishedAtstring date-time

Timestamp at which the table is published recently

labelstring required

Label of the table

publishedboolean
columnCountinteger

Number of columns including deleted

allowChildTablesboolean

Specifies whether child tables can be created

createdAtstring date-time

Timestamp at which the table is created

deletedboolean
namestring required

Name of the table

enableChildTablePagesboolean

Specifies creation of multi-level dynamic pages using child tables

idstring

Id of the table

rowCountinteger

Number of rows in the table

isOrderedManuallyboolean
updatedAtstring date-time

Timestamp at which the table is updated recently

Example response

{
  "dynamicMetaTags": {},
  "useForPages": true,
  "publishedAt": "2020-04-02T16:00:45.009+00:00",
  "columns": [
    {
      "id": "1",
      "name": "text_column",
      "type": "TEXT",
      "label": "Text Column",
      "archived": false,
      "foreignIdsById": {},
      "foreignIdsByName": {}
    }
  ],
  "label": "Test Table",
  "columnCount": 3,
  "allowChildTables": true,
  "createdAt": "2019-03-15T21:20:51.556+00:00",
  "name": "test_table",
  "id": "1630034",
  "updatedAt": "2020-04-02T16:00:43.880+00:00"
}

Changes