Skip to main content
POST
/
console
/
v1
/
experiments
/
assignment_source
/
{name}
Post Assignment Source
curl --request POST \
  --url https://statsigapi.net/console/v1/experiments/assignment_source/{name} \
  --header 'Content-Type: application/json' \
  --header 'STATSIG-API-KEY: <api-key>' \
  --data '{
  "name": "<string>",
  "description": "<string>",
  "isVerified": true,
  "tags": [
    "<string>"
  ],
  "sql": "<string>",
  "timestampColumn": "<string>",
  "experimentIDColumn": "<string>",
  "groupIDColumn": "<string>",
  "idTypeMapping": [
    {
      "statsigUnitID": "<string>",
      "column": "<string>"
    }
  ],
  "isReadOnly": true,
  "owner": {
    "ownerID": "user123",
    "ownerType": "USER",
    "ownerName": "John Doe",
    "ownerEmail": "owner123@test.com"
  },
  "team": "<string>",
  "teamID": "<string>",
  "dryRun": true
}'
{
  "message": "Assignment Source updated successfully",
  "data": {
    "name": "exposures3",
    "description": "qweqwe",
    "tags": [],
    "sql": "SELECT * FROM shoppy-sales.experiment_data.exposures",
    "timestampColumn": "ts",
    "groupIDColumn": "group_id",
    "experimentIDColumn": "experiment_name",
    "idTypeMapping": [
      {
        "statsigUnitID": "stableID",
        "column": "user_id"
      }
    ]
  }
}

Authorizations

STATSIG-API-KEY
string
header
required

Headers

x-respect-review-settings
string

Optional header to respect review settings for mutation endpoints.

Path Parameters

name
string
required

Name of the assignment source

Body

application/json
sql
string
required

SQL query defining the data source for assignments.

timestampColumn
string
required

Column name representing the timestamp of assignments.

experimentIDColumn
string
required

Column name for the experiment ID associated with the assignments.

groupIDColumn
string
required

Column name for the group ID linked to the assignments.

idTypeMapping
object[]
required

Mappings of Statsig units to their respective columns.

name
string

Optional new name for the assignment source.

description
string

Optional updated context for the assignment source.

isVerified
boolean

Marks the assignment source as verified for internal trustworthiness.

tags
string[]

Optional updated tags for categorization.

isReadOnly
boolean

Specifies if the source can only be edited via the Console API.

owner
object | null

Schema for owner data including ID, type, name. Note that if Entity is created by CONSOLE API, owner will be undefined.

Example:
{
"ownerID": "user123",
"ownerType": "USER",
"ownerName": "John Doe",
"ownerEmail": "owner123@test.com"
}
team
string | null

Optional field indicating the team name responsible for the metric, aiding in accountability and management.

teamID
string | null

Optional field indicating the team ID responsible for the metric, aiding in accountability and management.

dryRun
boolean

Skips persisting the assignment source (used to validate that inputs are correct)

Response

Post Assignment Source response

message
string
required

A simple string explaining the result of the operation.

data
object
required

A single result.

I