Getting Tables

Learn to fetch database tables using the Tables API.

Get published tables

We can create multiple tables using HubSpot CMS. We can send a GET request to the tables endpoint to obtain a list of all tables created under our account.

The base URL to retrieve all published tables is as follows:

https://api.hubspot.com/cms/v3/hubdb/tables

We don’t need to provide any request parameters to this endpoint. However, we can provide some optional query parameters to filter our results. The following table gives details about these parameters:

Request parameters

Parameter

Type

Category

Description

createdAt

string

optional

A UTC timestamp to filter the tables created at the exact time specified by this parameter

createdAfter

string

optional

A UTC timestamp to filter the tables created after the time specified by this parameter

createdBefore

string

optional

A UTC timestamp to filter the tables created before the time specified by this parameter

updatedAt

string

optional

A UTC timestamp to filter the tables updated at the exact time specified by this parameter.

updatedAfter

string

optional

A UTC timestamp to filter the tables updated after the time specified by this parameter.

updatedBefore

string

optional

A UTC timestamp to filter the tables updated before the time specified by this parameter.

sort

string

optional

This value represents the sorting order of the returned tables. Accepted values for this parameter are name, createdAt, createdBy, updatedAt, and updatedBy. By default, the results are sorted by createdAt.

after

string

optional

A cursor value for forward pagination

limit

number

optional

This specifies the number of tables to be returned. The default value is 1000.

archived

boolean

optional

This is set to true if we want to include archived tables in our results. By default, it is set to false.

Let’s retrieve a list of tables we have created in the following code. We won’t use any parameters, but you can try providing some. Feel free to play around!

Note: If your access token has expired, go to the Refreshing Tokens lesson in the Appendix to retrieve a new ...