curl --request PATCH \
--url https://api.hubapi.com/cms/v3/hubdb/tables/{tableIdOrName}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"dynamicMetaTags": {},
"allowPublicApiAccess": true,
"useForPages": true,
"columns": [
{
"foreignTableId": 123,
"maxNumberOfCharacters": 123,
"name": "<string>",
"options": [
{
"createdByUserId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"createdBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"name": "",
"id": "",
"label": "",
"updatedByUserId": 123,
"type": "",
"order": 123,
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"id": 123,
"label": "<string>",
"maxNumberOfOptions": 123,
"type": "NULL",
"foreignColumnId": 123
}
],
"name": "<string>",
"enableChildTablePages": true,
"label": "<string>",
"allowChildTables": true
}'
{
"dynamicMetaTags": {},
"updatedBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"allowPublicApiAccess": true,
"useForPages": true,
"publishedAt": "2023-11-07T05:31:56Z",
"columns": [
{
"createdByUserId": 123,
"foreignTableId": 123,
"updatedBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"description": "<string>",
"label": "<string>",
"updatedByUserId": 123,
"type": "NULL",
"optionCount": 123,
"foreignIds": [
{
"name": "<string>",
"id": "<string>",
"type": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"deleted": true,
"createdBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"name": "<string>",
"options": [
{
"createdByUserId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"createdBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"name": "",
"id": "",
"label": "",
"updatedByUserId": 123,
"type": "",
"order": 123,
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"width": 123,
"id": "<string>",
"foreignIdsById": {},
"foreignColumnId": 123,
"foreignIdsByName": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"label": "<string>",
"published": true,
"columnCount": 123,
"allowChildTables": true,
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"deleted": true,
"createdBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"name": "<string>",
"enableChildTablePages": true,
"id": "<string>",
"rowCount": 123,
"isOrderedManually": true,
"updatedAt": "2023-11-07T05:31:56Z"
}
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.
curl --request PATCH \
--url https://api.hubapi.com/cms/v3/hubdb/tables/{tableIdOrName}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"dynamicMetaTags": {},
"allowPublicApiAccess": true,
"useForPages": true,
"columns": [
{
"foreignTableId": 123,
"maxNumberOfCharacters": 123,
"name": "<string>",
"options": [
{
"createdByUserId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"createdBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"name": "",
"id": "",
"label": "",
"updatedByUserId": 123,
"type": "",
"order": 123,
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"id": 123,
"label": "<string>",
"maxNumberOfOptions": 123,
"type": "NULL",
"foreignColumnId": 123
}
],
"name": "<string>",
"enableChildTablePages": true,
"label": "<string>",
"allowChildTables": true
}'
{
"dynamicMetaTags": {},
"updatedBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"allowPublicApiAccess": true,
"useForPages": true,
"publishedAt": "2023-11-07T05:31:56Z",
"columns": [
{
"createdByUserId": 123,
"foreignTableId": 123,
"updatedBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"description": "<string>",
"label": "<string>",
"updatedByUserId": 123,
"type": "NULL",
"optionCount": 123,
"foreignIds": [
{
"name": "<string>",
"id": "<string>",
"type": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"deleted": true,
"createdBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"name": "<string>",
"options": [
{
"createdByUserId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"createdBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"name": "",
"id": "",
"label": "",
"updatedByUserId": 123,
"type": "",
"order": 123,
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"width": 123,
"id": "<string>",
"foreignIdsById": {},
"foreignColumnId": 123,
"foreignIdsByName": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"label": "<string>",
"published": true,
"columnCount": 123,
"allowChildTables": true,
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"deleted": true,
"createdBy": {
"firstName": "<string>",
"lastName": "<string>",
"id": "<string>",
"email": "<string>"
},
"name": "<string>",
"enableChildTablePages": true,
"id": "<string>",
"rowCount": 123,
"isOrderedManually": true,
"updatedAt": "2023-11-07T05:31:56Z"
}
hubdb
The access token received from the authorization server in the OAuth 2.0 flow.
successful operation
The response is of type object
.