Skip to main content
POST
/
fact-tables
cURL
curl -X POST https://api.growthbook.io/api/v1/fact-tables \
  -d '{"name":"Orders", "datasource":"ds_abc123", "userIdTypes":["id"], "sql":"SELECT * FROM orders"}' \
  -u secret_abc123DEF456:
{
  "factTable": {
    "id": "<string>",
    "name": "<string>",
    "description": "<string>",
    "owner": "<unknown>",
    "projects": [
      "<string>"
    ],
    "tags": [
      "<string>"
    ],
    "datasource": "<string>",
    "userIdTypes": [
      "<string>"
    ],
    "sql": "<string>",
    "managedBy": "",
    "dateCreated": "2023-11-07T05:31:56Z",
    "dateUpdated": "2023-11-07T05:31:56Z",
    "eventName": "<string>",
    "columns": [
      {
        "column": "<string>",
        "datatype": "number",
        "deleted": false,
        "numberFormat": "",
        "jsonFields": {},
        "name": "<string>",
        "description": "<string>",
        "alwaysInlineFilter": false,
        "isAutoSliceColumn": false,
        "autoSlices": [
          "<string>"
        ],
        "lockedAutoSlices": [
          "<string>"
        ],
        "dateCreated": "2023-11-07T05:31:56Z",
        "dateUpdated": "2023-11-07T05:31:56Z"
      }
    ],
    "columnsError": "<string>",
    "archived": true
  }
}

Documentation Index

Fetch the complete documentation index at: https://growthbook-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

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

curl https://api.growthbook.io/api/v1 \
  -H "Authorization: Bearer secret_abc123DEF456"

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

owner
any
projects
string[]

List of associated project ids

tags
string[]

List of associated tags

eventName
string

The event name used in SQL template variables

managedBy
enum<string>

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

Available options:
,
api,
admin

Response

200 - application/json

Success

factTable
object
required