curl --request POST \
--url https://statsigapi.net/console/v1/metrics/metric_source/{name} \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '{
"name": "<any>",
"description": "<string>",
"tags": [
"<string>"
],
"sql": "<string>",
"timestampColumn": "<string>",
"timestampAsDay": true,
"idTypeMapping": [
{
"statsigUnitID": "<string>",
"column": "<string>"
}
],
"sourceType": "table",
"tableName": "<string>",
"customFieldMapping": [
{
"key": "<string>",
"formula": "<string>"
}
],
"isReadOnly": true,
"owner": {
"ownerID": "user123",
"ownerType": "USER",
"ownerName": "John Doe",
"ownerEmail": "owner123@test.com"
},
"dryRun": true
}'
{
"message": "Metric source updated successfully.",
"data": {
"name": "test_metric_source4",
"description": "Test description for metric source",
"tags": [
"non_production"
],
"sql": "SELECT * FROM `shoppy-sales.logging.events`",
"timestampColumn": "ts",
"timestampAsDay": true,
"idTypeMapping": [
{
"statsigUnitID": "userID",
"column": "user_id"
}
],
"sourceType": "table",
"tableName": "shoppy-sales.logging.events"
}
}
curl --request POST \
--url https://statsigapi.net/console/v1/metrics/metric_source/{name} \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '{
"name": "<any>",
"description": "<string>",
"tags": [
"<string>"
],
"sql": "<string>",
"timestampColumn": "<string>",
"timestampAsDay": true,
"idTypeMapping": [
{
"statsigUnitID": "<string>",
"column": "<string>"
}
],
"sourceType": "table",
"tableName": "<string>",
"customFieldMapping": [
{
"key": "<string>",
"formula": "<string>"
}
],
"isReadOnly": true,
"owner": {
"ownerID": "user123",
"ownerType": "USER",
"ownerName": "John Doe",
"ownerEmail": "owner123@test.com"
},
"dryRun": true
}'
{
"message": "Metric source updated successfully.",
"data": {
"name": "test_metric_source4",
"description": "Test description for metric source",
"tags": [
"non_production"
],
"sql": "SELECT * FROM `shoppy-sales.logging.events`",
"timestampColumn": "ts",
"timestampAsDay": true,
"idTypeMapping": [
{
"statsigUnitID": "userID",
"column": "user_id"
}
],
"sourceType": "table",
"tableName": "shoppy-sales.logging.events"
}
}
Optional header to respect review settings for mutation endpoints.
name
Update metric source response
The response is of type object
.