Skip to content

HubSpot: Clone a table

HubSpot hubdb.cloneTableDraft: arguments, response, policy and SDK examples.

← Hubdb operations · Get started

Operation hubspot.hubdb_clone_table_draft

Provider route: POST /cms/hubdb/2026-09/tables/{tableIdOrName}/draft/clone. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/hubspot with npm, or alter-sdk-hubspot with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { HubSpotIntegration } from "@alter-ai/hubspot";
async function execute(input: Parameters<HubSpotIntegration["hubdb"]["cloneTableDraft"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new HubSpotIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.hubdb.cloneTableDraft(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_hubspot import HubSpotIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = HubSpotIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.hubdb.clone_table_draft(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.tableIdOrNamestringRequired within parent
bodyModelRequired within parentExpand Clone a table — request body — body

Referenced models: Clone a table — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Clone a table — response body

Referenced models: Clone a table — response body

1 more schema is linked from the tables above, on the schema pages.

Clone a table — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
copyRowsbooleanRequired within parentSpecifies whether to copy the rows during clone
isHubspotDefinedbooleanRequired within parentIndicates whether the table is defined by HubSpot.
newLabelstringOptionalThe new label for the cloned table
newNamestringOptionalThe new name for the cloned table
Clone a table — response body
FieldTypePresenceDescription and constraints
$objectRoot
allowChildTablesbooleanRequired within parentSpecifies whether child tables can be created
allowPublicApiAccessbooleanRequired within parentSpecifies whether the table can be read by public without authorization
columnCountJSONRequired within parent
columnCount (anyOf 1)integerAlternativeNumber of columns including deleted
Format: int64
columnCount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
columnsarrayRequired within parentList of columns in the table
columns[]ModelEach itemExpand Clone a table — response body — columns item
createdAtstringRequired within parentTimestamp at which the table is created
Format: date-time
createdByModelOptionalExpand Clone a table — response body — created By
deletedbooleanRequired within parentSpecifies whether the table is marked as deleted.
deletedAtstringRequired within parentThe timestamp indicating when the table was deleted.
Format: date-time
dynamicMetaTagsobjectRequired within parentSpecifies 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.
Additional keys: see wildcard field
dynamicMetaTags.*JSONAdditional keys
dynamicMetaTags.* (anyOf 1)integerAlternativeFormat: int32
dynamicMetaTags.* (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
enableChildTablePagesbooleanRequired within parentSpecifies creation of multi-level dynamic pages using child tables
idstringRequired within parentId of the table
isOrderedManuallybooleanOptionalIndicates whether the table rows are ordered manually.
labelstringRequired within parentLabel of the table
namestringRequired within parentName of the table
publishedbooleanRequired within parentIndicates whether the table is currently published.
publishedAtstringRequired within parentTimestamp at which the table is published recently
Format: date-time
rowCountJSONRequired within parent
rowCount (anyOf 1)integerAlternativeNumber of rows in the table
Format: int32
rowCount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
updatedAtstringRequired within parentTimestamp at which the table is updated recently
Format: date-time
updatedByModelOptionalExpand Clone a table — response body — created By
useForPagesbooleanRequired within parentSpecifies whether the table can be used for creation of dynamic pages

Referenced models: Clone a table — response body — columns item, Clone a table — response body — created By

Clone a table — response body — columns item
FieldTypePresenceDescription and constraints
$objectRoot
createdAtstringOptionalThe timestamp when the column was created.
Format: date-time
createdByModelOptionalExpand Clone a table — response body — created By
createdByUserIdJSONOptional
createdByUserId (anyOf 1)integerAlternativeThe ID of the user who created the column.
Format: int32
createdByUserId (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
deletedbooleanRequired within parentIndicates whether the column has been deleted.
descriptionstringRequired within parentThe description of the column.
foreignColumnIdJSONOptional
foreignColumnId (anyOf 1)integerAlternativeForeign Column id
Format: int32
foreignColumnId (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
foreignIdsarrayOptionalForeign Ids
foreignIds[]ModelEach itemExpand Clone a table — response body — columns item foreign Ids item
foreignIdsByIdobjectOptionalForeign ids
Additional keys: see wildcard field
foreignIdsById.*ModelAdditional keysExpand Clone a table — response body — columns item foreign Ids item
foreignIdsByNameobjectOptionalForeign ids by name
Additional keys: see wildcard field
foreignIdsByName.*ModelAdditional keysExpand Clone a table — response body — columns item foreign Ids item
foreignTableIdJSONOptional
foreignTableId (anyOf 1)integerAlternativeForeign table id referenced
Format: int64
foreignTableId (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
idstringRequired within parentColumn Id
labelstringRequired within parentLabel of the column
namestringRequired within parentName of the column
optionCountJSONOptional
optionCount (anyOf 1)integerAlternativeNumber of options available
Format: int32
optionCount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
optionsarrayOptionalOptions to choose for select and multi-select columns
options[]ModelEach itemExpand Clone a table — response body — columns item options item
typestringRequired within parentType of the column
Known values: BOOLEAN, CODE, COMPOSITE, CTA, CURRENCY, DATE, DATETIME, EMBED, FILE, FOREIGN_ID, HUBSPOT_VIDEO, IMAGE, JSON, LOCATION, MULTISELECT, NULL, NUMBER, RICHTEXT, SELECT, TEXT, URL, VIDEO
updatedAtstringOptionalThe timestamp when the column was last updated.
Format: date-time
updatedByModelOptionalExpand Clone a table — response body — created By
updatedByUserIdJSONOptional
updatedByUserId (anyOf 1)integerAlternativeThe ID of the user who last updated the column.
Format: int32
updatedByUserId (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
widthJSONOptional
width (anyOf 1)integerAlternativeColumn width for HubDB UI
Format: int32
width (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Referenced models: Clone a table — response body — columns item foreign Ids item, Clone a table — response body — columns item options item, Clone a table — response body — created By

Clone a table — response body — created By
FieldTypePresenceDescription and constraints
$objectRoot
emailstringRequired within parentThe email address of the user.
firstNamestringRequired within parentThe first name of the user.
idstringRequired within parentThe unique identifier for the user.
lastNamestringRequired within parentThe last name of the user.
Clone a table — response body — columns item foreign Ids item
FieldTypePresenceDescription and constraints
$objectRoot
idstringRequired within parentUnique identifier for the foreign ID.
namestringRequired within parentName of the foreign ID.
typestringRequired within parentType of the foreign ID.

SDK function policy ID: hubspot.hubdb_clone_table_draft. Catalog operation: hubdb_clone_table_draft. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["hubdb.tables.write"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.