Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

If using Bearer auth, pass the Secret Key as the token:

Body

application/json
name
string
required
datasource
string
required

The datasource id

userIdTypes
string[]
required

List of identifier columns in this table. For example, "id" or "anonymous_id"

sql
string
required

The SQL query for this fact table

description
string

Description of the fact table

Maximum string length: 10000
owner
string

The userId or email address of the owner. If an email address is provided, it will be used to look up the userId of the matching organization member. If an ID is provided, it will be validated as existing in the organization.

projects
string[]

List of associated project ids

tags
string[]

List of associated tags

userIdColumns
object

Maps an identifier type to the column holding it, for SQL that does not alias its columns to the identifier type names, e.g. {"user_id": "userId"}. May also be a single-level field path into a JSON column (properties.userId). Unmapped types use the identifier type name as the column name.

aggregatedFactTableSettings
object

Settings for maintaining shared daily aggregated tables (a subset of userIdTypes plus the daily update time and restate lookback window) used to speed up CUPED. Requires the data pipeline (pipeline-mode) feature.

timestampColumn
string

The column holding the event timestamp. Must be a date column on this fact table. Defaults to "timestamp" when unset.

eventName
string

The event name used in SQL template variables

columns
object[]

Optional array of column definitions to store for this fact table. Supplied columns are stored as-is. Omit datatype (or send "") on a column to have it auto-detected from the SQL.

managedBy
enum<string>

Set this to "api" to disable editing in the GrowthBook UI

Available options:
,
api,
admin

Response

200 - application/json

Resource created

factTable
object
required