Skip to main content
POST
/
dimensions
cURL
curl -X POST https://api.growthbook.io/api/v1/dimensions \
  -d '{"name":"User Country", "datasourceId":"ds_123abc", "identifierType":"user", "query":"SELECT country FROM users"}' \
  -u secret_abc123DEF456:
{
  "dimension": {
    "id": "<string>",
    "dateCreated": "<string>",
    "dateUpdated": "<string>",
    "owner": "<unknown>",
    "datasourceId": "<string>",
    "identifierType": "<string>",
    "name": "<string>",
    "query": "<string>",
    "description": "<string>",
    "managedBy": ""
  }
}

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

Name of the dimension

datasourceId
string
required

ID of the datasource this dimension belongs to

identifierType
string
required

Type of identifier (user, anonymous, etc.)

query
string
required

SQL query or equivalent for the dimension

description
string

Description of the dimension

owner
any
managedBy
enum<string>

Where this dimension must be managed from. If not set (empty string), it can be managed from anywhere.

Available options:
,
api

Response

200 - application/json

Success

dimension
object
required