HubSpot: Import data into draft table
HubSpot hubdb.importTableDraft: arguments, response, policy and SDK examples.
← Hubdb operations · Get started
Operation hubspot.hubdb_import_table_draft
Provider route: POST /cms/hubdb/2026-09/tables/{tableIdOrName}/draft/import. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”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"]["importTableDraft"]>[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.importTableDraft(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom 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.import_table_draft(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.tableIdOrName | string | Required within parent | |
body | object | Optional | |
body.config | string | Optional | |
body.file | object | Optional | Additional keys: not allowed |
body.file.filename | string | Required within parent | Minimum length: 1 |
body.file.content_type | string | Required within parent | Minimum length: 1 |
body.file.content_base64 | string | Required within parent |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Import data into draft table — response body |
Referenced models: Import data into draft table — response body
Schemas
Section titled “Schemas”Import data into draft table — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
duplicateRows | JSON | Required within parent | |
duplicateRows (anyOf 1) | integer | Alternative | Specifies number of duplicate rows Format: int32 |
duplicateRows (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
errors | array | Required within parent | List of errors during import |
errors[] | Model | Each item | Expand Import data into draft table — response body — errors item |
rowLimitExceeded | boolean | Required within parent | Specifies whether row limit exceeded during import |
rowsImported | JSON | Required within parent | |
rowsImported (anyOf 1) | integer | Alternative | Specifies number of rows imported Format: int32 |
rowsImported (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Referenced models: Import data into draft table — response body — errors item
Import data into draft table — response body — errors item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an error response returned by the API when an operation fails. This component is used in various endpoints to provide detailed information about the error encountered. |
category | string | Required within parent | The error category |
context | object | Optional | Context about the error condition Additional keys: see wildcard field |
context.* | array | Additional keys | |
context.*[] | string | Each item | |
correlationId | string | Required within parent | A unique identifier for the request. Include this value with any error reports or support tickets Format: uuid |
errors | array | Optional | further information about the error |
errors[] | Model | Each item | Expand Batch insert events — response body — errors item errors item |
links | object | Optional | A map of link names to associated URIs containing documentation about the error or recommended remediation steps Additional keys: see wildcard field |
links.* | string | Additional keys | |
message | string | Required within parent | A human readable message describing the error along with remediation steps where appropriate |
subCategory | string | Optional | A specific category that contains more specific detail about the error |
Referenced models: Batch insert events — response body — errors item errors item
Batch insert events — response body — errors item errors item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents detailed information about an error that occurred in the API. This component is used to provide additional context and specifics about errors, typically as part of an error response. |
code | string | Optional | The status code associated with the error detail |
context | object | Optional | Context about the error condition Additional keys: see wildcard field |
context.* | array | Additional keys | |
context.*[] | string | Each item | |
in | string | Optional | The name of the field or parameter in which the error was found. |
message | string | Required within parent | A human readable message describing the error along with remediation steps where appropriate |
subCategory | string | Optional | A specific category that contains more specific detail about the error |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: hubspot.hubdb_import_table_draft. Catalog operation: hubdb_import_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.rows.write"]