curl --request POST \
--url https://api.hubapi.com/cms/v3/hubdb/tables \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allowChildTables": true,
"allowPublicApiAccess": true,
"columns": [
{
"id": 123,
"label": "<string>",
"name": "<string>",
"options": [
{
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"label": "<string>",
"name": "<string>",
"order": 123,
"type": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"createdByUserId": 123,
"updatedByUserId": 123
}
],
"foreignColumnId": 123,
"foreignTableId": 123,
"maxNumberOfCharacters": 123,
"maxNumberOfOptions": 123
}
],
"dynamicMetaTags": {},
"enableChildTablePages": true,
"label": "<string>",
"name": "<string>",
"useForPages": true
}
'import requests
url = "https://api.hubapi.com/cms/v3/hubdb/tables"
payload = {
"allowChildTables": True,
"allowPublicApiAccess": True,
"columns": [
{
"id": 123,
"label": "<string>",
"name": "<string>",
"options": [
{
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"label": "<string>",
"name": "<string>",
"order": 123,
"type": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"createdByUserId": 123,
"updatedByUserId": 123
}
],
"foreignColumnId": 123,
"foreignTableId": 123,
"maxNumberOfCharacters": 123,
"maxNumberOfOptions": 123
}
],
"dynamicMetaTags": {},
"enableChildTablePages": True,
"label": "<string>",
"name": "<string>",
"useForPages": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
allowChildTables: true,
allowPublicApiAccess: true,
columns: [
{
id: 123,
label: '<string>',
name: '<string>',
options: [
{
createdAt: '2023-11-07T05:31:56Z',
id: '<string>',
label: '<string>',
name: '<string>',
order: 123,
type: '<string>',
updatedAt: '2023-11-07T05:31:56Z',
createdByUserId: 123,
updatedByUserId: 123
}
],
foreignColumnId: 123,
foreignTableId: 123,
maxNumberOfCharacters: 123,
maxNumberOfOptions: 123
}
],
dynamicMetaTags: {},
enableChildTablePages: true,
label: '<string>',
name: '<string>',
useForPages: true
})
};
fetch('https://api.hubapi.com/cms/v3/hubdb/tables', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hubapi.com/cms/v3/hubdb/tables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'allowChildTables' => true,
'allowPublicApiAccess' => true,
'columns' => [
[
'id' => 123,
'label' => '<string>',
'name' => '<string>',
'options' => [
[
'createdAt' => '2023-11-07T05:31:56Z',
'id' => '<string>',
'label' => '<string>',
'name' => '<string>',
'order' => 123,
'type' => '<string>',
'updatedAt' => '2023-11-07T05:31:56Z',
'createdByUserId' => 123,
'updatedByUserId' => 123
]
],
'foreignColumnId' => 123,
'foreignTableId' => 123,
'maxNumberOfCharacters' => 123,
'maxNumberOfOptions' => 123
]
],
'dynamicMetaTags' => [
],
'enableChildTablePages' => true,
'label' => '<string>',
'name' => '<string>',
'useForPages' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/cms/v3/hubdb/tables"
payload := strings.NewReader("{\n \"allowChildTables\": true,\n \"allowPublicApiAccess\": true,\n \"columns\": [\n {\n \"id\": 123,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"options\": [\n {\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"order\": 123,\n \"type\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"createdByUserId\": 123,\n \"updatedByUserId\": 123\n }\n ],\n \"foreignColumnId\": 123,\n \"foreignTableId\": 123,\n \"maxNumberOfCharacters\": 123,\n \"maxNumberOfOptions\": 123\n }\n ],\n \"dynamicMetaTags\": {},\n \"enableChildTablePages\": true,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"useForPages\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hubapi.com/cms/v3/hubdb/tables")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allowChildTables\": true,\n \"allowPublicApiAccess\": true,\n \"columns\": [\n {\n \"id\": 123,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"options\": [\n {\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"order\": 123,\n \"type\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"createdByUserId\": 123,\n \"updatedByUserId\": 123\n }\n ],\n \"foreignColumnId\": 123,\n \"foreignTableId\": 123,\n \"maxNumberOfCharacters\": 123,\n \"maxNumberOfOptions\": 123\n }\n ],\n \"dynamicMetaTags\": {},\n \"enableChildTablePages\": true,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"useForPages\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/cms/v3/hubdb/tables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allowChildTables\": true,\n \"allowPublicApiAccess\": true,\n \"columns\": [\n {\n \"id\": 123,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"options\": [\n {\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"order\": 123,\n \"type\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"createdByUserId\": 123,\n \"updatedByUserId\": 123\n }\n ],\n \"foreignColumnId\": 123,\n \"foreignTableId\": 123,\n \"maxNumberOfCharacters\": 123,\n \"maxNumberOfOptions\": 123\n }\n ],\n \"dynamicMetaTags\": {},\n \"enableChildTablePages\": true,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"useForPages\": true\n}"
response = http.request(request)
puts response.read_body{
"allowChildTables": true,
"allowPublicApiAccess": true,
"columnCount": 123,
"columns": [
{
"deleted": true,
"description": "<string>",
"id": "<string>",
"label": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": {
"email": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>"
},
"createdByUserId": 123,
"foreignColumnId": 123,
"foreignIds": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>"
}
],
"foreignIdsById": {},
"foreignIdsByName": {},
"foreignTableId": 123,
"optionCount": 123,
"options": [
{
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"label": "<string>",
"name": "<string>",
"order": 123,
"type": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": {
"email": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>"
},
"createdByUserId": 123,
"updatedBy": {
"email": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>"
},
"updatedByUserId": 123
}
],
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": {
"email": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>"
},
"updatedByUserId": 123,
"width": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"deleted": true,
"deletedAt": "2023-11-07T05:31:56Z",
"dynamicMetaTags": {},
"enableChildTablePages": true,
"id": "<string>",
"label": "<string>",
"name": "<string>",
"published": true,
"publishedAt": "2023-11-07T05:31:56Z",
"rowCount": 123,
"updatedAt": "2023-11-07T05:31:56Z",
"useForPages": true,
"createdBy": {
"email": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>"
},
"isOrderedManually": true,
"updatedBy": {
"email": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>"
}
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Create a table
Creates a new draft HubDB table given a JSON schema. The table name and label should be unique for each account.
curl --request POST \
--url https://api.hubapi.com/cms/v3/hubdb/tables \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allowChildTables": true,
"allowPublicApiAccess": true,
"columns": [
{
"id": 123,
"label": "<string>",
"name": "<string>",
"options": [
{
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"label": "<string>",
"name": "<string>",
"order": 123,
"type": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"createdByUserId": 123,
"updatedByUserId": 123
}
],
"foreignColumnId": 123,
"foreignTableId": 123,
"maxNumberOfCharacters": 123,
"maxNumberOfOptions": 123
}
],
"dynamicMetaTags": {},
"enableChildTablePages": true,
"label": "<string>",
"name": "<string>",
"useForPages": true
}
'import requests
url = "https://api.hubapi.com/cms/v3/hubdb/tables"
payload = {
"allowChildTables": True,
"allowPublicApiAccess": True,
"columns": [
{
"id": 123,
"label": "<string>",
"name": "<string>",
"options": [
{
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"label": "<string>",
"name": "<string>",
"order": 123,
"type": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"createdByUserId": 123,
"updatedByUserId": 123
}
],
"foreignColumnId": 123,
"foreignTableId": 123,
"maxNumberOfCharacters": 123,
"maxNumberOfOptions": 123
}
],
"dynamicMetaTags": {},
"enableChildTablePages": True,
"label": "<string>",
"name": "<string>",
"useForPages": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
allowChildTables: true,
allowPublicApiAccess: true,
columns: [
{
id: 123,
label: '<string>',
name: '<string>',
options: [
{
createdAt: '2023-11-07T05:31:56Z',
id: '<string>',
label: '<string>',
name: '<string>',
order: 123,
type: '<string>',
updatedAt: '2023-11-07T05:31:56Z',
createdByUserId: 123,
updatedByUserId: 123
}
],
foreignColumnId: 123,
foreignTableId: 123,
maxNumberOfCharacters: 123,
maxNumberOfOptions: 123
}
],
dynamicMetaTags: {},
enableChildTablePages: true,
label: '<string>',
name: '<string>',
useForPages: true
})
};
fetch('https://api.hubapi.com/cms/v3/hubdb/tables', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hubapi.com/cms/v3/hubdb/tables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'allowChildTables' => true,
'allowPublicApiAccess' => true,
'columns' => [
[
'id' => 123,
'label' => '<string>',
'name' => '<string>',
'options' => [
[
'createdAt' => '2023-11-07T05:31:56Z',
'id' => '<string>',
'label' => '<string>',
'name' => '<string>',
'order' => 123,
'type' => '<string>',
'updatedAt' => '2023-11-07T05:31:56Z',
'createdByUserId' => 123,
'updatedByUserId' => 123
]
],
'foreignColumnId' => 123,
'foreignTableId' => 123,
'maxNumberOfCharacters' => 123,
'maxNumberOfOptions' => 123
]
],
'dynamicMetaTags' => [
],
'enableChildTablePages' => true,
'label' => '<string>',
'name' => '<string>',
'useForPages' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/cms/v3/hubdb/tables"
payload := strings.NewReader("{\n \"allowChildTables\": true,\n \"allowPublicApiAccess\": true,\n \"columns\": [\n {\n \"id\": 123,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"options\": [\n {\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"order\": 123,\n \"type\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"createdByUserId\": 123,\n \"updatedByUserId\": 123\n }\n ],\n \"foreignColumnId\": 123,\n \"foreignTableId\": 123,\n \"maxNumberOfCharacters\": 123,\n \"maxNumberOfOptions\": 123\n }\n ],\n \"dynamicMetaTags\": {},\n \"enableChildTablePages\": true,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"useForPages\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hubapi.com/cms/v3/hubdb/tables")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allowChildTables\": true,\n \"allowPublicApiAccess\": true,\n \"columns\": [\n {\n \"id\": 123,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"options\": [\n {\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"order\": 123,\n \"type\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"createdByUserId\": 123,\n \"updatedByUserId\": 123\n }\n ],\n \"foreignColumnId\": 123,\n \"foreignTableId\": 123,\n \"maxNumberOfCharacters\": 123,\n \"maxNumberOfOptions\": 123\n }\n ],\n \"dynamicMetaTags\": {},\n \"enableChildTablePages\": true,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"useForPages\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/cms/v3/hubdb/tables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allowChildTables\": true,\n \"allowPublicApiAccess\": true,\n \"columns\": [\n {\n \"id\": 123,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"options\": [\n {\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"order\": 123,\n \"type\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"createdByUserId\": 123,\n \"updatedByUserId\": 123\n }\n ],\n \"foreignColumnId\": 123,\n \"foreignTableId\": 123,\n \"maxNumberOfCharacters\": 123,\n \"maxNumberOfOptions\": 123\n }\n ],\n \"dynamicMetaTags\": {},\n \"enableChildTablePages\": true,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"useForPages\": true\n}"
response = http.request(request)
puts response.read_body{
"allowChildTables": true,
"allowPublicApiAccess": true,
"columnCount": 123,
"columns": [
{
"deleted": true,
"description": "<string>",
"id": "<string>",
"label": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": {
"email": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>"
},
"createdByUserId": 123,
"foreignColumnId": 123,
"foreignIds": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>"
}
],
"foreignIdsById": {},
"foreignIdsByName": {},
"foreignTableId": 123,
"optionCount": 123,
"options": [
{
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"label": "<string>",
"name": "<string>",
"order": 123,
"type": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": {
"email": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>"
},
"createdByUserId": 123,
"updatedBy": {
"email": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>"
},
"updatedByUserId": 123
}
],
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": {
"email": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>"
},
"updatedByUserId": 123,
"width": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"deleted": true,
"deletedAt": "2023-11-07T05:31:56Z",
"dynamicMetaTags": {},
"enableChildTablePages": true,
"id": "<string>",
"label": "<string>",
"name": "<string>",
"published": true,
"publishedAt": "2023-11-07T05:31:56Z",
"rowCount": 123,
"updatedAt": "2023-11-07T05:31:56Z",
"useForPages": true,
"createdBy": {
"email": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>"
},
"isOrderedManually": true,
"updatedBy": {
"email": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>"
}
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Supported products
Supported products
Required Scopes
Required Scopes
承認
The access token received from the authorization server in the OAuth 2.0 flow.
ボディ
Specifies whether child tables can be created
Specifies whether the table can be read by public without authorization
List of columns in the table
Show child attributes
Show child attributes
Specifies the key value pairs of the metadata fields with the associated column IDs.
Show child attributes
Show child attributes
Specifies creation of multi-level dynamic pages using child tables
Label of the table
Name of the table
Specifies whether the table can be used for creation of dynamic pages
レスポンス
successful operation
Specifies whether child tables can be created
Specifies whether the table can be read by public without authorization
Number of columns including deleted
List of columns in the table
Show child attributes
Show child attributes
Timestamp at which the table is created
Specifies whether the table is marked as deleted.
The timestamp indicating when the table was deleted.
Specifies the key value pairs of the metadata fields with the associated column IDs.
Show child attributes
Show child attributes
Specifies creation of multi-level dynamic pages using child tables
Id of the table
Label of the table
Name of the table
Indicates whether the table is currently published.
Timestamp at which the table is published recently
Number of rows in the table
Timestamp at which the table is updated recently
Specifies whether the table can be used for creation of dynamic pages
Show child attributes
Show child attributes
Indicates whether the table rows are ordered manually.
Show child attributes
Show child attributes